diff --git a/.changeset/skill-group-selector.md b/.changeset/skill-group-selector.md new file mode 100644 index 0000000000..6f8c7a1e9a --- /dev/null +++ b/.changeset/skill-group-selector.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": minor +--- + +Add hierarchical group navigation selector for the /skill command. diff --git a/.github/workflows/fork-update-rebase.yml b/.github/workflows/fork-update-rebase.yml new file mode 100644 index 0000000000..39dcba4cca --- /dev/null +++ b/.github/workflows/fork-update-rebase.yml @@ -0,0 +1,51 @@ +name: Fork Update & Automated Rebase + +on: + schedule: + # Run daily at midnight + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + sync-and-rebase: + name: Sync Fork with Upstream and Rebase PRs + runs-on: ubuntu-latest + + steps: + - name: Checkout Fork Main + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Fetch Upstream + run: | + git remote add upstream https://github.com/MoonshotAI/kimi-code.git || true + git fetch upstream main + + - name: Sync Main Branch + run: | + git checkout main + git reset --hard upstream/main + git push origin main --force + + - name: Setup Node & pnpm + uses: pnpm/action-setup@v6 + + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: pnpm + + - name: Install & Verify Build + run: | + pnpm install --no-frozen-lockfile + pnpm run build diff --git a/.github/workflows/pr-conflict-check.yml b/.github/workflows/pr-conflict-check.yml new file mode 100644 index 0000000000..69bdde252c --- /dev/null +++ b/.github/workflows/pr-conflict-check.yml @@ -0,0 +1,51 @@ +name: PR Conflict & Sanity Check + +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +permissions: + contents: read + +jobs: + check-conflict-markers: + name: Check Conflict Markers & Code Health + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Check for Unresolved Conflict Markers + run: | + echo "Searching for unresolved conflict markers (<<<<<<<, =======, >>>>>>>)..." + FOUND=$(grep -rnE "^(<<<<<<<|=======|>>>>>>>)" --exclude-dir={node_modules,.git,dist} . || true) + if [ -n "$FOUND" ]; then + echo "::error::Unresolved conflict markers found in files:" + echo "$FOUND" + exit 1 + else + echo "No conflict markers found." + fi + + - name: Check for Accidental Root Configuration Files + run: | + if [ -f "mcp.json" ]; then + echo "::error::Accidental mcp.json found in repository root!" + exit 1 + fi + + - name: Setup Node & pnpm + uses: pnpm/action-setup@v6 + + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: pnpm + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck & Build Sanity Check + run: pnpm run build diff --git a/.kimi-code/mcp.json b/.kimi-code/mcp.json new file mode 100644 index 0000000000..6799b58803 --- /dev/null +++ b/.kimi-code/mcp.json @@ -0,0 +1,31 @@ +{ + "mcpServers": { + "mcpjungle-localfiles-rag": { + "command": "npx", + "args": [ + "-y", + "mcp-remote", + "http://127.0.0.1:8090/v0/groups/localfiles-rag/mcp", + "--allow-http" + ] + }, + "mcpjungle-coding-architecture": { + "command": "npx", + "args": [ + "-y", + "mcp-remote", + "http://127.0.0.1:8090/v0/groups/coding-architecture/mcp", + "--allow-http" + ] + }, + "mcpjungle-docker-devops": { + "command": "npx", + "args": [ + "-y", + "mcp-remote", + "http://127.0.0.1:8090/v0/groups/docker-devops/mcp", + "--allow-http" + ] + } + } +} diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-BZ3nIcUJ.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-BZ3nIcUJ.js new file mode 100644 index 0000000000..bbdd9045bc --- /dev/null +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-BZ3nIcUJ.js @@ -0,0 +1,22 @@ +import{bR as ao,ci as uo,bQ as Bl,M as El,bl as so,af as gl,bZ as co,c0 as Ol,aU as P,bT as fo,bE as q,az as vo,c1 as wl,c2 as mo,aI as Ll,aL as Xe,s as Nn,bk as Et,cj as bl,u as Sl,I as po,A as ho,bJ as Ln,aY as bt,bL as yo,v as A,aw as St,au as Hn,t as kt,bB as go,bb as Ot,q as w,ck as wo,c4 as bo,c5 as So,c8 as ko,a0 as Co,c3 as kl,aD as xo,bO as Mo,T as Po,as as V,b$ as Bo,cl as Eo}from"./index-DtRfJ0vw.js";import{i as Z,t as Oo}from"./safeRaf-DGuzXxDK.js";import{V as Lo}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js";var Fn=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});let Cl=!1,fn=null,vn=null,Ct=!1,mn=null;function Fo(){return Fn(this,null,function*(){if(mn)return mn;mn=Fn(null,null,function*(){if(!vn){if(Ct)return null;try{if(vn=(function(x){const k=x;if(typeof k?.useMonaco=="function")return k;const M=x?.default;return typeof M?.useMonaco=="function"?M:null})(yield ao(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])),!vn)return Ct=!0,null}catch{return Ct=!0,null}}try{return yield(function(x){return Fn(this,null,function*(){return Cl?void 0:fn||(fn=Fn(null,null,function*(){const M=globalThis?.MonacoEnvironment;M&&(typeof M.getWorker=="function"||typeof M.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Cl=!0}).finally(()=>{fn=null}),fn)})})(vn),uo(),vn}catch{return null}});try{return yield mn}finally{mn=null}})}var $o=Object.defineProperty,No=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,xl=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable,Ml=(x,k,M)=>k in x?$o(x,k,{enumerable:!0,configurable:!0,writable:!0,value:M}):x[k]=M,_=(x,k)=>{for(var M in k||(k={}))zo.call(k,M)&&Ml(x,M,k[M]);if(xl)for(var M of xl(k))To.call(k,M)&&Ml(x,M,k[M]);return x},ye=(x,k)=>No(x,Ho(k)),H=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});const Ro={class:"html-preview-frame__header"},_o={class:"html-preview-frame__title"},Do={class:"html-preview-frame__label"},Wo=["sandbox","srcdoc"],Ao=Bl(El({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const k=x,M=import.meta!==void 0&&!1;let i=null;const{t:de}=Ol(),Oe=w(()=>{const B=k.code||"",L=B.trim().toLowerCase();return L.startsWith(" + + + + + + + + ${B} + +`}),K=w(()=>{return B=k.htmlPreviewSandbox,L=k.htmlPreviewAllowScripts,typeof B=="string"?((function(ke){if(!M||typeof console>"u"||i===ke)return;const ne=(function(S){return new Set(S.trim().toLowerCase().split(/\s+/).filter(Boolean))})(ke);ne.has("allow-scripts")&&ne.has("allow-same-origin")&&(i=ke,console.warn("[markstream-vue] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))})(B),B):B!==void 0?"":L===!0?"allow-scripts":"";var B,L});function ee(B){var L;B.key!=="Escape"&&B.key!=="Esc"||(L=k.onClose)==null||L.call(k)}return xo(()=>{typeof window<"u"&&window.addEventListener("keydown",ee)}),Ll(()=>{typeof window<"u"&&window.removeEventListener("keydown",ee)}),(B,L)=>(Xe(),Nn(Po,{to:"body"},[A("div",{class:Hn(["markstream-vue",{dark:k.isDark}])},[A("div",{class:"html-preview-frame__backdrop",onClick:L[2]||(L[2]=ke=>{var ne;return(ne=k.onClose)==null?void 0:ne.call(k)})},[A("div",{class:"html-preview-frame",onClick:L[1]||(L[1]=Mo(()=>{},["stop"]))},[A("div",Ro,[A("div",_o,[L[3]||(L[3]=A("span",{class:"html-preview-frame__dot"},null,-1)),A("span",Do,Ot(k.title||Et(de)("common.preview")||"Preview"),1)]),A("button",{type:"button",class:"html-preview-frame__close",onClick:L[0]||(L[0]=ke=>{var ne;return(ne=k.onClose)==null?void 0:ne.call(k)})}," × ")]),A("iframe",{class:"html-preview-frame__iframe",sandbox:K.value,referrerpolicy:"no-referrer",srcdoc:Oe.value},null,8,Wo)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]);let Ye=null,xt=null,pn=null,Qe=null,Mt=null,Pt=null;const Bt=new WeakMap;let Io=0;const qo=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-pending"],jo={class:"code-header-main"},Uo=["innerHTML"],Vo={class:"code-header-copy"},Go={class:"code-header-title"},Jo={key:0,class:"code-header-caption"},Ko={class:"code-editor-layer"},Pl="__markstreamMonacoPassiveTouchState__",$n=1.5,Zo=Bl(El({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},customId:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:["previewCode","copy"],setup(x,{emit:k}){var M;const i=x,de=k,Oe=so(),K=gl(co,null),ee=gl("markstreamHostScrollManaged",null),B=w(()=>Bo(i,Oe)),L=Co(),ke=w(()=>{const e=L?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:ne}=Ol(),S=P(null),ge=P(null),zn=P(!1),ce=P(al(i.node.language,i.node.code,ft())),fe=w(()=>wo(ce.value)),Lt=w(()=>fe.value==="plaintext"),ve=P(!1),Ce=P(!1),j=P(!1),me=P(!1),I=P(!1),De=P(!1);let F=!1,We=null,xe="";const Le=P(null),Fe=P(null);let hn=0,Tn=0;const Fl=fo(),Ze=P(null),Y=P(typeof window>"u");typeof window<"u"&&q(()=>ge.value,e=>{var n;if((n=Ze.value)==null||n.destroy(),Ze.value=null,!e)return void(Y.value=!1);const t=window.__MARKSTREAM_CODE_BLOCK_VIEWPORT_ROOT_MARGIN__,l=Fl(e,{rootMargin:typeof t=="string"?t:"400px"});Ze.value=l,Y.value=l.isVisible.value,l.whenVisible.then(()=>{Y.value=!0})},{immediate:!0}),vo(()=>{var e;F=!0,(function(){const n=xe;K&&n&&(xe="",K.markSettled(n))})(),(e=Ze.value)==null||e.destroy(),Ze.value=null});let G=null,yn=null,gn=()=>{},wn=()=>{},en=()=>null,te=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),W=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Rn=()=>{},Ae=()=>{},_n=()=>{},we=null,nn=null,tn=null,Ft=()=>{var e;return String((e=i.node.language)!=null?e:"plaintext")},Dn=()=>H(null,null,function*(){}),$t=!1;const Ie=[],Wn=[];let be=null;function bn(e){var n;return((n=String(e??"").trim().split(/\s+/,1)[0])!=null?n:"")==="diff"}const m=w(()=>{var e;return i.node.diff===!0||bn(i.node.language)||bn(mt(String((e=i.node.raw)!=null?e:"")))}),$e=P({removed:0,added:0}),$l=w(()=>`-${$e.value.removed} +${$e.value.added}`),ln=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5}),Nt=Object.freeze(ye(_({},ln),{enabled:!1,revealLineCount:0}));function An(e){var n;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e;return ye(_(_({},ln),t),{enabled:(n=t.enabled)==null||n})}return _({},ln)}function Ht(e){var n,t,l;if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const o=e.renderSideBySideInlineBreakpoint,a=typeof o=="number"&&Number.isFinite(o)?o:900,r=((t=(n=ge.value)==null?void 0:n.getBoundingClientRect)==null?void 0:t.call(n).width)||((l=ge.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return r>0&&r<=a}function In(e,n){return{original:Sn(e,!1),updated:Sn(n,!1)}}function Sn(e,n){const t=String(e??"");return n?t:t.replace(/\r\n$|\n$|\r$/,"")}function on(e){var n;return String((n=e?.message)!=null?n:e).includes("no diff result available")}function qe(){try{const e=_n();e&&typeof e.catch=="function"&&e.catch(n=>{on(n)})}catch(e){on(e)}}const Q=w(()=>{var e,n,t,l;const o=i.monacoOptions?_({},i.monacoOptions):{};if(!m.value)return o;const a=o.diffHideUnchangedRegions===void 0?_({},ln):An(o.diffHideUnchangedRegions),r=o.hideUnchangedRegions===void 0?void 0:An(o.hideUnchangedRegions),u=i.stream!==!1&&i.loading!==!1,s=u?_({},Nt):a,c=u?_({},Nt):r,d=(function(v){return v.diffWordWrap!==void 0?v.diffWordWrap:"off"})(o),f=_({},(e=o.experimental)!=null?e:{}),y=(n=o.diffUnchangedRegionStyle)!=null?n:"line-info",g=(function(v){if(!Ht(v))return;const h=v.scrollbar&&typeof v.scrollbar=="object"?v.scrollbar:{};return ye(_({},h),{horizontal:"hidden",horizontalScrollbarSize:0})})(o),p={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffWordWrap:d,renderSideBySide:(t=o.renderSideBySide)==null||t,diffHideUnchangedRegions:s,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:y,diffHunkActionsOnHover:!1,experimental:f};return _(ye(_(ye(_(_({},p),o),{experimental:f}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:s,diffWordWrap:d}),g===void 0?{}:{scrollbar:g})}),qn=w(()=>m.value?"diff":"single"),Nl=P(qn.value),ae=P(!1),T=P(!1),ue=P(!1),Ne=P(null),jn=P(0),zt=P(0),le=P(!1),oe=P(!1);let rn=null,an=null,je=!1,Un=null;const Hl=w(()=>{var e,n,t;if(m.value){const o=(e=Q.value)==null?void 0:e.diffWordWrap;if(o==="inherit"){const a=(n=i.monacoOptions)==null?void 0:n.wordWrap;return a==null||String(a)!=="off"}return o==="on"}const l=(t=i.monacoOptions)==null?void 0:t.wordWrap;return l==null||String(l)!=="off"}),kn=w(()=>{var e;return!!m.value&&Ht((e=Q.value)!=null?e:{})});function Tt(e){return ee?.value===!0||!!e&&(!!e.closest('[data-markstream-virtual-timeline="1"], .markstream-virtual-timeline')||!!e.closest(".vue-recycle-scroller, [data-virtualizer], [data-virtual-scroll-root]"))}const Rt=w(()=>Tt(ge.value)),Se=w(()=>!ae.value&&(!!ue.value||(m.value||Rt.value||!Eo())&&!T.value)),_t=w(()=>Se.value||le.value),zl=w(()=>Se.value&&!le.value),Tl=w(()=>!ae.value&&!ue.value&&(Se.value||le.value||oe.value)),Rl=w(()=>T.value&&!ae.value?"ready":ue.value?"fallback":"pending"),Cn=P(!1),Ue=w(()=>Sn(i.node.code,i.node.loading===!0)),Dt=w(()=>m.value?i.node.diff===!0?i.node:ye(_({},i.node),{diff:!0}):Ue.value===i.node.code?i.node:ye(_({},i.node),{code:Ue.value})),ie=P(typeof((M=i.monacoOptions)==null?void 0:M.fontSize)=="number"?i.monacoOptions.fontSize:Number.NaN),z=P(ie.value),Vn=P(null),xn=P(null),_l=w(()=>{const e=ie.value,n=z.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof n=="number"&&Number.isFinite(n)&&n>0}),Gn=w(()=>{var e;const n=Vn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.fontSize;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const l=z.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Wt=w(()=>{var e;const n=xn.value;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const t=(e=i.monacoOptions)==null?void 0:e.lineHeight;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:Gn.value===12?18:Math.max(12,Math.round(1.5*Gn.value))}),Jn=w(()=>Wt.value);function At(e){const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1}function It(e){return e.startsWith("-")&&!e.startsWith("---")}function qt(e){return e.startsWith("+")&&!e.startsWith("+++")}function jt(e){var n;const t=e.some(o=>It(o)),l=e.some(o=>qt(o));return t&&l||bn(i.node.language)&&(t||l)||bn(mt(String((n=i.node.raw)!=null?n:"")))&&(t||l)}const Dl=w(()=>kn.value?(function(){var e,n,t;const l=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(jt(l))return Math.max(1,l.length);const o=String((n=i.node.originalCode)!=null?n:"").split(/\r\n|\n|\r/),a=String((t=i.node.updatedCode)!=null?t:"").split(/\r\n|\n|\r/);let r=0,u=o.length-1,s=a.length-1;for(;r<=u&&r<=s&&o[r]===a[r];)r++;let c=0;for(;u>=r&&s>=r&&o[u]===a[s];)c++,u--,s--;const d=Math.max(0,u-r+1),f=Math.max(0,s-r+1);return Math.max(1,r+d+f+c)})():(function(){var e;const n=String((e=i.node.code)!=null?e:"").split(/\r\n|\n|\r/);if(!jt(n)&&(i.node.originalCode!=null||i.node.updatedCode!=null))return Math.max(At(i.node.originalCode),At(i.node.updatedCode));let t=0,l=0;for(const o of n)It(o)?t++:(qt(o)||t++,l++);return Math.max(1,t,l)})()),Wl=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.tabSize;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:4}),Kn=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.padding;return{top:typeof n?.top=="number"&&Number.isFinite(n.top)&&n.top>0?n.top:0,bottom:typeof n?.bottom=="number"&&Number.isFinite(n.bottom)&&n.bottom>0?n.bottom:0}}),Mn=w(()=>{const e=i.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function Pn(e){if(e==null)return null;const n=Math.ceil(e);return!Number.isFinite(n)||n<=0?null:Math.min(n,Math.ceil(Je()))}const un=w(()=>m.value?Math.ceil(Dl.value*Jn.value):Mn.value!=null?null:Math.ceil((e=>{const n=String(e??"");return n?Math.max(1,n.split(/\r\n|\n|\r/).length):1})(Ue.value)*(Wt.value+$n)+1)),Yn=w(()=>{if(m.value){const n=un.value,t=et();return Pn(t!=null&&n!=null?Math.max(n,t):t??n)}const e=Mn.value;return Pn(e??un.value)}),Al=w(()=>{const e=i.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Qn=P(null),Xn=P(null);function Me(){const e=Qn.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function Zn(){return m.value&&i.stream!==!1&&(i.loading!==!1||Se.value||le.value||oe.value)}function et(){if(!Zn())return null;const e=Xn.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}function Ut(e){if(!Zn()||e==null)return;const n=Math.min(Math.ceil(e),Math.ceil(Je()));if(!Number.isFinite(n)||n<=0)return;const t=et();Xn.value=t==null?n:Math.max(t,n)}const nt=w(()=>{const e=Me();return e??(Se.value||!T.value?Yn.value:null)}),Il=w(()=>{var e;const n=(e=i.monacoOptions)==null?void 0:e.fontFamily,t=Pn(Mn.value),l=Pn(un.value),o=_(_({fontSize:`${Gn.value}px`,lineHeight:`${Jn.value}px`,tabSize:Wl.value,boxSizing:"border-box",maxHeight:`${Je()}px`,overflow:"auto",paddingTop:`${Kn.value.top}px`,paddingBottom:`${Kn.value.bottom}px`},m.value?(function(a){if(a==null)return{};const r=Math.ceil(a),u=Math.ceil(Je()),s=Math.min(r,u);return r>=u?{height:`${s}px`,minHeight:`${s}px`}:{minHeight:`${r}px`}})(Yn.value):t!=null?{height:`${t}px`,minHeight:`${t}px`}:l!=null?{minHeight:`${l}px`}:{}),typeof n=="string"&&n.trim()?{"--markstream-code-font-family":n.trim()}:{});return o["--markstream-pre-line-number-top"]=`${Kn.value.top}px`,o["--markstream-code-padding-left"]="62px",o["--markstream-pre-line-number-width"]="36px",o["--markstream-pre-line-number-gap"]="0px",m.value&&(o["--markstream-pre-diff-line-height"]=`${Jn.value}px`,o["--markstream-pre-diff-pane-bottom-padding"]="10px"),o}),Vt=w(()=>nt.value!=null&&(!T.value||Me()!=null)),ql=w(()=>{const e=nt.value;if(e==null)return null;if(m.value)return Math.ceil(e);const n=Al.value,t=Mn.value;if(n==null||t==null)return Math.ceil(e);const l=Math.max(0,Math.ceil(n)-Math.ceil(t));return Math.ceil(e+l)}),jl=w(()=>{if(m.value&&Se.value)return;const e=nt.value;return Vt.value&&e!=null?{minHeight:`${e}px`}:void 0});function tt(){rn!=null&&typeof window<"u"&&window.clearTimeout(rn),rn=null}function Gt(){if(!m.value||!I.value||!T.value||le.value||oe.value)return!1;const e=S.value;return!!e&&el(e)}function Jt(e,n=!1,t={}){const l=Math.ceil(e),o=Me();if(o==null)return l;const a=t.allowBelowEstimatedFloor===!0||Gt();return l>=o||a?((n||a)&&I.value&&(Qn.value=null),l):o}function pe(){return new Promise(e=>{Z(()=>e())})}function Kt(){try{const e=S.value;if(!e)return null;const n=e.querySelector(".view-lines .view-line");if(n){const t=Math.ceil(n.getBoundingClientRect().height);if(t>0)return t}}catch{}return null}function lt(){var e,n,t,l,o;try{const a=m.value?(t=(n=(e=W())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:W():te(),r=en(),u=(l=r?.EditorOption)==null?void 0:l.fontInfo;if(a&&u!=null){const s=(o=a.getOption)==null?void 0:o.call(a,u),c=s?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const a=S.value;if(a){const r=a.querySelector(".view-lines .view-line");if(r)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const u=window.getComputedStyle(r).fontSize,s=u&&u.match(/^(\d+(?:\.\d+)?)/);if(s)return Number.parseFloat(s[1])}}catch{}}}catch{}return null}function Ve(e){var n,t;try{const a=en(),r=(n=a?.EditorOption)==null?void 0:n.lineHeight;if(r!=null){const u=(t=e?.getOption)==null?void 0:t.call(e,r);if(typeof u=="number"&&u>0)return u}}catch{}const l=Kt();if(l&&l>0)return l;const o=Number.isFinite(z.value)&&z.value>0?z.value:14;return Math.max(12,Math.round(1.35*o))}function Yt(e){var n,t,l;try{const u=en(),s=(n=u?.EditorOption)==null?void 0:n.padding;if(s!=null){const c=(t=e?.getOption)==null?void 0:t.call(e,s),d=typeof c?.top=="number"?c.top:0,f=typeof c?.bottom=="number"?c.bottom:0;if(d>0||f>0)return d+f}}catch{}const o=(l=Q.value)==null?void 0:l.padding,a=typeof o?.top=="number"?o.top:0,r=typeof o?.bottom=="number"?o.bottom:0;return a>0||r>0?a+r:m.value?24:0}function Qt(e,n){return typeof e!="number"||typeof n!="number"||e<1||n=r&&s>=r&&o[u]===a[s];)u--,s--;return{removed:Math.max(0,u-r+1),added:Math.max(0,s-r+1)}})(String((e=i.node.originalCode)!=null?e:""),String((n=i.node.updatedCode)!=null?n:"")):$e.value={removed:0,added:0}}function He(){var e;if(m.value)try{const n=W(),t=(e=n?.getLineChanges)==null?void 0:e.call(n);if(!Array.isArray(t))return void ot();let l=0,o=0;for(const a of t)l+=Qt(a.originalStartLineNumber,a.originalEndLineNumber),o+=Qt(a.modifiedStartLineNumber,a.modifiedEndLineNumber);$e.value={removed:l,added:o}}catch{ot()}else $e.value={removed:0,added:0}}function it(){var e;if(Number.isFinite(z.value)&&z.value>0&&Number.isFinite(ie.value))return z.value;const n=lt();return typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?(ie.value=i.monacoOptions.fontSize,z.value=i.monacoOptions.fontSize,z.value):n&&n>0?(ie.value=n,z.value=n,n):(ie.value=12,z.value=12,12)}function Ul(){const e=it(),n=Math.min(36,e+1);z.value=n}function Vl(){const e=it(),n=Math.max(10,e-1);z.value=n}function Gl(){it(),Number.isFinite(ie.value)&&(z.value=ie.value)}function Zt(){var e,n,t,l,o,a,r,u,s,c,d,f,y,g;try{const p=m.value?W():null,v=m.value?p:te();if(!v)return null;if(p?.getOriginalEditor&&p?.getModifiedEditor){const E=(e=p.getOriginalEditor)==null?void 0:e.call(p),O=(n=p.getModifiedEditor)==null?void 0:n.call(p);(t=E?.layout)==null||t.call(E),(l=O?.layout)==null||l.call(O);const C=((o=E?.getContentHeight)==null?void 0:o.call(E))||0,U=((a=O?.getContentHeight)==null?void 0:a.call(O))||0,N=Math.max(C,U);if(N>0)return Math.ceil(N+1);const D=((s=(u=(r=E?.getModel)==null?void 0:r.call(E))==null?void 0:u.getLineCount)==null?void 0:s.call(u))||1,R=((f=(d=(c=O?.getModel)==null?void 0:c.call(O))==null?void 0:d.getLineCount)==null?void 0:f.call(d))||1,se=Math.max(D,R),wt=Math.max(Ve(E),Ve(O));return Math.ceil(se*(wt+$n)+0+1)}if(v?.getContentHeight){(y=v?.layout)==null||y.call(v);const E=v.getContentHeight();if(E>0)return Math.ceil(E+1)}const h=(g=v?.getModel)==null?void 0:g.call(v);let b=1;h&&typeof h.getLineCount=="function"&&(b=h.getLineCount());const $=Ve(v);return Math.ceil(b*($+$n)+0+1)}catch{return null}}function el(e){if(typeof window>"u")return!1;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return!1;const t=e.querySelectorAll(".editor.modified .diff-hidden-lines .center, .stream-monaco-diff-unchanged-bridge");for(const l of Array.from(t)){if(!(l instanceof HTMLElement))continue;const o=window.getComputedStyle(l);if(o.display==="none"||o.visibility==="hidden"||Number.parseFloat(o.opacity||"1")<=.01)continue;const a=l.getBoundingClientRect();if(!(a.width<=0||a.height<=0||a.bottom<=n.top||a.top>=n.bottom))return!0}return!1}function rt(e){var n;const t=String(e??"").trim(),l=(n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:n[1];if(l){const s=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(s.slice(0,2),16)+.7152*Number.parseInt(s.slice(2,4),16)+.0722*Number.parseInt(s.slice(4,6),16)}const o=t.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[a,r,u]=o.slice(0,3).map(Number);return .2126*a+.7152*r+.0722*u}function nl(){var e;const n=(e=S.value)==null?void 0:e.parentElement;return n instanceof HTMLElement?n:null}function sn(e,n){var t;n==null||!Number.isFinite(n)||n<=0||(t=nl())==null||t.style.setProperty(e,`${n}px`)}function Bn(){var e,n,t;if(tl())return;const l=lt();l&&l>0&&(Vn.value=l,z.value=l,ie.value=l);try{const o=Ve(m.value?(t=(n=(e=W())==null?void 0:e.getModifiedEditor)==null?void 0:n.call(e))!=null?t:W():te());o&&o>0&&(xn.value=o)}catch{}try{const o=Kt();o&&o>0&&(xn.value=o)}catch{}}function tl(){return m.value&&_t.value}function dn(){var e;if(!m.value||!Se.value&&!le.value&&!oe.value)return null;const n=S.value,t=(e=ge.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!n||!t)return null;const l=Math.ceil(t.getBoundingClientRect().height);return!Number.isFinite(l)||l<=0?null:(n.style.height=`${l}px`,n.style.minHeight=`${l}px`,n.style.maxHeight=`${Math.ceil(Je())}px`,n.style.overflow="hidden",l)}function at(){var e,n,t,l,o,a,r,u;const s=S.value,c=ge.value;if(!s||!c)return;const d=s,f=s.querySelector(".monaco-editor")||s,y=f.querySelector(".monaco-editor-background")||f,g=f.querySelector(".view-lines")||f;let p=null,v=null,h=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(p=window.getComputedStyle(f),v=y===f?p:window.getComputedStyle(y),h=g===f?p:window.getComputedStyle(g))}catch{p=null,v=null,h=null}const b=String((e=p?.getPropertyValue("--vscode-editor-foreground"))!=null?e:"").trim(),$=String((n=p?.getPropertyValue("--vscode-editor-background"))!=null?n:"").trim(),E=String((l=(t=p?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?t:p?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?l:"").trim(),O=b||String((a=(o=h?.color)!=null?o:p?.color)!=null?a:"").trim(),C=$||String((u=(r=v?.backgroundColor)!=null?r:p?.backgroundColor)!=null?u:"").trim();return m.value?(O?(c.style.setProperty("--markstream-diff-editor-fg",O),d.style.setProperty("--vscode-editor-foreground",O),d.style.setProperty("--stream-monaco-editor-fg",O)):(c.style.removeProperty("--markstream-diff-editor-fg"),d.style.removeProperty("--vscode-editor-foreground"),d.style.removeProperty("--stream-monaco-editor-fg")),C?(c.style.setProperty("--markstream-diff-editor-bg",C),c.style.setProperty("--markstream-diff-panel-bg",C),c.style.setProperty("--markstream-diff-panel-bg-soft",C),c.style.setProperty("--markstream-diff-panel-bg-strong",C),d.style.setProperty("--vscode-editor-background",C),d.style.setProperty("--stream-monaco-editor-bg",C),d.style.setProperty("--stream-monaco-fixed-editor-bg",C),d.style.setProperty("--stream-monaco-panel-bg",C),d.style.setProperty("--stream-monaco-panel-bg-soft",C),d.style.setProperty("--stream-monaco-panel-bg-strong",C),d.style.backgroundColor=C):(c.style.removeProperty("--markstream-diff-editor-bg"),c.style.removeProperty("--markstream-diff-panel-bg"),c.style.removeProperty("--markstream-diff-panel-bg-soft"),c.style.removeProperty("--markstream-diff-panel-bg-strong"),d.style.removeProperty("--vscode-editor-background"),d.style.removeProperty("--stream-monaco-editor-bg"),d.style.removeProperty("--stream-monaco-fixed-editor-bg"),d.style.removeProperty("--stream-monaco-panel-bg"),d.style.removeProperty("--stream-monaco-panel-bg-soft"),d.style.removeProperty("--stream-monaco-panel-bg-strong"),d.style.backgroundColor=""),void(E?d.style.setProperty("--vscode-editor-selectionBackground",E):d.style.removeProperty("--vscode-editor-selectionBackground"))):(function(U,N,D){if(!Lt.value)return!1;const R=rt(U),se=rt(N);return D?R!=null&&R>170||se!=null&&se<110:R!=null&&R<85||se!=null&&se>190})(C,O,c.classList.contains("is-dark"))?(d.style.removeProperty("--vscode-editor-foreground"),d.style.removeProperty("--vscode-editor-background"),void d.style.removeProperty("--vscode-editor-selectionBackground")):(O&&d.style.setProperty("--vscode-editor-foreground",O),C&&d.style.setProperty("--vscode-editor-background",C),void(E&&d.style.setProperty("--vscode-editor-selectionBackground",E)))}let ut=0,st=0;const ll=/auto|scroll|overlay/i;function he(e,n,t){var l;if(typeof window>"u"||m.value||(function(d){return Rt.value||Tt(d)})(e))return;const o=Math.ceil(n),a=Math.ceil(t)-o;if(Math.abs(a)<=1)return;const r=(function(d){var f,y;if(typeof window>"u")return null;const g=(f=d?.ownerDocument)!=null?f:document,p=g.scrollingElement||g.documentElement||g.body;let v=(y=d?.parentElement)!=null?y:null;for(;v&&v!==g.body&&v!==p;){const h=window.getComputedStyle(v),b=(h.overflowY||"").toLowerCase(),$=(h.overflow||"").toLowerCase();if(ll.test(b)||ll.test($))return v;v=v.parentElement}return p})(e);if(!r)return;const u=(l=e.ownerDocument)!=null?l:document,s=r===u.body||r===u.documentElement||r===u.scrollingElement,c=s?0:r.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(s&&typeof window.scrollBy=="function"?window.scrollBy(0,a):r.scrollTop+=a)}function dt(){try{const e=S.value;if(!e)return;const n=e.getBoundingClientRect().height,t=Zt();if(t!=null&&t>0){const o=Jt(t,!0),a=Me();return e.style.minHeight=a!=null?`${a}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void he(e,n,o)}const l=Me();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",he(e,n,l))}catch{}}function Ge(){for(var e,n;Ie.length>0;)try{(n=(e=Ie.pop())==null?void 0:e.dispose)==null||n.call(e)}catch{}We!=null&&(Oo(We),We=null)}function Pe(){for(var e;Wn.length>0;)try{(e=Wn.pop())==null||e()}catch{}}function J(e=!1){Ce.value||(ve.value?dt():(function(){var n;try{const t=S.value;if(!t)return;const l=t.getBoundingClientRect().height,o=Je(),a=Math.ceil(((n=t.getBoundingClientRect)==null?void 0:n.call(t).height)||0),r=m.value?(function(){var v,h,b,$,E,O,C,U;try{const N=W(),D=(v=N?.getOriginalEditor)==null?void 0:v.call(N),R=(h=N?.getModifiedEditor)==null?void 0:h.call(N);if(!D||!R)return null;const se=((E=($=(b=D.getModel)==null?void 0:b.call(D))==null?void 0:$.getLineCount)==null?void 0:E.call($))||1,wt=((U=(C=(O=R.getModel)==null?void 0:O.call(R))==null?void 0:C.getLineCount)==null?void 0:U.call(C))||1,oo=Math.max(se,wt),io=Math.max(Ve(D),Ve(R)),ro=Math.max(Yt(D),Yt(R));return Math.ceil(oo*(io+$n)+ro+0+1)}catch{return null}})():null,u=m.value&&el(t),s=u&&I.value&&T.value&&!le.value&&!oe.value;if(u||(Fe.value=null),Tn>0&&(Tn--,Le.value!=null))return void he(t,l,Be(t,Le.value,o,{allowBelowEstimatedFloor:s}));if(m.value&&(Se.value||le.value||oe.value)){const v=dn();if(v!=null){const h=Be(t,v,o,{allowBelowEstimatedFloor:!0});return cn(!0),void he(t,l,h)}}const c=m.value?(function(v){var h,b;if(typeof window>"u")return null;try{const $=v.getBoundingClientRect(),E=window.getComputedStyle(v);if(E.display==="none"||E.visibility==="hidden")return null;const O=[".editor.original .view-lines .view-line",".editor.modified .view-lines .view-line",".editor.original .view-zones > div",".editor.modified .view-zones > div",".editor.original .margin-view-zones > div",".editor.modified .margin-view-zones > div",".editor.original .diff-hidden-lines",".editor.modified .diff-hidden-lines",".stream-monaco-diff-unchanged-bridge"];let C=0;for(const D of Array.from(v.querySelectorAll(O.join(",")))){if(!(D instanceof HTMLElement))continue;const R=window.getComputedStyle(D);if(R.display==="none"||R.visibility==="hidden"||Number.parseFloat(R.opacity||"1")<=.01)continue;const se=D.getBoundingClientRect();se.height<=0||se.bottom<=$.top||(C=Math.max(C,se.bottom-$.top))}if(C>0)return Math.ceil(C);const U=v.querySelector(".monaco-diff-editor"),N=(b=(h=U?.getBoundingClientRect)==null?void 0:h.call(U).height)!=null?b:0;return N>0?Math.ceil(N+1):null}catch{return null}})(t):null,d=m.value&&kn.value&&!u&&c!=null?Math.ceil(c+10):c;let f;if(f=m.value?u?c:kn.value&&d!=null?d:r!=null?Math.max(d??0,r):d:Zt(),f!=null&&f>0){const v=Fe.value!=null&&Date.now()=o-1,h=u&&a>0&&a=o-1,b=Be(t,v?Fe.value:h?a:f,o,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:s});return u&&b0?r:0);if(y>0){const v=Fe.value!=null&&Date.now()=o-1,h=u&&a>0&&a=o-1,b=Be(t,v?Fe.value:h?a:y,o,{allowBelowEstimatedFloor:s});return u&&b0?he(t,l,Be(t,p,o,{allowBelowEstimatedFloor:s})):m.value||he(t,l,Be(t,o,o))}catch{}})())}function ol(){ut=0,st=0}function cn(e=!1){var n,t,l;const o=S.value;if(!o)return;const a=m.value?W():te();if(a&&typeof a.layout=="function")try{const r=(n=o.getBoundingClientRect)==null?void 0:n.call(o),u=Math.ceil(((t=r?.width)!=null?t:0)||o.clientWidth||0),s=Math.ceil(((l=r?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&s>0){if(!e&&u===ut&&s===st)return;ut=u,st=s,a.layout({width:u,height:s})}else ol(),a.layout()}catch{}}function re(){if(!m.value)return void Pe();const e=S.value;if(!e)return void Pe();const n=e.querySelector(".monaco-diff-editor");if(!n||n.classList.contains("side-by-side"))return void Pe();const t=Array.from(n.querySelectorAll(".editor.original .diff-hidden-lines")),l=Array.from(n.querySelectorAll(".editor.modified .diff-hidden-lines")),o=Math.min(t.length,l.length);for(let a=0;a div:first-child"),c=r.querySelector(".center");if(!u||!s||!c||c.querySelector(".markstream-inline-fold-proxy"))continue;const d=document.createElement("button");d.type="button",d.className="markstream-inline-fold-proxy",d.dataset.markstreamInlineFoldProxy="true";const f=u.getAttribute("title")||"Show Unchanged Region";d.title=f,d.setAttribute("aria-label",f);const y=v=>{v.preventDefault(),v.stopPropagation()},g=v=>{v.preventDefault(),v.stopPropagation(),u.click(),Z(()=>X())},p=v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopPropagation(),u.click(),Z(()=>X()))};d.addEventListener("mousedown",y),d.addEventListener("click",g),d.addEventListener("keydown",p),c.appendChild(d),Wn.push(()=>{d.removeEventListener("mousedown",y),d.removeEventListener("click",g),d.removeEventListener("keydown",p),d.parentElement===c&&c.removeChild(d)})}}function X(e=!1){We==null&&(We=Z(()=>{We=null,Z(()=>{re(),J(e),cn()})}))}function Be(e,n,t,l={}){Ut(n);const o=et(),a=o!=null?Math.max(n,o):n,r=Math.min(a,t),u=l.allowBelowEstimatedFloor===!0||Gt(),s=Jt(r,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:u}),c=Me();if(e.style.minHeight=c==null||u?"0px":`${Math.min(c,Math.ceil(t))}px`,e.style.height=`${s}px`,e.style.maxHeight=`${Math.ceil(t)}px`,m.value)e.style.overflow="hidden";else{const d=a>t+1;e.style.overflow=d?"auto":"hidden"}return s}function il(e=S.value){return!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function Jl(){const e=W();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function rl(e,n,t){return H(this,null,function*(){try{return void(yield wn(e,n,t))}catch(l){if(!on(l))throw l}if(yield V(),yield pe(),!F&&m.value)try{yield wn(e,n,t)}catch(l){if(!on(l))throw l}})}function Je(){var e,n;const t=(n=(e=i.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?n:500;if(typeof t=="number")return t;const l=String(t).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const ct=w(()=>i.isShowPreview&&(ce.value==="html"||ce.value==="svg"));function ft(){return typeof i.node.loading=="boolean"?i.node.loading:i.loading===!0}function al(e,n,t){return t&&!String(n??"")?"plain":wl(String(e??""))}function En(){var e,n,t,l;return!(!ft()||(m.value?String((e=i.node.originalCode)!=null?e:"")||String((n=i.node.updatedCode)!=null?n:"")||String((t=i.node.code)!=null?t:""):String((l=i.node.code)!=null?l:"")))}q(()=>[i.node.language,i.node.code,i.node.loading,i.loading],([e,n,t,l])=>{ce.value=al(e,n,typeof t=="boolean"?t:l===!0)}),q(()=>[i.node.originalCode,i.node.updatedCode,m.value],()=>{ot(),Z(()=>He())},{immediate:!0}),q(()=>[m.value,i.stream,i.loading,Se.value,le.value,oe.value,un.value],()=>{Zn()?Ut(un.value):Xn.value=null},{immediate:!0}),q(()=>[i.node.originalCode,i.node.updatedCode,fe.value,m.value],e=>H(null,[e],function*([,,,n]){var t,l;if(i.stream===!1||!n)return;if(G&&!j.value&&S.value)try{yield Ee(S.value)}catch{}const o=nn;if(o&&!me.value){try{yield o}catch{}if(F||!m.value)return}const a=In(String((t=i.node.originalCode)!=null?t:""),String((l=i.node.updatedCode)!=null?l:"")),r=i.loading===!1;r&&Te();try{yield rl(a.original,a.updated,fe.value),cn(!0)}catch{return}if(r){if(F||!m.value)return;qe(),re(),He(),X()}ve.value&&Z(()=>dt())})),q(()=>i.node.code,e=>H(null,null,function*(){if(i.stream===!1||(ce.value||(ce.value=wl(Ft(e))),m.value))return;const n=nn;if(n&&!me.value){try{yield n}catch{}if(F||m.value)return}if(G&&!j.value&&S.value)try{yield Ee(S.value)}catch{}gn(Sn(i.node.code,i.node.loading===!0),fe.value),ve.value&&Z(()=>dt())}));const vt=w(()=>{const e=ce.value;return e?kl[e]||e.charAt(0).toUpperCase()+e.slice(1):kl[""]});function mt(e){var n,t;const l=(t=(n=String(e??"").split(/\r?\n/,1)[0])==null?void 0:n.trim())!=null?t:"";if(l.length<3)return"";const o=l[0];if(o!=="`"&&o!=="~"||l[1]!==o||l[2]!==o)return"";let a=3;for(;l[a]===o;)a+=1;return l.slice(a).trim()}const ul=w(()=>{var e;return(function(n){const t=mt(n);if(!t)return"";const l=t.split(/\s+/).filter(Boolean);if(!l.length)return"";const o=l[0]==="diff"?l.slice(1):l;for(const a of o){const r=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(r&&/[./\\-]/.test(r))return r}return""})(String((e=i.node.raw)!=null?e:""))}),Kl=w(()=>ul.value||vt.value),sl=w(()=>ul.value?m.value?`Diff / ${vt.value}`:vt.value:""),Yl=w(()=>(bo.value,So(ce.value||""))),Ql=w(()=>{const e={},n=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},t=n(i.minWidth),l=n(i.maxWidth);if(t&&(e.minWidth=t),l&&(e.maxWidth=l),Vt.value&&!m.value){const o=ql.value;o!=null&&(e.minHeight=`${o}px`)}return m.value||(e.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",e.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",e.borderColor="var(--markstream-code-border-color)"),e}),dl=w(()=>i.showTooltips!==!1);function Xl(){return H(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(i.node.code)),zn.value=!0,de("copy",i.node.code),setTimeout(()=>{zn.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function Zl(e){if(ve.value=!ve.value,e&&dl.value){const l=(function(o){const a=o.currentTarget||o.target;return!a||a.disabled?null:a})(e);if(l){const o=ve.value?ne("common.collapse")||"Collapse":ne("common.expand")||"Expand";ko(l,o,"top",!1,void 0,i.isDark)}}const n=m.value?W():te(),t=S.value;n&&t&&(ve.value?(On(!0),t.style.maxHeight="none",t.style.overflow="visible",J(!0)):(On(!1),t.style.overflow=m.value?"hidden":"auto",J(!0)))}function eo(){var e,n,t;if(Ce.value=!Ce.value,Ce.value){if(S.value){const l=Math.ceil(((n=(e=S.value).getBoundingClientRect)==null?void 0:n.call(e).height)||0);l>0&&(Le.value=l)}On(!1)}else{ve.value&&On(!0),S.value&&Le.value!=null&&(S.value.style.height=`${Le.value}px`);const l=m.value?W():te();try{(t=l?.layout)==null||t.call(l)}catch{}Tn=2,Z(()=>{J(!0)})}}function no(){if(!ct.value)return;const e=ce.value;if(ke.value){const n=e==="html"?"text/html":"image/svg+xml",t=e==="html"?ne("artifacts.htmlPreviewTitle")||"HTML Preview":ne("artifacts.svgPreviewTitle")||"SVG Preview";return void de("previewCode",{node:i.node,artifactType:n,artifactTitle:t,id:`temp-${e}-${Date.now()}`})}e==="html"&&(Cn.value=!Cn.value)}function On(e){var n,t;try{if(m.value){const l=W();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}else{const l=te();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}}catch{}}function Ee(e,n={}){if(!G||F||i.stream===!1&&i.loading!==!1||(gt(),yl())||ae.value||S.value!==e||En())return null;if(we)return we;if(j.value&&I.value)return Promise.resolve();const t=yt(),l=jn.value;let o=!1;j.value=!0,(function(){const r=B.value;K&&r&&xe!==r&&(xe&&K.markSettled(xe),xe=r,K.markPending(r))})();const a=H(null,null,function*(){try{yield(function(r){return H(this,null,function*(){var u;if(typeof window>"u")return yield r();const s=(u=window.Element)==null?void 0:u.prototype,c=s?.addEventListener;if(!s||!c)return yield r();const d=(function(){const f=window,y=f[Pl];if(y)return y;const g={depth:0,original:null};return f[Pl]=g,g})();try{d.depth===0&&(d.original=c,s.addEventListener=function(f,y,g){var p;const v=(p=d.original)!=null?p:c;return f==="touchstart"&&(function(h,b){if(!h)return!1;const $=h;return!(typeof $.closest!="function"||!$.closest(".monaco-editor, .monaco-diff-editor")||b&&typeof b=="object"&&"passive"in b)})(this,g)?v.call(this,f,y,(function(h){return h==null?{passive:!0}:typeof h=="boolean"?{capture:h,passive:!0}:typeof h=="object"?"passive"in h?h:ye(_({},h),{passive:!0}):{passive:!0}})(g)):v.call(this,f,y,g)}),d.depth++}catch{return yield r()}try{return yield r()}finally{d.depth=Math.max(0,d.depth-1),d.depth===0&&d.original&&s.addEventListener!==d.original&&(s.addEventListener=d.original,d.original=null)}})})(()=>(function(r){return H(this,null,function*(){var u;if(!G||F||(ue.value=!1,Ne.value=null,me.value=!1,T.value=!1,le.value=!1,oe.value=!1,tt(),Vn.value=null,xn.value=null,(function(){const f=nl();f&&(f.style.removeProperty("--stream-monaco-line-number-left"),f.style.removeProperty("--stream-monaco-line-number-width"),f.style.removeProperty("--stream-monaco-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),f.style.removeProperty("--stream-monaco-original-scrollable-left"),f.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),ol(),(function(){const f=Yn.value;Qn.value=I.value||f==null?null:f})(),Ge(),Pe(),(function(f){f.replaceChildren()})(r),Te(),F))return;const s=H(null,null,function*(){var f,y;if(m.value){(function(){if($t||typeof window>"u")return;$t=!0;const p=v=>{var h;on("reason"in v?v.reason:(h=v.error)!=null?h:v.message)&&(v.preventDefault(),v.stopImmediatePropagation())};window.addEventListener("error",p,!0),window.addEventListener("unhandledrejection",p,!0)})(),Ae();const g=In(String((f=i.node.originalCode)!=null?f:""),String((y=i.node.updatedCode)!=null?y:""));yn?yield yn(r,g.original,g.updated,fe.value):yield G(r,i.node.code,fe.value)}else yield G(r,Ue.value,fe.value);me.value=!0}),c=s.finally(()=>{nn===c&&(nn=null)});if(nn=c,yield(function(f){return H(this,null,function*(){if(!m.value)return void(yield f);let y,g=!1;for(f.then(()=>{g=!0},p=>{g=!0,y=p});;){if(F)return;if(g){if(y)throw y;return}if(il()&&Jl())return;yield V(),yield pe()}})})(c),F)return;me.value=!0;const d=m.value?W():te();if(typeof((u=i.monacoOptions)==null?void 0:u.fontSize)=="number")d?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),ie.value=i.monacoOptions.fontSize,z.value=i.monacoOptions.fontSize;else if(!tl()){const f=lt();f&&f>0?(ie.value=f,z.value=f):(ie.value=12,z.value=12)}Bn(),ve.value||Ce.value||J(!1),yield(function(){return H(this,null,function*(){Me()!=null&&(re(),J(!1),yield V(),yield pe(),re(),J(!1),yield pe(),re(),J(!1))})})(),F||(I.value=!0,(function(){var f,y,g,p,v;if(Ge(),m.value){const b=W(),$=(f=b?.getOriginalEditor)==null?void 0:f.call(b),E=(y=b?.getModifiedEditor)==null?void 0:y.call(b),O=(C,U)=>{try{const N=C?.[U];if(typeof N!="function")return;const D=N.call(C,()=>X());D&&Ie.push(D)}catch{}};try{const C=(g=b?.onDidUpdateDiff)==null?void 0:g.call(b,()=>{X(),Z(()=>He())});C&&Ie.push(C)}catch{}return O($,"onDidContentSizeChange"),O(E,"onDidContentSizeChange"),O($,"onDidLayoutChange"),void O(E,"onDidLayoutChange")}const h=te();try{const b=(p=h?.onDidContentSizeChange)==null?void 0:p.call(h,()=>X());b&&Ie.push(b)}catch{}try{const b=(v=h?.onDidLayoutChange)==null?void 0:v.call(h,()=>X());b&&Ie.push(b)}catch{}})(),at(),Bn(),re(),He(),X(),yield(function(){return H(this,null,function*(){re(),J(!1),yield V(),yield pe(),re(),J(!1),yield pe(),re(),J(!1)})})(),yield(function(){return H(this,null,function*(){var f;if(m.value){for(let y=0;y<8;y++){if(F)return;const g=S.value,p=W();let v=!1;try{const $=(f=p?.getLineChanges)==null?void 0:f.call(p);v=Array.isArray($)}catch{v=!1}const h=!!g?.querySelector(".monaco-diff-editor"),b=il(g);if(h&&b&&v){if(yield V(),yield pe(),F)return;try{qe(),re(),He(),X()}catch{}return}if(y>=1&&!h)return;yield V(),yield pe()}if(!F)try{qe(),re(),He(),X()}catch{}}})})(),F||(Bn(),(function(){if(!m.value)return;const f=S.value;if(!f)return;const y=f.querySelector(".monaco-diff-editor");function g(p,v,h,b){const $=p.querySelector(v);if(!$)return;const E=$.getBoundingClientRect();if(E.width<=0)return;const O=$.querySelector(".line-numbers"),C=$.querySelector(".view-lines .view-line"),U=$.querySelector(".margin");let N=null;if(C?(N=C.getBoundingClientRect().left-E.left,sn(h,N)):U&&(N=U.getBoundingClientRect().width,sn(h,N)),O){const D=O.getBoundingClientRect();if(D.width>=20&&D.width<=64&&sn("--stream-monaco-line-number-width",D.width),N!=null){const R=N-(D.right-E.left);Number.isFinite(R)&&R>=0&&R<=32&&(sn(b,R),sn("--stream-monaco-line-number-gap-to-code",R))}}}y&&(g(y,".editor.original","--stream-monaco-original-scrollable-left","--stream-monaco-original-line-number-gap-to-code"),g(y,".editor.modified","--stream-monaco-modified-scrollable-left","--stream-monaco-modified-line-number-gap-to-code"))})(),yield V(),dn(),yield pe(),yield(function(){return H(this,null,function*(){if(m.value){if(dn(),le.value=!0,oe.value=!1,T.value=!0,yield V(),dn(),yield pe(),dn(),!F){if(cn(!0),oe.value=!0,tt(),typeof window>"u")return le.value=!1,void(oe.value=!1);rn=window.setTimeout(()=>{rn=null,le.value=!1,oe.value=!1,Z(()=>{Bn(),re(),X()})},120)}}else T.value=!0})})()))})})(e)),an=null}catch(r){const u=yt(),s=l!==jn.value,c=n.allowStaleContentRetry!==!1&&s&&an!==u;if(t!==u||c)return c&&(an=u),o=!0,j.value=!1,I.value=!1,me.value=!1,void(T.value=!1);throw _e(t),r}}).finally(()=>{we===a&&(we=null),(function(){const r=xe;K&&r&&(xe="",V(()=>{var u,s;if(!F){const c=(s=(u=ge.value)==null?void 0:u.offsetHeight)!=null?s:0;c>0&&K.reportHeight(r,c)}K.markSettled(r)}))})(),o&&!F&&queueMicrotask(()=>{var r;const u=S.value;u&&!F&&((r=Ee(u))==null||r.catch(s=>{I.value=!1,T.value=!1,_e()}))})});return we=a,a}q(dl,e=>{e||mo()}),q(()=>z.value,(e,n)=>{const t=m.value?W():te();t&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(t.updateOptions({fontSize:e}),Ce.value||J(!0))},{flush:"post",immediate:!1});let cl=0;const to=q(()=>[S.value,m.value,i.stream,i.loading,De.value,Y.value,i.node.code,i.node.loading],e=>H(null,[e],function*([n,t,l,o,a,r]){const u=++cl;if(!n||!r||je||l===!1&&o!==!1||En()||!G&&(yield(function(){return H(this,null,function*(){if(typeof window>"u"||F||De.value||ae.value)return;if(tn)return tn;const c=H(null,null,function*(){try{const d=yield Fo();if(F)return;if(!d)return void(ae.value=!0);const f=d.useMonaco,y=d.detectLanguage;if(typeof y=="function"&&(Ft=y),typeof f!="function")return;const g=Ke();if(g&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(g))throw new Error("Preferred theme not in provided themes array");be=ml();const p=f(be);G=p.createEditor||G,yn=p.createDiffEditor||yn,gn=p.updateCode||gn,wn=p.updateDiff||wn,en=p.getEditor||en,te=p.getEditorView||te,W=p.getDiffEditorView||W,Rn=p.cleanupEditor||Rn,Ae=p.safeClean||p.cleanupEditor||Ae,_n=p.refreshDiffPresentation||_n,Dn=p.setTheme||Dn,De.value=!0}catch{if(F)return;ae.value=!0}}).finally(()=>{tn===c&&(tn=null)});return tn=c,c})})(),u!==cl||i.stream===!1&&i.loading!==!1||En()||!Y.value||!G||ae.value||j.value||yl()||F||S.value!==n))return;const s=Ee(n);if(s){try{yield s}catch{I.value=!1,T.value=!1,_e()}I.value&&T.value&&to()}}));function fl(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function ze(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function vl(e,n){if(e===n)return!0;const t=ze(e),l=ze(n);return!!t&&t===l}function Ke(){var e;const n=(function(){if(i.theme!==void 0){const s=i.theme;return fl(s)?i.isDark?s.dark:s.light:s}return i.isDark?i.darkTheme:i.lightTheme})(),t=(e=Q.value)==null?void 0:e.theme,l=n??t;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(i.themes)?i.themes:[];if(!o.length||l==null)return l;const a=ze(l),r=o.map(s=>ze(s)).filter(s=>!!s);if(!a||r.includes(a))return l;const u=ze(t);return t!=null&&u&&r.includes(u)?t:o[0]}q(qn,(e,n)=>H(null,null,function*(){if(e===n||(Nl.value=e,!G||!S.value)||!j.value||i.stream===!1&&i.loading!==!1||!Y.value)return;const t=we;if(t){try{yield t}catch{}if(F||!S.value)return}try{I.value=!1,T.value=!1,j.value=!1,me.value=!1,Ge(),Pe(),Ae(),yield V(),yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}}));const pt=w(()=>(i.theme!==void 0?!fl(i.theme):vl(i.darkTheme,i.lightTheme))?(function(e){var n,t;if(e&&typeof e=="object"&&((n=e.colors)!=null&&n["editor.background"])){const o=rt(e.colors["editor.background"]);if(o!=null)return o<128}const l=((t=ze(e))!=null?t:"").toLowerCase();return l?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(o=>l.includes(o))&&!["light","latte","dawn","lotus"].some(o=>l.includes(o)):!!i.isDark})(Ke()):!!i.isDark),ht=w(()=>{var e;if(!m.value)return pt.value?"dark":"light";const n=(e=Q.value)==null?void 0:e.diffAppearance;return n==="light"||n==="dark"?n:pt.value?"dark":"light"}),lo=w(()=>m.value?ht.value==="dark":pt.value);function ml(){const e=ye(_(ye(_({wordWrap:"on",wrappingIndent:"same",themes:i.themes},Q.value||{}),{theme:Ke()}),m.value?{diffAppearance:ht.value}:{}),{onThemeChange(){at()}}),n=(function(){var t;const l=(t=Q.value)==null?void 0:t.fontFamily;return typeof l=="string"&&l.trim()?l.trim():m.value?(function(){var o;if(typeof window>"u")return;const a=(o=ge.value)==null?void 0:o.querySelector("pre.code-pre-fallback");if(a)return window.getComputedStyle(a).fontFamily.trim()||void 0})():void 0})();return n&&(e.fontFamily!=null||(e.fontFamily=n)),e}function Te(){const e=ml();if(!be)return be=e,be;for(const n of Object.keys(be))n in e||delete be[n];return Object.assign(be,e),be}const pl=w(()=>{var e,n,t,l,o,a,r,u,s,c,d,f,y,g,p;return JSON.stringify({diffLineStyle:(n=(e=Q.value)==null?void 0:e.diffLineStyle)!=null?n:"background",diffUnchangedRegionStyle:(l=(t=Q.value)==null?void 0:t.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=i.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?_({},ln):An(i.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(r=(a=Q.value)==null?void 0:a.renderSideBySide)==null||r,useInlineViewWhenSpaceIsLimited:(s=(u=Q.value)==null?void 0:u.useInlineViewWhenSpaceIsLimited)!=null&&s,enableSplitViewResizing:(d=(c=Q.value)==null?void 0:c.enableSplitViewResizing)==null||d,ignoreTrimWhitespace:(y=(f=Q.value)==null?void 0:f.ignoreTrimWhitespace)==null||y,originalEditable:(p=(g=Q.value)==null?void 0:g.originalEditable)!=null&&p})}),hl=P(0);function yt(){var e;const n=Ke();return JSON.stringify({kind:qn.value,language:fe.value,structural:pl.value,optionsRevision:hl.value,settledContentGeneration:zt.value,theme:(e=ze(n))!=null?e:n==null?null:"custom",isDark:i.isDark})}q(()=>[i.monacoOptions,i.theme,i.themes,i.lightTheme,i.darkTheme],()=>{hl.value+=1},{deep:!0}),q(()=>[Ue.value,i.node.originalCode,i.node.updatedCode],()=>{jn.value+=1,ft()||(zt.value+=1)});const Re=w(()=>yt());function gt(){ue.value&&Ne.value!==Re.value&&(ue.value=!1,Ne.value=null,an=null,Un=null,j.value=!1,I.value=!1,me.value=!1,T.value=!1)}function yl(){return gt(),ue.value&&Ne.value===Re.value}function _e(e=Re.value){Ne.value=e,ue.value=!0}return q(Re,()=>H(null,null,function*(){if(je||!ue.value||Ne.value===Re.value||!G||!S.value||ae.value||F||!Y.value||i.stream===!1&&i.loading!==!1||En())return;const e=Re.value;je=!0;try{if(gt(),ue.value)return;yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}finally{Un=e,yield V(),je=!1}})),q(()=>[i.monacoOptions,Y.value],()=>{var e,n;if(Te(),!G||!Y.value)return;const t=m.value?W():te(),l=typeof((e=i.monacoOptions)==null?void 0:e.fontSize)=="number"?i.monacoOptions.fontSize:Number.isFinite(z.value)?z.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((n=t?.updateOptions)==null||n.call(t,{fontSize:l})),J(!1)},{deep:!0}),q(()=>[Ke(),ht.value,De.value,j.value,Y.value],([e],n)=>{De.value&&j.value&&Y.value&&(function(t={}){if(t.appearanceOnly)return;Te();const l=Ke(),o=()=>{m.value&&qe(),Z(()=>{at(),X()})};l?(function(a,r){const u=(function(s){if(s==null)return null;if(typeof s=="string")return s;if(typeof s=="object"&&"name"in s)return String(s.name);if(typeof s=="object"){const c=Bt.get(s);if(c)return c;try{const f=JSON.stringify(s);if(f)return Bt.set(s,f),f}catch{}const d="__theme_"+ ++Io;return Bt.set(s,d),d}return String(s)})(r);return u?(Pt=a,Ye||Mt!==u?Ye?(Qe===u||xt===u||(pn=r,Qe=u),Ye):(pn=r,Qe=u,Ye=H(null,null,function*(){for(;Qe&&pn!=null;){const s=pn,c=Qe;if(pn=null,Qe=null,Mt!==c)try{xt=c,yield(Pt??a)(s),Mt=c}catch{}}}).finally(()=>{Ye=null,xt=null}),Ye):Promise.resolve()):Promise.resolve()})(Dn,l).then(o).catch(a=>{}):o()})({appearanceOnly:n!=null&&vl(e,n[0])})},{flush:"post"}),q(()=>[pl.value,De.value,Y.value],(e,n)=>H(null,[e,n],function*([t,l,o],[a]){if(Te(),!l||!o||!G||!S.value||!j.value||t===a||i.stream===!1&&i.loading!==!1)return;const r=we;if(r){try{yield r}catch{}if(F||!S.value)return}try{I.value=!1,T.value=!1,j.value=!1,me.value=!1,Ge(),Pe(),Ae(),yield V(),yield Ee(S.value,{allowStaleContentRetry:!1})}catch{I.value=!1,T.value=!1,_e()}}),{flush:"post"}),q(()=>[i.loading,Y.value],(e,n)=>H(null,[e,n],function*([t,l],o){if(!l)return;const a=o?.[0];if(a===!1&&t!==!1&&m.value&&j.value&&(yield V(),Z(()=>{H(null,null,function*(){const u=we;if(u)try{yield u}catch{}!F&&m.value&&i.loading!==!1&&(Te(),qe(),X())})})),t)return;const r=a!==void 0&&a!==!1;yield V(),Z(()=>{H(null,null,function*(){var u,s;try{if(r&&(yield(function(){return H(this,null,function*(){if(!ue.value||!G||!S.value||ae.value||F||!Y.value)return!1;if(Un===Re.value)return!0;je=!0;try{ue.value=!1,Ne.value=null,an=null,j.value=!1,I.value=!1,me.value=!1,T.value=!1,Ge(),Pe(),Ae(),yield V();try{yield Ee(S.value)}catch{I.value=!1,T.value=!1,_e()}}finally{yield V(),je=!1}return!0})})()))return void J(!1);if(r&&j.value)if(m.value&&S.value){const c=we;if(c)try{yield c}catch{}Te();const d=In(String((u=i.node.originalCode)!=null?u:""),String((s=i.node.updatedCode)!=null?s:""));if(yield rl(d.original,d.updated,fe.value),F||!m.value)return;qe(),cn(!0),re(),He(),X()}else gn(Ue.value,fe.value);J(!1)}catch{}})})}),{immediate:!0,flush:"post"}),Ll(()=>{tt(),Ge(),Pe(),Rn()}),(e,n)=>ae.value?(Xe(),Nn(Et(bl),{key:0,node:Dt.value,loading:i.loading},null,8,["node","loading"])):(Xe(),Sl("div",{key:1,ref_key:"container",ref:ge,style:St(Ql.value),class:Hn(["code-block-container rounded-lg border",[{dark:i.isDark,"is-rendering":i.loading,"is-dark":lo.value,"is-diff":m.value,"is-plain-text":Lt.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":T.value&&!ae.value?"true":"false","data-markstream-enhancement-state":Rl.value,"data-markstream-pending":Tl.value?"true":void 0},[po(Lo,{"show-header":i.showHeader,"show-collapse-button":i.showCollapseButton,"show-font-size-buttons":i.showFontSizeButtons,"enable-font-size-control":i.enableFontSizeControl,"show-copy-button":i.showCopyButton,"show-expand-button":i.showExpandButton,"show-preview-button":i.showPreviewButton,"show-tooltips":i.showTooltips,"is-dark":i.isDark,loading:i.loading,stream:x.stream,"is-collapsed":Ce.value,"is-expanded":ve.value,"copy-text":zn.value,"is-previewable":ct.value,"code-font-size":z.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":ie.value,"font-baseline-ready":_l.value,"diff-stats":m.value?$e.value:null,"diff-stats-aria-label":$l.value,onToggleCollapse:eo,onDecreaseFont:Vl,onResetFont:Gl,onIncreaseFont:Ul,onCopy:Xl,onToggleExpand:Zl,onPreview:no},ho({"header-left":Ln(()=>[bt(e.$slots,"header-left",{},()=>[A("div",jo,[A("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:Yl.value},null,8,Uo),A("div",Vo,[A("div",Go,Ot(Kl.value),1),sl.value?(Xe(),Sl("div",Jo,Ot(sl.value),1)):kt("",!0)])])],!0)]),loading:Ln(()=>[bt(e.$slots,"loading",{loading:x.loading,stream:x.stream},()=>[n[0]||(n[0]=A("div",{class:"loading-skeleton"},[A("div",{class:"skeleton-line"}),A("div",{class:"skeleton-line"}),A("div",{class:"skeleton-line short"})],-1))],!0)]),default:Ln(()=>[yo(A("div",Ko,[A("div",{ref_key:"codeEditor",ref:S,class:Hn(["code-editor-container",[x.stream?"":"code-height-placeholder",{"is-hidden":zl.value}]]),style:St(jl.value)},null,6),_t.value?(Xe(),Nn(Et(bl),{key:0,class:Hn(["code-pre-fallback",{"is-wrap":Hl.value,"is-fading-out":oe.value}]),style:St(Il.value),node:Dt.value,"show-line-numbers":!0,"diff-inline":kn.value},null,8,["class","style","node","diff-inline"])):kt("",!0)],512),[[go,!(Ce.value||!x.stream&&x.loading)]]),Cn.value&&!ke.value&&ct.value&&ce.value==="html"?(Xe(),Nn(Ao,{key:0,code:i.node.code,"html-preview-allow-scripts":i.htmlPreviewAllowScripts,"html-preview-sandbox":i.htmlPreviewSandbox,"is-dark":i.isDark,"on-close":()=>Cn.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):kt("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Ln(()=>[bt(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready","diff-stats","diff-stats-aria-label"])],14,qo))}}),[["__scopeId","data-v-4ece510f"]]);export{Zo as default}; diff --git a/apps/kimi-code/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js b/apps/kimi-code/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js new file mode 100644 index 0000000000..6968409c3e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js @@ -0,0 +1 @@ +import{M as V,c0 as N,aL as s,u as i,aY as f,v as o,bb as p,t as d,bk as c,aw as R,bO as _,G as D,I as $,bJ as H,F,g as A,bL as S,bB as M,aU as g,q as w,c8 as q,c2 as G}from"./index-DtRfJ0vw.js";const I={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)]"},J={class:"flex items-center gap-0.5"},K=["aria-label"],O={class:"code-diff-stat removed"},U={class:"code-diff-stat added"},Y=["aria-label"],Q={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},W={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},X=["aria-pressed"],Z={key:3,class:"relative"},ee=["aria-expanded"],oe=["disabled"],te=["disabled"],ne=["disabled"],ae={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},re={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},le={class:"code-block-shell-content"},se={class:"code-loading-placeholder"},ie={class:"sr-only","aria-live":"polite",role:"status"},de=V({__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(a,{emit:z}){const t=a,v=z,u=g(!1),x=g(null),b=g(null);function E(){u.value=!u.value,u.value&&document.addEventListener("click",y,{once:!0,capture:!0})}function y(l){var e,n;const C=l.target;(e=x.value)!=null&&e.contains(C)||(n=b.value)!=null&&n.contains(C)?document.addEventListener("click",y,{once:!0,capture:!0}):u.value=!1}const j=w(()=>t.showFontSizeButtons&&t.enableFontSizeControl||t.showExpandButton||t.isPreviewable&&t.showPreviewButton),{t:r}=N(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&q(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&G()}function B(l){m(l,t.copyText?r("common.copied")||"Copied":r("common.copy")||"Copy")}const L=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)<=((e=t.codeFontMin)!=null?e:0)}),T=w(()=>!t.fontBaselineReady||t.codeFontSize===t.defaultCodeFontSize),P=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)>=((e=t.codeFontMax)!=null?e:100)});return(l,e)=>(s(),i(F,null,[t.showHeader?(s(),i("div",I,[f(l.$slots,"header-left"),f(l.$slots,"header-right",{},()=>[o("div",J,[a.diffStats?(s(),i("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[o("span",O,"-"+p(a.diffStats.removed),1),o("span",U,"+"+p(a.diffStats.added),1)],8,K)):d("",!0),t.showCopyButton?(s(),i("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":a.copyText?c(r)("common.copied")||"Copied":c(r)("common.copy")||"Copy",onClick:e[0]||(e[0]=n=>v("copy")),onMouseenter:e[1]||(e[1]=n=>B(n)),onFocus:e[2]||(e[2]=n=>B(n)),onMouseleave:h,onBlur:h},[a.copyText?(s(),i("svg",W,[...e[14]||(e[14]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(s(),i("svg",Q,[...e[13]||(e[13]=[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o("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,Y)):d("",!0),t.showCollapseButton?(s(),i("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":a.isCollapsed,onClick:e[3]||(e[3]=n=>v("toggleCollapse")),onMouseenter:e[4]||(e[4]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onFocus:e[5]||(e[5]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onMouseleave:h,onBlur:h},[(s(),i("svg",{style:R({rotate:a.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"},[...e[15]||(e[15]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,X)):d("",!0),j.value?(s(),i("div",Z,[o("button",{ref_key:"moreBtnRef",ref:b,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":u.value,"aria-haspopup":"true",onClick:_(E,["stop"]),onMouseenter:e[6]||(e[6]=n=>m(n,c(r)("common.more")||"More")),onFocus:e[7]||(e[7]=n=>m(n,c(r)("common.more")||"More")),onMouseleave:h,onBlur:h},[...e[16]||(e[16]=[D('',1)])],40,ee),$(A,{name:"code-menu"},{default:H(()=>[u.value?(s(),i("div",{key:0,ref_key:"moreMenuRef",ref:x,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"},[t.showFontSizeButtons&&t.enableFontSizeControl?(s(),i(F,{key:0},[o("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:L.value,onClick:e[8]||(e[8]=n=>v("decreaseFont"))},[e[17]||(e[17]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),o("span",null,p(c(r)("common.fontSmaller")||"Font size −"),1)],8,oe),o("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:T.value,onClick:e[9]||(e[9]=n=>v("resetFont"))},[e[18]||(e[18]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o("path",{d:"M3 3v5h5"})])],-1)),o("span",null,p(c(r)("common.fontReset")||"Font size reset"),1)],8,te),o("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:P.value,onClick:e[10]||(e[10]=n=>v("increaseFont"))},[e[19]||(e[19]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),o("span",null,p(c(r)("common.fontLarger")||"Font size +"),1)],8,ne)],64)):d("",!0),t.showExpandButton?(s(),i("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:e[11]||(e[11]=n=>{v("toggleExpand",n),u.value=!1})},[a.isExpanded?(s(),i("svg",ae,[...e[20]||(e[20]=[o("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)])])):(s(),i("svg",re,[...e[21]||(e[21]=[o("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)])])),o("span",null,p(a.isExpanded?c(r)("common.collapse")||"Collapse":c(r)("common.expand")||"Expand"),1)])):d("",!0),a.isPreviewable&&t.showPreviewButton?(s(),i("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:e[12]||(e[12]=n=>{v("preview"),u.value=!1})},[e[22]||(e[22]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("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"}),o("circle",{cx:"12",cy:"12",r:"3"})])],-1)),o("span",null,p(c(r)("common.preview")||"Preview"),1)])):d("",!0)],512)):d("",!0)]),_:1})])):d("",!0)])])])):d("",!0),S(o("div",le,[f(l.$slots,"default")],512),[[M,!(a.isCollapsed||!a.stream&&a.loading)]]),S(o("div",se,[f(l.$slots,"loading",{},()=>[e[23]||(e[23]=o("div",{class:"loading-skeleton"},[o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line short"})],-1))])],512),[[M,!a.stream&&a.loading]]),o("span",ie,p(a.copyText?c(r)("common.copied")||"Copied":""),1)],64))}});export{de as V}; diff --git a/apps/kimi-code/dist-web/assets/DesignSystemView-BnyYC1m0.js b/apps/kimi-code/dist-web/assets/DesignSystemView-BnyYC1m0.js new file mode 100644 index 0000000000..58643dfa89 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/DesignSystemView-BnyYC1m0.js @@ -0,0 +1,13 @@ +import{M as w,aD as y,aI as x,aL as t,u as d,v as e,G as s,H as i,F as r,aX as u,bb as g,I as k,cu as C,bk as z,cv as q,cw as S}from"./index-DtRfJ0vw.js";const T={class:"ds-page"},B={class:"layout"},A={class:"content"},I={class:"content-inner"},M={id:"tokens"},H={class:"icon-sizes"},L={class:"sz"},V={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},D={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},W={class:"sz"},P={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},R={class:"icon-grid"},N={class:"icon-group-label"},K={class:"ic-name"},O={id:"primitives"},j={class:"stage-wrap"},E={class:"stage p col"},F={class:"demo-row"},_={class:"p-btn primary disabled"},G={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},J={class:"stage-wrap"},Q={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},Y={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},X={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},Z={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},$={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},aa={id:"chat"},ea={class:"stage-wrap"},ta={class:"stage p col",style:{"align-items":"center",background:"#fff"}},da={class:"demo-chat"},sa={class:"p-action"},oa={class:"p-action-head"},ia={class:"p-ic",style:{color:"var(--p-accent)"},viewBox:"0 0 24 24",fill:"currentColor"},la={class:"p-action warn"},na={class:"p-action-head"},va={class:"p-ic",style:{color:"var(--p-warning)"},viewBox:"0 0 24 24",fill:"currentColor"},ca=w({__name:"DesignSystemView",emits:["close"],setup(ra,{emit:m}){const f=m;function b(){f("close")}let c=null;function p(v){v.key==="Escape"&&b()}return y(()=>{document.addEventListener("keydown",p);const v=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;v.forEach(n=>{const o=n.getAttribute("href");if(!o)return;const h=document.getElementById(o.slice(1));h&&a.set(h,n)});let l=null;c=new IntersectionObserver(n=>{n.forEach(o=>{o.isIntersecting&&(l&&l.classList.remove("active"),l=a.get(o.target)??null,l&&l.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((n,o)=>c.observe(o)),v.length&&v[0].classList.add("active")}),x(()=>{document.removeEventListener("keydown",p),c&&(c.disconnect(),c=null)}),(v,a)=>(t(),d("div",T,[e("div",{class:"ds-topbar"},[e("button",{class:"ds-back",type:"button",onClick:b},"← Back"),a[0]||(a[0]=e("span",{class:"ds-topbar-title"},"Design system",-1))]),e("div",B,[a[38]||(a[38]=s('',1)),e("main",A,[e("div",I,[a[36]||(a[36]=s('
● Design System · v1.0

Kimi Web Design System

This document defines the visual language and component specification for Kimi 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/kimi-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. Kimi 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 — the moon phases 🌑…🌘 are the sole exception, used only in the "waiting for the Agent to respond" chat state, as a brand signature. 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)),e("section",M,[a[7]||(a[7]=s(`
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 / #0d1117
surface
#fafbfc / #161b22
surface-sunken
#f3f5f8 / #0d1117
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#0d1117Page background
--color-surface#fafbfc#161b22Panel / sidebar / card head
--color-surface-raised#ffffff#1c2128Raised 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#fbfaf9#181817Sidebar surface — one step off --color-bg so the session column reads as its own plane
--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#1c2128Raised card / dialog / input (raised layer)
--p-surface#fafbfc#161b22Panel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#0d1117Code block / inline input / recessed area (sunken layer)
--p-bg#ffffff#0d1117Page 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

Kimi 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,
+      "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  • Inter first: self-hosted Latin UI and body text, loaded through the optical-size normal and italic variable faces.
  • Western fallbacks next: Helvetica Neue / Arial for environments where Inter cannot load.
  • CJK and system UI fallbacks late: PingFang SC / Microsoft YaHei / Noto Sans SC, then platform UI fonts and emoji fonts.

--font-mono · Code & monospace

Code, tool names, line numbers, diffs, etc. use JetBrains Mono (a self-hosted variable font), falling back to the system monospace:

--font-mono
--font-mono: "JetBrains Mono Variable", "JetBrains Mono",
+      ui-monospace, "SF Mono", Menlo, Consolas, monospace;

Loading strategy

FontSourceBundledUsage
JetBrains Mono@fontsource-variable/jetbrains-mono✓ self-hostedmonospace / code (--font-mono)
Inter@fontsource-variable/inter/opsz.css + opsz-italic.css✓ self-hostedUI / body / display (--font-ui, --font-display), wght 100-900, opsz 14-32, normal + italic
System UI / CJK fontsoperating systemlate fallback for UI / body, not bundled
Self-hosted Inter / JetBrains Mono: no external network requests, no FOUT, works offline; system fonts are not bundled, consistent with the local-first approach.

Usage rules

  • Components always use var(--font-ui) / var(--font-mono); do not hard-code font names like 'Inter' / 'JetBrains Mono'.
  • Body / UI use --font-ui (Inter first); code / monospace use --font-mono (JetBrains Mono).
  • Inter is loaded from the complete optical-size variable faces, including normal and italic styles; font-optical-sizing: auto is enabled globally.
  • CJK and platform system UI fonts stay late in the --font-ui fallback chain, after Inter and Western fallbacks.

Type scale & weight

The user font-size preference writes --base-ui-font-size. Compact UI chrome and the sidebar follow it through --ui-font-size, while chat reading surfaces derive one readable step above it through --content-font-size.

The fixed product type tokens still define component defaults: UI controls / buttons / forms use --text-base (14px); reading body — including chat Markdown, message bubbles, etc. stays one step larger than compact chrome for readability; the sidebar session list follows that same readable step while keeping list density. Drop stray font-weight: 650 / 750; converge on two weights, 400 / 500 (regular / emphasis).

Page Title
--text-2xl · 22 / 500
Section Title
--text-xl · 18 / 500
Chat body / card title
--text-lg · 16 / 400
UI control / button / form
--text-base · 14 / 500
Helper text / table
--text-sm · 13 / 400
Badge / timestamp / line number
--text-xs · 12 / 500
TokenValueUsage
--font-ui"Inter Variable", "Inter", "Helvetica Neue", Arial…UI & body (Inter first)
--font-monoJetBrains Mono…code, tool names, line numbers, diffs
--base-ui-font-size14px user preferenceroot setting that drives UI, reading body, and sidebar font sizes
--content-font-sizecalc(base + 1px)chat Markdown, message bubbles, composer
--leading-tight/normal/relaxed1.25 / 1.5 / 1.7headings / UI / long text
--weight-regular/medium400 / 500body / emphasis

Icon size

Icons use three size tokens uniformly. The global .p-ic default is 16px (--p-ic-md); components pick as needed, and random pixel sizes are forbidden.

TokenValueUsage
--p-ic-sm14pxsmall button, badge, menu item, inline link icon
--p-ic-md16pxdefault (button, icon button, toolbar)
--p-ic-lg20pxToast status icon, empty-state illustration

Icon

Icons always come from the centralized registry lib/icons.ts: in templates use the <Icon name size /> component (components/ui/Icon.vue); for v-html contexts (such as a tool glyph) use iconSvg(name, size). Do not hand-write <svg> — the scripts/check-style.mjs icon-from-registry rule flags stray SVGs. Icons come from Remix Icon (Apache-2.0), uniformly in a fill style (fill="currentColor", 24×24 source grid), with color following the text; size uses the three tokens below. The registry is bundled on demand by unplugin-icons at build time from @iconify-json/ri — only icons imported in lib/icons.ts end up in the production bundle, fully offline and tree-shaken. The whole site uses only this one icon family; do not mix in other icon libraries, and never hand-write SVG paths. When an icon is missing, add it to the registry — two static ~icons/ri/* imports (component + ?raw string) plus one entry in ICONS in lib/icons.ts; the import names (e.g. RiFolderOpenLine / RawFolderOpenLine) show the ri: icon id. Do not draw it in a component.

Size scale

`,43)),e("div",H,[e("div",L,[(t(),d("svg",V,[...a[1]||(a[1]=[e("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[2]||(a[2]=i("sm · 14",-1))]),e("div",D,[(t(),d("svg",U,[...a[3]||(a[3]=[e("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[4]||(a[4]=i("md · 16",-1))]),e("div",W,[(t(),d("svg",P,[...a[5]||(a[5]=[e("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[6]||(a[6]=i("lg · 20",-1))])]),a[8]||(a[8]=e("h4",{class:"mini"},"Icon library",-1)),a[9]||(a[9]=e("p",null,[i("Currently registered icons, grouped by purpose. The display order and grouping are defined by "),e("code",null,"ICON_GROUPS"),i(" in "),e("code",null,"lib/icons.ts"),i(" (a hand-maintained array covering the same icon names), and this catalog is rendered directly from that array so the registry and the document never drift.")],-1)),e("div",R,[(t(!0),d(r,null,u(z(q),([l,n])=>(t(),d(r,{key:l},[e("div",N,g(l),1),(t(!0),d(r,null,u(n,o=>(t(),d("div",{key:o,class:"icon-cell"},[k(C,{name:o},null,8,["name"]),e("span",K,g(o),1)]))),128))],64))),128))]),a[10]||(a[10]=s('

Do not use emoji as functional icons (the sole exception is the moon phases 🌑…🌘, used only in the "waiting for the Agent to respond" chat state). The Kimi brand mark (the 32×22 eye logo) is a brand asset and is not part of this icon system.

A few special graphics are not in the registry; each has a dedicated component maintained in one place, and must not be copied by hand: <ContextRing :pct /> (the Composer context progress ring, data-driven), <AuthStateIcon kind /> (the success / expired / error colored illustrations in the login flow), <Spinner /> (loading state). Status dots (such as in the Provider list) always use CSS dots (border-radius:50%), not SVG. The scripts/check-style.mjs icon-from-registry rule exempts the above and the brand mark; all other hand-written <svg> is flagged.

Spacing

A 4px base grid. All spacing, gaps, and padding inside and outside components come from this scale — no arbitrary pixels.

--space-1 · 4
icon gap, badge padding
--space-2 · 8
control gap, small padding
--space-3 · 12
button padding, form-item gap
--space-4 · 16
card padding, grid gap
--space-5 · 20
dialog padding
--space-6 · 24
section gap
--space-8 · 32
large section gap

Dense list (sidebar / file tree)

High-density navigation lists like the sidebar share one rhythm, all on the 4px grid: in-row vertical padding --space-1 (4px), no margin between rows (the hover pill provides the separation); section gap (between logo / search / action buttons / group title / list) uniformly --space-2 (8px); between groups --space-2; the brand header is slightly looser at the top (--space-3). When building similar lists, reuse this scale — do not hand-write 1/6/7/10px.

Radius

Merge the existing 14 values into the nearest of 7 scale steps. Rule: the component type determines the radius, not the author's feel.

xs · 4
sm · 6
md · 8
lg · 12
xl · 16
2xl · 20
full · 999
TokenValueUsageMerged from
--radius-xs4pxsmall badge, inline tag2/3/4px →
--radius-sm6pxsmall button, icon button, menu item5/6px →
--radius-md8pxbutton, input, badge, card7/8/9px →
--radius-lg12pxdropdown panel10/12px →
--radius-xl16pxdialog, bottom Sheet, Composer14/16px →
--radius-2xl20pxaccent container / large panel20px
--radius-full999pxpill badge, avatar, send button999px / 50%

Elevation & z-index

Shadows express only "elevation", never decoration (no colored glow). z-index is unified into a scale, eradicating 9999-style one-upping.

sm · dropdown menu / sticky
md · Toast
lg · overlay (reserved)
xl · dialog
Z-index TokenValueUsage
--z-base0normal flow
--z-sticky100sticky header / sidebar
--z-dropdown200dropdown menu / tooltip
--z-overlay300overlay / bottom Sheet
--z-modal400dialog
--z-toast600toast
--z-max9999reserved: only this tier for extreme fallback

Motion

TokenValueUsage
--ease-outcubic-bezier(0.16, 1, 0.3, 1)enter, hover, expand
--ease-in-outcubic-bezier(0.4, 0, 0.2, 1)panel width, layout changes
--duration-fast120mspress, focus
--duration-base160mshover, show/hide
--duration-slow260msdialog, Sheet, layout

Reduced motion

i
Under @media (prefers-reduced-motion: reduce), all animation and transition durations drop to about 0.001ms (effectively off), and the MoonSpinner moon phase pauses on the current frame. Components should not check this individually; it is handled uniformly in the global styles.

Layout & breakpoints

Layout sizes and responsive breakpoints are tokenized too: sidebar width, content reading-column width, and two global breakpoints. Components should not hard-code pixels.

TokenValueUsage
--p-sidebar-w264pxleft session sidebar width
--p-content-max760pxchat reading-column max width (regular chat prose)
--p-content-wide920pxwide content (settings / panel)
--p-table-max1040pxdesktop wide-table max width (see §04)
--p-table-cell-max700pxmax width of a single table column; longer cell content wraps (see §04)
--p-bp-sm640pxmobile / desktop boundary
--p-bp-md980pxnarrow / wide screen boundary
i
At ≤640px: dialogs become bottom Sheets, the sidebar collapses into an expandable drawer, and Composer toolbar controls are allowed to wrap.
',23))]),e("section",O,[a[21]||(a[21]=s(`
03

Primitives

Component primitives are the "smallest correct units" of the site UI. Each primitive exposes variants along only two dimensions — variant / size — with appearance driven by tokens, so it naturally supports light / dark mode and customizable theme colors.

i
For every interactive primitive, the keyboard behavior, focus, and ARIA contract are in §08 Accessibility. New primitives must ship with a keyboard model — mouse-only interaction is not enough.

Component selection guide

ScenarioUse
Primary action (submit / confirm)Button variant=primary
Secondary action / cancelButton secondary / ghost
Destructive action (delete / abort)Button danger / danger-soft
Status markerBadge
Toolbar filter / model switchPill
2–4 mutually exclusive optionsSegmentedControl
Top tabsTabs
Switch / multi-selectSwitch / Checkbox
Floating content card / list action menuCard / Menu
Inline notice / global toastBanner / Toast
Dialog / confirmation · bottom panel (mobile)Dialog / Sheet

Button

4 semantic variants × 3 sizes. The primary action primary takes its color from the current theme color (§05 can switch between the blue and black families). Radius uses --radius-md uniformly (small size --radius-sm), weight 600, with a visible focus ring.

Variant matrix lightpreview
medium · default
small
With icon / state
Dark skin dark

API

Button.vue · usage
<Button variant="primary" size="md" :loading="submitting">Save</Button>
+    // variant: primary | secondary | ghost | danger | danger-soft
+    // size:    sm | md | lg
States

IconButton

Unified into three sizes — 26 / 32 / 44px — with a light-grey hover background and a visible focus ring. Replaces the ad-hoc icon + click areas scattered across components today.

IconButton
i
The desktop IconButton comes in sm 26 / md 32; on touch devices the tap target should be ≥ 44px, so use lg 44px, satisfying the §01 accessibility principle (the mobile three-piece set uses lg).

Badge · Chip · Pill

Collapsed into two kinds: Badge (status badge, with an optional status dot) and Pill (the clickable pill in the composer toolbar). Radius, font size, and padding are all unified.

Badge · status badge
Semantic variants
pendingrunningcompletedneeds confirmationfailedKIMI
With icon / small size
planpassedread-only
Pill · toolbar pill (composer)
kimi-k2· thinkingyolo12k / 200k

Kbd · keyboard shortcut

Kbd renders a shortcut as keycaps — one block per key, never inline text like (⌘K). Caps are 18px tall (Badge sm rhythm): sunken surface, 1px border with a 2px bottom edge, 11px UI font, muted text. Typical placement: pushed to the row's trailing edge, opposite the label (e.g. the sidebar search row).

Kbd · keycaps
KCtrlKP

Card / Surface

All cards across the site share one shell: flat, 1px border, --radius-md radius, no shadow. The structure is split into three parts — head / body / foot. Cards differ only in the head — in two tiers by visual weight, while the shell stays consistent:

  • Operation card —— "process" content such as tool calls, Agent, Todo. The head is compact mono with no fill, low weight by default, not competing with the conversation.
  • Attention card —— content that needs a user decision, such as Question / Approval. The head carries a semantic color band (accent / warning) to stand out from the message stream.
Operation card · compact mono head (no fill)
read_filesession.ts
The head uses mono + a neutral background to emphasize its "code / process" nature; the body uses sans for readability. Flat, radius-md, same shape as the tool group and Agent group.
Attention card · semantic color-band head (accent / warning)
A decision needs your confirmationquestion
The head uses a semantic light background (accent-soft / warning-soft) to stand out from the message stream, signaling that the user must step in. The shell is exactly the same as the operation card.
Group · the container owns the border, rows are separated by hairlines
3 tool calls· completed
read_filesession.ts
grep"jwt" · 4 hits
  • Unified shell: all cards are flat + 1px border + radius-md, casting no shadow.
  • Differences are intentional: only the head distinguishes the type (compact mono vs semantic color band); the shell stays consistent.
  • Grouping: the outer container owns the border and radius; inner rows are separated by border-top hairlines, rather than each row being its own card.
  • Status dots: running (pulsing blue) / done (green) / failed (red), sharing one color vocabulary (see §04 tool calls).

Input / Select / Textarea

Unified 38px height (32px small), --radius-md radius, --color-surface-raised background, and a unified blue focus ring (0 0 0 3px accent-soft).

Form primitives
Only letters, numbers, and hyphens are allowed.
States
Please enter a valid workspace name
Normal state · validation passed

Code / Diff

Inline code, code blocks, and diffs all use the monospace font (--p-font-mono). Code blocks have a filename title bar and a copy button. Diffs use + / - row colors to express additions and deletions — additions use a success light background, deletions use a danger light background, with no gradients.

Code / Diff
inline code
The server uses jwt.verify(token) to verify the signature, returning 401 on failure.
code block
session.ts
import { verify } from './jwt';
+
+    export function auth(token: string) {
+      return verify(token, process.env.JWT_SECRET!);
+    }
diff
session.ts · +3 -1
import { verify } from './jwt';
-const secret = 'dev-secret';
+const secret = process.env.JWT_SECRET!;
return verify(token, secret);

Dialog

One dialog primitive replaces 6 hand-written implementations: unified --radius-xl radius, --shadow-xl shadow, 20px head padding, right-aligned footer actions, and an IconButton close button.

Dialog primitive
New chat
Create an independent Agent chat in the current workspace.
i
Size & height: Dialog offers three widths — md 440 / lg 640 / xl 760 (--p-content-max) — chosen by content weight. Height comes in two kinds: auto (default, grows with content up to max-height) and fixed (constant height min(680px, 100vh - 64px), with overflow scrolled inside the body). Content / multi-tab dialogs (settings, model picker, provider manager, folder browser) always use fixed so the frame size stays constant and doesn't jump when switching tabs or content length; short confirmation dialogs keep auto.

Toast

Unified information architecture: status icon + title + description. The status color appears only on the icon, avoiding large colored areas that create visual noise.

Toast
Connected to server
The local daemon is responding normally; you can start a new chat.
Context usage 82%
Consider running /compact to free up space.

Spinner

Loaders fall into two categories by scenario — do not mix them:

  • Spinner (plain · SVG ring) —— the default loader. Used for button loading, app startup (GlobalLoading), and general inline waits — "everything else".
  • MoonSpinner (moon phase · brand signature) —— used only for the chat waiting state of "message sent, waiting for the Agent's first response" (the sending placeholder in ChatPane, SideChatPanel, ActivityNotice).

Spinner · plain loader (default)

`,48)),e("div",j,[a[14]||(a[14]=e("div",{class:"stage-bar"},[e("span",{class:"st"},"Spinner · common scenarios")],-1)),e("div",E,[e("div",F,[a[13]||(a[13]=s('Loading…',2)),e("button",_,[(t(),d("svg",G,[...a[11]||(a[11]=[e("circle",{class:"track",cx:"12",cy:"12",r:"9"},null,-1),e("circle",{class:"arc",cx:"12",cy:"12",r:"9"},null,-1)])])),a[12]||(a[12]=i("Submitting",-1))])])])]),a[22]||(a[22]=s('

MoonSpinner · moon phase (only "waiting for the Agent")

MoonSpinner · chat waiting state only signature
Frame loop (8 frames)
🌑🌒🌓🌔🌕🌖🌗🌘
Usage · only while the chat waits for a response
🌔Thinking…🌕Waiting for response…
i
The moon phase is the sole exception to the emoji-as-icon rule, and is limited to the "waiting for the Agent's first response" scenario. It is currently implemented twice — in MoonSpinner.vue and ActivityNotice.vue — and should be merged into a single MoonSpinner component, sized via tokens and supporting prefers-reduced-motion. All other loading states use the plain Spinner.

Link

Inline text link: the default is the accent color with no underline; on hover it shows an underline and darkens. The .muted variant uses the secondary text color. Used for in-text jumps, external links, "view all", and other lightweight actions.

Link · inline link
Read the full design token docs before building.View on GitHubView history

Menu / Dropdown

Dropdown menu panel: raised surface + border + light shadow (--shadow-sm, flat-leaning). Menu items support icons, the current (active) state, the danger state, and the disabled state, with separators grouping items. On touch / mobile, use lg (≥44px row height) for menu items.

Menu · dropdown menu
Open file
Selected item
Disabled item
Delete chat

SegmentedControl

Mutually exclusive short option groups, commonly used for 2–4 option switches such as "light / dark / follow system". The current item is highlighted with a raised surface + subtle shadow.

SegmentedControl
LightDarkFollow system

Tabs

Tabs with a bottom hairline, used for grouping and switching sibling content. The current tab is marked with accent text + an accent underline.

Tabs
GeneralAgentAdvanced

Switch

A two-state switch for settings that take effect immediately. 36×20 track with full radius, 16px knob; when on, the track turns accent and the knob slides right, with the transition driven by tokens.

Switch

Checkbox

A 17×17 checkbox. When checked it fills with the accent color and shows a white tick (inline SVG). Often paired with a text label.

Checkbox

Avatar

A 32px default avatar with md radius; .sm is 24px. Can hold an initial or an icon; falls back to this placeholder when there is no image.

Avatar
KK

EmptyState

A centered placeholder for empty lists / panels: a 48px faint icon + title + hint, avoiding blank pages.

EmptyState
No chats yet
Click "New chat" to start a conversation with Kimi

Divider

A 1px horizontal divider (--p-line); .p-divider-v is the vertical divider, used between inline elements.

Divider
Content above

Content below
kimi-k2thinking

Tooltip

A CSS-only hover hint, wrapped in .p-tip. Inverted background (--p-text / --p-bg), single line, no wrapping — carries only short notes.

Tooltip (hover the button)
New chat

Banner

An inline notice bar placed at the top of a content area. Three states — .info / .warning / .danger — each with a matching 18px icon.

Banner
Connected to server
Currently in yolo mode; tool calls will run automatically

Sheet / BottomSheet

A mobile bottom slide-up panel: xl top radius + drag handle, xl shadow. At ≤640px, dialogs become bottom-anchored Sheets.

BottomSheet
Choose a model
kimi-k2 · thinking
kimi-k2 · instant

Skeleton

A placeholder for loading content, using a breathing opacity animation (no gradients), following the no-gradient-text rule. Composed into titles / text lines / avatars.

Skeleton

Command Bar

An inline combination of "primary action + command text + copy", sitting between a button and a code block — used for install / onboarding / one-click execution. The primary action reuses Button primary; the command area uses a mono light-grey background.

Command Bar
curl -fsSL https://code.kimi.com/install.sh | bash

TopBar

The application top bar. Solid by default; the .frost variant is translucent + background blur, used only for sticky navigation bars, and is the sole exception to the no-glassmorphism rule (see §06).

TopBar · solid / frosted glass
Solid TopBar
Frosted-glass TopBar · .frost

SectionLabel

A small group title for sidebar lists, used to section the content below (such as Workspaces in the sidebar). Spec: 13px / 700 / uppercase / letter-spacing .08em, color --color-fg-faint; left-aligned to the row's starting padding (--sb-pad-x), keeping the same indent as the group rows below. For scripts without case (such as Chinese), text-transform:uppercase simply has no effect — no special handling needed.

',50)),e("div",J,[a[20]||(a[20]=e("div",{class:"stage-bar"},[e("span",{class:"st"},"Sidebar · group title")],-1)),e("div",Q,[a[19]||(a[19]=e("div",{class:"p-section-label",style:{padding:"12px 16px 4px"}},"Workspaces",-1)),e("div",Y,[(t(),d("svg",X,[...a[15]||(a[15]=[e("path",{fill:"currentColor",d:"M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])),a[16]||(a[16]=i(" kimi-code-web ",-1))]),e("div",Z,[(t(),d("svg",$,[...a[17]||(a[17]=[e("path",{fill:"currentColor",d:"M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])),a[18]||(a[18]=i(" playground ",-1))])])])]),e("section",aa,[a[34]||(a[34]=s('
04

Chat Interface Overhaul

The message stream is the core of Kimi Web. The goal of the overhaul: have the 6 card types (Agent / Tool / Question / Approval / Swarm / Todo) share one card skeleton, distinguished only by the head icon and semantic color; and collapse the Composer into a single rounded container.

Unified message stream

',3)),e("div",ea,[a[33]||(a[33]=e("div",{class:"stage-bar"},[e("span",{class:"st"},"Conversation · 760px reading column")],-1)),e("div",ta,[e("div",da,[a[31]||(a[31]=s('
Please change the login endpoint to JWT and add the corresponding unit tests.
🌔Analyzing the auth module…
3 tool calls· completed · 0.8s
read_filesrc/auth/session.ts0.2s
12 export function verify(token: string) {
13 return jwt.verify(token, getSecret());
14 }
read_filesrc/auth/middleware.ts0.2s
grep"jwt.verify" · 4 matches0.1s

I looked at the structure of src/auth; it is currently based on a session cookie. The scope of the change is below — once you confirm, I'll start.

',4)),e("div",sa,[e("div",oa,[(t(),d("svg",ia,[...a[23]||(a[23]=[e("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])),a[24]||(a[24]=e("span",{class:"p-action-title"},"A decision needs your confirmation",-1))]),a[25]||(a[25]=e("div",{class:"p-action-body"},"How long should the JWT expiry be? Default 7 days, refresh token 30 days.",-1)),a[26]||(a[26]=e("div",{class:"p-action-foot"},[e("button",{class:"p-btn secondary sm"},"Customize"),e("button",{class:"p-btn primary sm"},"Use default")],-1))]),e("div",la,[e("div",na,[(t(),d("svg",va,[...a[27]||(a[27]=[e("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])),a[28]||(a[28]=e("span",{class:"p-action-title"},"Write permission required",-1)),a[29]||(a[29]=e("span",{class:"p-badge warning sm",style:{"margin-left":"auto"}},"write_file",-1))]),a[30]||(a[30]=s('
About to modify src/auth/middleware.ts, 42 lines changed. Allow?
',2))]),a[32]||(a[32]=s('
Replace session with JWT signing
Refactor the auth middleware
Add unit tests
',1))])])]),a[35]||(a[35]=s('

Wide markdown tables (desktop): regular chat prose stays within the 760px reading column (--p-content-max). On desktop a wide table may grow naturally with its content up to 1040px (--p-table-max), centred within the conversation pane; beyond that the excess scrolls horizontally inside the table's own wrapper — the page and the chat area never scroll sideways. A single column is capped at 700px (--p-table-cell-max), so long cell content wraps inside the cell instead of stretching the table. The conversation outline (TOC) keeps its usual position just outside the reading column; when a table grows past it and scrolls under the rail, the TOC is hidden temporarily and returns as soon as the table leaves, without touching the user's TOC setting. On mobile a table never breaks out of the reading column.

Tool calls: compact by default, grouped, expand on demand

High-frequency calls like read_file / bash / grep are "operational noise" — if each one took a full card, parallel triggers would quickly drown out the conversation. The new strategy splits tool calls into three tiers by visual weight, pushing them as light as possible:

Three visual-weight tiers
① Tool row · lightest (default)
read_filesrc/auth/session.ts0.2s
② Tool group · medium (consecutive / parallel auto-merged; collapsed to one line)
3 tool calls· completed · 0.8s
③ Decision card · heavy (only question / approval, needs user input)
Write permission requiredwrite_file
About to modify src/auth/middleware.ts, 42 lines changed.
  • Tool calls render as compact rows by default (30px single-line mono + status dot + key argument); no head / body / shadow.
  • Consecutive or parallel calls auto-merge into one tool group; when collapsed, the whole group takes one line (N tool calls · status).
  • Clicking a row expands it in place to show details (code / output); click again to collapse — details don't grab attention by default.
  • Status is expressed with a colored dot: running (pulsing blue) / done (green) / failed (red), taking no extra space.
  • Only two types keep a full card: Question (needs an answer) and Approval (needs authorization) — they genuinely need the user's attention.
Tool Call · compact row (expand on demand)
3 tool calls· completed
read_filesession.ts
12 export function verify(…
read_filemiddleware.ts
grep"jwt" · 4 hits

Composer

Unified into a single rounded container: --radius-xl, with the whole border turning blue + a soft focus ring on focus. Toolbar controls all use the Pill / IconButton primitives, and the send button is a 32px circle.

Composer
Message Kimi, / to run a command, @ to reference a file…
yoloplan
kimi-k2· thinking
i
Site-wide consistency: the composer has only one radius (--radius-xl · 16px) and one height; toolbar controls all use the Pill / IconButton primitives, and the send button is a 32px circle — it no longer drifts with the theme.

Responsive

See §02 --p-bp-sm for the breakpoint. This section only gives mobile-adaptation pointers for the chat interface; a full mobile mockup is out of scope for this spec.

i
At ≤640px: dialogs anchor to the bottom as Sheets (xl top radius, top drag handle), the sidebar collapses into an expandable drawer, the Composer toolbar is allowed to wrap, and the chat reading column drops its max-width to fill the screen.
',13))]),a[37]||(a[37]=s(`
05

Theming

Kimi Web uses one unified theme: the same components, fonts, radii, shadows, and surfaces — "reskinning" only changes colors. Colors are collapsed into 4 seed tokens — two theme colors + one light surface + one dark surface; the neutrals and accent are derived from them, and the semantic status colors (success / warning / danger) ship as independent palettes paired with the seeds, one set each for light / dark.

Color seeds

Day-to-day customization only needs these 4 seeds; the whole site's neutrals and accent change with them:

Theme color · primary
--accent-primary
Theme color · secondary
--accent-secondary
Light surface
--surface-light
Dark surface
--surface-dark

Accent families

Within one theme, the theme color (accent) can switch among several color families. Two parallel families are provided today: blue (default, brand blue, carrying semantic emphasis) and black (neutral black, carrying the most restrained strong action). Both share the same components, fonts, radii, and surfaces — switching families only swaps the accent token set, with zero structural change; more families (green / purple, etc.) can be added later. The two cards below show the same primary button under the two families.

Family switch · same primary, different theme color
Blue family · default
accent
--accent #1783ff · soft #e8f3ff
Black family · neutral
accent
--accent #14171c · soft #f1f2f4

Theme console · change 4 colors, light & dark change together

Theme Console
Primary #1783ffSecondary #6b7280Light surface #ffffffDark surface #0d1117
Light surface previewWhite background + accent button + neutral text
Dark surface previewDark background + same accent + derived text

Light / dark mode

Driven by the two surfaces --surface-light / --surface-dark: whichever surface is current derives the corresponding foreground, border, shadow, and status colors. Switching light / dark simply swaps between these two sets of derived tokens, with zero structural change.

Benefits of one theme: components, fonts, radii, and surfaces are consistent site-wide; reskinning only changes 4 color seeds; light / dark mode works out of the box; semantic status colors are independently tunable.
06

Style Rules

Anti-pattern rules that all UI code must follow. These rules are also the basis of the check-style detection script, one-to-one with a warning.

Rule IDWhat it detectsAction
no-gradient-textgradient text / gradient backgroundForbidden
no-glassmorphismbackdrop-filter: blur (TopBar sticky nav bar is the sole exception)TopBar exempt
no-color-glowcolored / large-radius box-shadow glowForbidden
no-emoji-iconusing emoji as a functional icon (the moon phases 🌑…🌘 are the sole exception, and only in the "waiting for the Agent to respond" chat state; all other loading states use the plain Spinner)Moon phase exempt
no-hardcoded-hexunregistered hex color inside a component <style>Warning
no-hardcoded-fonthard-coded font-family in a component (e.g. 'Inter') instead of var(--font-ui)Warning
radius-from-scaleradius value not in {4,6,8,12,16,20,999}Warning
z-from-scalez-index using an unregistered large numberWarning
weight-from-scalefont-weight not in {400,500}Warning

State matrix

Every interactive primitive should define the following states where applicable; missing ones are flagged by the style rules. focus-visible always uses --p-focus-ring (appears only on keyboard focus, see §08); disabled is uniformly opacity:.5.

StateButtonInputCardMenu itemSwitch
default
hover
active / pressed
focus-visible
disabled
loading
selected / active
error
readonly

Moon phase exemption

The "🌑…🌘" moon-phase emoji are a brand signature of Kimi Web, used only in the chat state of "message sent, waiting for the Agent's first response", and are rendered uniformly by the MoonSpinner component; waiting states such as ActivityNotice reuse it rather than implementing their own moon phase. It is the sole exception to the no-emoji-icon rule; all other loading states use the plain Spinner.

Glassmorphism exemption

backdrop-filter: blur is banned site-wide, with the sole exception of the .frost variant of TopBar — and only in the one place of the "sticky navigation bar", used to stay readable over scrolling content. No other component (card, dialog, Toast, panel) may use glassmorphism; violations are flagged under no-glassmorphism.
07

App Shell & Sidebar

The structural spec for the app shell (three-column grid + right preview panel) and the left session sidebar. These are business-agnostic "skeletons" — components, fonts, radii, and surfaces are reused from §02 / §03, but layout and alignment have their own conventions.

Layout grid

On desktop it is a single-row 5-track grid: the sidebar and the right panel each occupy a permanent auto track, with the conversation column in the middle; two 0-width tracks are for the ResizeHandles.

App.vue · .app
grid-template-columns: auto 0 minmax(0, 1fr) 0 auto;
+    /*         sidebar ↑    ↑handle  ↑conversation  ↑handle ↑right panel (auto) */
TokenValueUsage
sidebar width270px default (adjustable)expanded sidebar width, changed by dragging the ResizeHandle; should approach §02's --p-sidebar-w (264px)
--preview-w460pxwidth of the right preview panel when open
--panel-head-h48pxunified height for all right panel heads + the conversation column head, so the hairline runs as one line
--p-bp-sm640px≤640 switches to a mobile single column (top bar + conversation), no sidebar / handle / right panel
  • The right panel track exists permanently, with its width transitioning between 0 ↔ var(--preview-w) (when open it squeezes the conversation column, rather than switching templates).
  • The sidebar collapses SYMMETRICALLY to the right panel: its container width animates to 0 while the content keeps its fixed width anchored to the right edge (clipped, sliding out left — no reflow, hairline stays on the clipped content). No rail remains. The collapse control differs by platform: on macOS desktop the toggle is a single resident floating IconButton pinned beside the traffic lights (rendered in both states, only the glyph swaps — the sidebar slides underneath it, never moves or flashes); on Windows / web the collapse button lives inside the sidebar header (right-aligned), and a floating expand button appears at the top-left only while collapsed. The conversation header pads left in step with the transition while collapsed.
  • All grid children must have min-height:0; min-width:0, so only the inner scroll containers scroll and the page itself does not scroll.

Sidebar alignment system (--sb-*)

All sidebar rows (group head, session row, New chat button) share 4 custom properties, so the "session title" aligns precisely under the "workspace name".

TokenValueUsage
--sb-inset12pxrow box (hover/selected pill) inset from the sidebar edges — matches the brand header's 12px padding
--sb-pad-x20pxcontent start x (= --sb-inset + 8px row padding)
--sb-gutter16pxleading icon slot width — matches the workspace folder icon so the session title aligns under the workspace name
--sb-gap6pxgap between the icon slot and the text
i
The session title's starting x = --sb-pad-x + --sb-gutter + --sb-gap. The group head has a folder icon and the session row has a status slot; both icons are the same width and position, so the titles align naturally.

Sidebar structure

The sidebar from top to bottom: brand header → New chat → search → grouped list (workspace head + session rows) → settings footer. Controls reuse the §03 primitives as much as possible. The sidebar sits on --color-sidebar-bg (one step off --color-bg: warm off-white in light, near-black in dark — the session column reads as its own plane; the hairline still separates it from the conversation pane). Vertical rhythm: the brand header keeps 12px padding (on macOS desktop the left padding grows to 80px to clear the traffic lights); rows inside the actions group (New chat + search) stack flush (0 gap, same rhythm as the list rows); adjacent groups are separated by 12px. Row hover uses --sb-hover (= the global --color-hover wash); the selected row uses --color-selected — neutral, never the accent.

BlockUseNote
Brand headerlogo + name + collapse IconButton (right-aligned)on Windows / web the brand is left and the collapse IconButton sm is right-aligned inside the header; the logo is animated (a blinking eye). On macOS desktop the header is a bare drag strip (brand hidden, traffic lights + resident floating toggle over it)
New chatfull-width left-aligned button (custom)same rhythm as the session rows in the list (left-aligned, hover = --sb-hover). Do not use Button (centered, breaks the rhythm)
Searchbare search row (custom)no border, hover/focus shows a sunken background; icon + label, with the Kbd keycaps (⌘K / Ctrl K) pushed to the trailing edge — label and shortcut are justified apart. Do not use Input (the 38px bordered version is too heavy). Last fixed row above the list — its wrapper carries the scroll-linked seam
Section label.p-section-labeluppercase muted small titles like "Workspaces"
Workspace head / session rowsee next two sectionsshare --sb-* alignment
Settings footerfull-width left-aligned button (custom)pinned row under the session list, separated by a 1px --line top border; icon + label, same list-style family as New chat
!
Why New chat / search / inline rename don't use Button / Input: they are "list-style" controls (full-width, left-aligned, compact, borderless), while Button is centered and Input is a 38px bordered control — forcing them in would break the sidebar's visual density and alignment. This is an intentional custom exception, not an oversight.

Session row

A session row is an inset rounded pill, structured as: status slot → title → time → attention Badge → kebab.

PartRule
Containerpadding: 8px 8px inside the list's --sb-inset gutter, radius-sm; no fixed/min height — row height is font-driven (title line-height: --leading-tight, ≈16px) → ≈32px total, the sidebar-wide row rhythm. The hover kebab is absolutely positioned so it never forces the row taller (no hover jitter). hover = --sb-hover (the global --color-hover wash); active = --color-selected — neutral, no accent tint, no border, no weight change
Status slot (lead)fixed --sb-gutter width; running = Spinner sm, otherwise unread = 7px accent dot
Titleflex:1 with truncation; double-click enters inline rename (compact input, not Input)
Timemono xs, fg-faint; yields to the kebab on hover
Attention BadgeBadge sm: info (needs answer) / warning (needs approval) / danger (aborted)
kebabIconButton sm, shown on hover; dropdown uses Menu/MenuItem
Archive confirmationreplaces the title area, Button sm (danger confirm / secondary cancel)

Workspace group

The group head and session rows share --sb-*: folder icon (open/closed) → name, with the kebab and "+" revealed on hover.

  • The folder icon leads the row (switching icons between open and closed states) with the plain --sb-gap before the name — it does not pad out the --sb-gutter slot.
  • The name is quiet by design — regular weight, muted color (--color-text-muted, one step lighter than session titles), so group heads read as grouping labels. No path subtitle; hovering the name shows the full root path in a Tooltip.
  • The kebab (menu) and "+" (new chat in this workspace) both use IconButton sm inside a floating actions layer anchored to the row's right edge — no reserved layout space, so the name uses the full row width when idle. Shown on hover, keyboard focus, or while the menu is open; the layer backs itself with the sidebar surface (container background) plus the row hover wash (an ::after shown only while the row is hovered), so its color exactly equals the row's current background and the overlapped name tail doesn't bleed through (hidden via opacity:0, staying in the tab order).
  • The group is collapsible; when collapsed its session list is hidden.

Show more & collapse

The "load more / show less" control at the bottom of each workspace group is a session-row-shaped compact list control (same family as search, New chat, inline rename — not a Button). It doubles as the pagination trigger and the in-group expand / collapse toggle.

PartRule
Containersession-row pill: display:flex; gap:--sb-gap; padding:8px …, no fixed/min height (font-driven, ≈32px like a session row), same padding as a session row, radius-sm; hover = --sb-hover (no text recolor); :focus-visible uses --p-focus-ring
Lead slotempty, --sb-gutter wide, so the label's start x aligns with the session titles (--sb-pad-x + --sb-gutter + --sb-gap)
Labelfont-ui, text-xs, --color-text; flex:1, truncated
Behavior"Load more" fetches the next page and auto-expands; once more than the first page is loaded, "Show less" appears and collapses back to the first page (view-layer trim — data is kept, no refetch); "Show all" re-expands

ResizeHandle

A 4px vertical drag bar, layered over the 1px column border (margin: 0 -2px makes the whole 4px grabbable), turning accent on hover / drag.

RuleValue
Width / cursor4px / col-resize
Normal / activetransparent / accent fill
Layer--z-dropdown, above pane-level sticky chrome (chat dock at --z-sticky) so the overhang stays visible and grabbable
Behaviorpanel width follows the pointer 1:1 while dragging (the parent disables transitions to avoid lag); on release it is persisted to localStorage

Right panel

The right panels (file preview / Diff / thinking / sub-agent / side chat) share one track and one head primitive.

  • The panel head uses the PanelHeader primitive (48px = --panel-head-h), the same height as the conversation column head, so the hairline runs as one line.
  • Panel head: bold mono title + optional muted subtitle + middle slot (Badge / control / path) + close IconButton on the right.
  • When opened, the panel width goes from 0 → var(--preview-w), smoothly squeezing the conversation column.
  • At ≤640px the panel becomes a full-screen overlay (position:fixed; inset:0).
i
One-sentence principle: the sidebar / shell is a "list + grid" skeleton that reuses the §02 tokens and §03 primitives (Button / IconButton / Badge / Kbd / Menu / Spinner / PanelHeader); compact list controls that don't fit a primitive (search, New chat, inline rename, show-more) keep their custom form, governed by this section.
08

Accessibility (pragmatic edition)

Kimi Web is a local developer tool; it does not target a specific WCAG conformance level, nor maintain a full screen-reader QA matrix. This section collects only the rules that are "low-cost, don't hurt the look, and directly benefit keyboard-heavy users", as the baseline contract for each primitive; the more expensive, lower-ROI parts (such as real-time announcement orchestration for streaming output) are not mandatory for now.

i
On the "ugly" focus ring: the focus visibility required below always uses :focus-visible (not :focus). It appears only on keyboard focus; mouse clicks don't trigger it, so it doesn't pollute the mouse-driven visual; the ring's strength is tuned uniformly with --p-focus-ring, not overridden per place.

1. Contrast & color

  • Body text vs. background contrast ≥ 4.5:1; control borders, icons, and key graphics ≥ 3:1. When changing theme colors / dark mode, verify against §05 together.
  • Button text vs. button background, and form controls (input, placeholder, helper / error text) vs. their section background must all have contrast ≥ 4.5:1 (large text ≥ 3:1). White-on-white text, a transparent borderless button floating over the page background, and a light placeholder on a near-white background are all flagged by the style rules.
  • State is not conveyed by color alone. Error, selected, and disabled states also carry text, an icon, or a shape change (for example an error state is not just red, but also carries text or an icon).

2. Keyboard operable

Anything doable with a mouse must also be doable with a keyboard; Tab order follows the DOM, with no invented skipping. Composite controls define their keyboard model per the table below; a missing model is treated as incomplete:

ControlKeyboard behavior
DialogTab cycles within the dialog (focus trap); Esc closes; focus returns to the trigger element after closing.
Menu / move the highlight, Enter selects, Esc closes.
Tabs / switch tabs (roving tabindex); only the current tab is in the Tab sequence.
Switch / Segmented / or Space / Enter to toggle.

3. Focus visibility

  • Every interactive element must have a visible focus indicator on keyboard focus, uniformly via :focus-visible + --p-focus-ring (primary actions may use --p-focus-ring-strong).
  • Bare outline: none is forbidden. To remove the default outline, you must provide an equivalent replacement style.

4. Labels & semantics

  • Semantic HTML first (button / a / input / dialog…); ARIA is added only when native semantics fall short.
  • Icon-only buttons must have an aria-labelIconButton already enforces this with a required label prop.
  • Dialog: role="dialog" + aria-modal="true", with the title as the dialog's accessible name.
  • Purely decorative SVG / icons get aria-hidden="true" to avoid being read out by screen readers.

5. Target size

Desktop click targets ≥ 32px; touch devices ≥ 44px (consistent with the §01 principle and the IconButton lg tier).

6. Reduced motion

Handled uniformly in the global styles per §02's @media (prefers-reduced-motion: reduce); components do not check this individually. The MoonSpinner moon phase pauses on the current frame.

7. Live announcements (non-mandatory)

Screen-reader announcements are not a mandatory contract in this product. Short hints like Toast can use role="status" / aria-live; chat streaming output is currently not announced word-by-word, which is an acceptable trade-off, to be added later if a real need arises.

Explicitly not mandatory for now: a WCAG conformance-level claim, a complete ARIA pattern table, a per-screen-reader QA matrix, and real-time announcement orchestration for streaming output — these are not written into the primitive contract, to avoid becoming slogans no one maintains.
`,4))])])])]))}}),pa=S(ca,[["__scopeId","data-v-b86e59ea"]]);export{pa as default}; diff --git a/apps/kimi-code/dist-web/assets/DesignSystemView-CuTwm3PV.css b/apps/kimi-code/dist-web/assets/DesignSystemView-CuTwm3PV.css new file mode 100644 index 0000000000..81eeb33dfa --- /dev/null +++ b/apps/kimi-code/dist-web/assets/DesignSystemView-CuTwm3PV.css @@ -0,0 +1 @@ +.ds-page[data-v-b86e59ea]{--d-bg: var(--color-bg);--d-surface: var(--color-surface);--d-surface-2: var(--color-surface-sunken);--d-surface-3: var(--color-line);--d-fg: var(--color-text);--d-fg-soft: var(--color-text-muted);--d-fg-muted: var(--color-text-muted);--d-fg-faint: var(--color-text-faint);--d-line: var(--color-line);--d-line-2: var(--color-line);--d-accent: var(--color-accent);--d-accent-2: var(--color-accent-hover);--d-accent-soft: var(--color-accent-soft);--d-accent-bd: var(--color-accent-bd);--d-green: var(--color-success);--d-green-soft: var(--color-success-soft);--d-amber: var(--color-warning);--d-amber-soft: var(--color-warning-soft);--d-red: var(--color-danger);--d-red-soft: var(--color-danger-soft);--d-violet: var(--color-done);--d-code-bg: var(--color-surface-sunken);--d-sidebar: var(--color-surface);--d-shadow-sm: var(--shadow-sm);--d-shadow-md: var(--shadow-md);--d-shadow-lg: var(--shadow-lg);--sidebar-w: var(--p-sidebar-w);--content-max: var(--p-content-wide)}.ds-page[data-v-b86e59ea] *,.ds-page[data-v-b86e59ea] *:before,.ds-page[data-v-b86e59ea] *:after{box-sizing:border-box}.ds-page[data-v-b86e59ea]{scroll-behavior:smooth}.ds-page[data-v-b86e59ea]{margin:0;background:var(--d-bg);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);line-height:1.65;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}h1[data-v-b86e59ea],h2[data-v-b86e59ea],h3[data-v-b86e59ea],h4[data-v-b86e59ea]{color:var(--d-fg);letter-spacing:-.01em;line-height:1.25;margin:0}p[data-v-b86e59ea]{margin:0 0 14px;color:var(--d-fg-soft)}a[data-v-b86e59ea]{color:var(--d-accent-2);text-decoration:none}a[data-v-b86e59ea]:hover{text-decoration:underline}code[data-v-b86e59ea],pre[data-v-b86e59ea],.mono[data-v-b86e59ea]{font-family:JetBrains Mono,ui-monospace,SF Mono,Menlo,Consolas,monospace}code[data-v-b86e59ea]{background:var(--d-code-bg);border:1px solid var(--d-line-2);border-radius:5px;padding:1px 6px;font-size:.88em;color:#1f2937;white-space:nowrap}.layout[data-v-b86e59ea]{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);min-height:100vh}.sidebar[data-v-b86e59ea]{position:sticky;top:0;align-self:start;height:100vh;background:var(--d-sidebar);border-right:1px solid var(--d-line);padding:26px 22px;overflow-y:auto}.brand[data-v-b86e59ea]{display:flex;align-items:center;gap:10px;margin-bottom:6px}.brand-mark[data-v-b86e59ea]{width:26px;height:26px;border-radius:7px;flex:none;background:var(--d-fg);color:#fff;display:grid;place-items:center;font-weight:800;font-size:14px;letter-spacing:-.04em}.brand-name[data-v-b86e59ea]{font-weight:700;font-size:15px;letter-spacing:-.01em}.brand-sub[data-v-b86e59ea]{font-size:12px;color:var(--d-fg-faint);margin-bottom:26px;padding-left:36px}.nav-group[data-v-b86e59ea]{margin:22px 0 8px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--d-fg-faint)}.p-section-label[data-v-b86e59ea]{font-size:12px;font-weight:400;text-transform:uppercase;color:var(--d-fg-faint)}.nav a[data-v-b86e59ea]{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:7px;font-size:13.5px;font-weight:500;color:var(--d-fg-soft);margin:1px 0;transition:background .15s,color .15s}.nav a .num[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--d-fg-faint);width:18px}.nav a[data-v-b86e59ea]:hover{background:var(--d-surface-2);color:var(--d-fg);text-decoration:none}.nav a.active[data-v-b86e59ea]{background:var(--d-accent-soft);color:var(--d-accent-2)}.nav a.active .num[data-v-b86e59ea]{color:var(--d-accent-2)}.content[data-v-b86e59ea]{min-width:0}.content-inner[data-v-b86e59ea]{max-width:var(--content-max);margin:0 auto;padding:64px 56px 120px}section[data-v-b86e59ea]{scroll-margin-top:32px;padding-top:8px}section+section[data-v-b86e59ea]{margin-top:72px}.hero[data-v-b86e59ea]{padding:8px 0 40px;border-bottom:1px solid var(--d-line);margin-bottom:56px}.eyebrow[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:8px;font-family:JetBrains Mono,monospace;font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--d-fg);background:#1783ff1a;border:none;padding:6px 12px;border-radius:8px;margin-bottom:22px}.hero h1[data-v-b86e59ea]{font-size:48px;font-weight:600;line-height:1.08;letter-spacing:-.025em;margin-bottom:18px}.hero h1 .grad[data-v-b86e59ea]{color:var(--d-accent)}.hero p.lead[data-v-b86e59ea]{font-size:18px;line-height:1.6;color:var(--d-fg-soft);max-width:680px}.hero-meta[data-v-b86e59ea]{display:flex;flex-wrap:wrap;gap:10px;margin-top:28px}.meta-chip[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--d-fg-muted);background:var(--d-surface);border:1px solid var(--d-line);border-radius:8px;padding:7px 12px}.meta-chip b[data-v-b86e59ea]{color:var(--d-fg);font-weight:600}.meta-chip .dot[data-v-b86e59ea]{width:7px;height:7px;border-radius:50%;background:var(--d-green)}.sec-head[data-v-b86e59ea]{display:flex;align-items:baseline;gap:14px;margin-bottom:8px}.sec-num[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:13px;font-weight:600;color:var(--d-accent-2)}.sec-title[data-v-b86e59ea]{font-size:26px;letter-spacing:-.02em}.sec-desc[data-v-b86e59ea]{font-size:15.5px;color:var(--d-fg-muted);max-width:720px;margin-bottom:28px}h3.sub[data-v-b86e59ea]{font-size:17px;margin:40px 0 14px;display:flex;align-items:center;gap:10px}h3.sub[data-v-b86e59ea]:before{content:"";width:4px;height:16px;border-radius:2px;background:var(--d-accent)}h4.mini[data-v-b86e59ea]{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--d-fg-muted);margin:24px 0 12px}.stat-grid[data-v-b86e59ea]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.stat[data-v-b86e59ea]{background:var(--d-surface);border:1px solid var(--d-line);border-radius:14px;padding:18px 18px 16px}.stat .v[data-v-b86e59ea]{font-size:34px;font-weight:800;letter-spacing:-.03em;line-height:1;color:var(--d-fg)}.stat .v small[data-v-b86e59ea]{font-size:16px;color:var(--d-fg-muted);font-weight:600}.stat .l[data-v-b86e59ea]{font-size:12.5px;color:var(--d-fg-muted);margin-top:8px;line-height:1.4}.stat.warn[data-v-b86e59ea]{background:var(--d-amber-soft);border-color:#f0d9b8}.stat.warn .v[data-v-b86e59ea]{color:var(--d-amber)}.stat.bad[data-v-b86e59ea]{background:var(--d-red-soft);border-color:#f0cccc}.stat.bad .v[data-v-b86e59ea]{color:var(--d-red)}.stat.good[data-v-b86e59ea]{background:var(--d-green-soft);border-color:#bfe3cc}.stat.good .v[data-v-b86e59ea]{color:var(--d-green)}.panel[data-v-b86e59ea]{background:var(--d-bg);border:1px solid var(--d-line);border-radius:16px;box-shadow:var(--d-shadow-sm)}.panel-pad[data-v-b86e59ea]{padding:22px}.panel-soft[data-v-b86e59ea]{background:var(--d-surface);border:1px solid var(--d-line);border-radius:14px}.callout[data-v-b86e59ea]{display:flex;gap:12px;padding:14px 16px;border-radius:12px;font-size:14px;line-height:1.55;background:var(--d-surface);border:1px solid var(--d-line);color:var(--d-fg-soft);margin:18px 0}.callout .ico[data-v-b86e59ea]{flex:none;width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:12px;font-weight:800}.callout.info[data-v-b86e59ea]{background:var(--d-accent-soft);border-color:var(--d-accent-bd)}.callout.info .ico[data-v-b86e59ea]{background:var(--d-accent);color:#fff}.callout.warn[data-v-b86e59ea]{background:var(--d-amber-soft);border-color:#f0d9b8}.callout.warn .ico[data-v-b86e59ea]{background:var(--d-amber);color:#fff}.callout.good[data-v-b86e59ea]{background:var(--d-green-soft);border-color:#bfe3cc}.callout.good .ico[data-v-b86e59ea]{background:var(--d-green);color:#fff}table.dt[data-v-b86e59ea]{width:100%;border-collapse:collapse;font-size:13.5px;margin:16px 0}table.dt th[data-v-b86e59ea]{text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--d-fg-faint);font-weight:700;padding:10px 12px;border-bottom:1px solid var(--d-line)}table.dt td[data-v-b86e59ea]{padding:11px 12px;border-bottom:1px solid var(--d-line-2);color:var(--d-fg-soft);vertical-align:middle}table.dt tr:last-child td[data-v-b86e59ea]{border-bottom:none}table.dt td.tk[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:12.5px;color:var(--d-fg);white-space:nowrap}table.dt td.val[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.swatch[data-v-b86e59ea]{display:inline-block;width:16px;height:16px;border-radius:4px;border:1px solid rgba(0,0,0,.08);vertical-align:-3px;margin-right:8px}.palette[data-v-b86e59ea]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}.color-card[data-v-b86e59ea]{border:1px solid var(--d-line);border-radius:12px;overflow:hidden;background:var(--d-bg)}.color-chip[data-v-b86e59ea]{height:56px;border-bottom:1px solid var(--d-line)}.color-meta[data-v-b86e59ea]{padding:10px 12px 12px}.color-meta .cn[data-v-b86e59ea]{font-size:13px;font-weight:600;color:var(--d-fg)}.color-meta .cv[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:11.5px;color:var(--d-fg-muted);margin-top:2px}.type-row[data-v-b86e59ea]{display:flex;align-items:baseline;gap:18px;padding:13px 0;border-bottom:1px solid var(--d-line-2)}.type-row[data-v-b86e59ea]:last-child{border-bottom:none}.type-sample[data-v-b86e59ea]{flex:1;color:var(--d-fg);line-height:1.2}.type-meta[data-v-b86e59ea]{width:190px;flex:none;text-align:right;font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.space-row[data-v-b86e59ea]{display:flex;align-items:center;gap:16px;padding:10px 0;border-bottom:1px solid var(--d-line-2)}.space-row[data-v-b86e59ea]:last-child{border-bottom:none}.space-bar[data-v-b86e59ea]{height:18px;border-radius:4px;background:linear-gradient(90deg,var(--d-accent),var(--d-accent-2));flex:none}.space-meta[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:12.5px;color:var(--d-fg-soft);width:150px}.space-use[data-v-b86e59ea]{font-size:12.5px;color:var(--d-fg-muted)}.radius-grid[data-v-b86e59ea]{display:flex;flex-wrap:wrap;gap:22px;align-items:flex-end;margin:16px 0}.radius-item[data-v-b86e59ea]{display:flex;flex-direction:column;align-items:center;gap:10px}.radius-box[data-v-b86e59ea]{width:64px;height:64px;border:2px solid var(--d-accent);background:var(--d-accent-soft)}.radius-item .rl[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-soft)}.stage-wrap[data-v-b86e59ea]{border:1px solid var(--d-line);border-radius:16px;overflow:hidden;margin:18px 0;background:var(--d-bg);box-shadow:var(--d-shadow-sm)}.stage-bar[data-v-b86e59ea]{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--d-line);background:var(--d-surface)}.stage-bar .st[data-v-b86e59ea]{font-size:13px;font-weight:600;color:var(--d-fg);display:flex;align-items:center;gap:8px}.stage-bar .st .tag[data-v-b86e59ea]{font-size:10.5px;font-weight:700;letter-spacing:.04em;padding:2px 7px;border-radius:999px}.tag.after[data-v-b86e59ea]{background:var(--d-green-soft);color:var(--d-green)}.tag.before[data-v-b86e59ea]{background:var(--d-red-soft);color:var(--d-red)}.tag.spec[data-v-b86e59ea]{background:var(--d-accent-soft);color:var(--d-accent-2)}.stage-bar .sactions[data-v-b86e59ea]{display:flex;gap:6px}.tab[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:11.5px;padding:4px 10px;border-radius:6px;color:var(--d-fg-muted);cursor:default}.tab.on[data-v-b86e59ea]{background:var(--d-bg);color:var(--d-fg);border:1px solid var(--d-line)}.stage[data-v-b86e59ea]{padding:32px;display:flex;flex-wrap:wrap;align-items:center;gap:16px;background:radial-gradient(circle at 1px 1px,rgba(0,0,0,.045) 1px,transparent 0) 0 0 / 18px 18px,var(--d-surface)}.stage.col[data-v-b86e59ea]{flex-direction:column;align-items:stretch}.stage.dark[data-v-b86e59ea]{background:radial-gradient(circle at 1px 1px,rgba(255,255,255,.06) 1px,transparent 0) 0 0 / 18px 18px,#0d1117}.stage-label[data-v-b86e59ea]{width:100%;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--d-fg-faint);margin-bottom:-6px}.stage.dark .stage-label[data-v-b86e59ea]{color:#6b7280}.ba[data-v-b86e59ea]{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--d-line);border-radius:16px;overflow:hidden;margin:18px 0;box-shadow:var(--d-shadow-sm)}.ba-col[data-v-b86e59ea]{min-width:0}.ba-col+.ba-col[data-v-b86e59ea]{border-left:1px solid var(--d-line)}.ba-head[data-v-b86e59ea]{display:flex;align-items:center;justify-content:space-between;padding:11px 16px;border-bottom:1px solid var(--d-line)}.ba-head.before[data-v-b86e59ea]{background:var(--d-red-soft)}.ba-head.after[data-v-b86e59ea]{background:var(--d-green-soft)}.ba-head .bh[data-v-b86e59ea]{font-size:13px;font-weight:700}.ba-head.before .bh[data-v-b86e59ea]{color:var(--d-red)}.ba-head.after .bh[data-v-b86e59ea]{color:var(--d-green)}.ba-head .bh small[data-v-b86e59ea]{font-weight:500;opacity:.7;margin-left:6px}.ba-body[data-v-b86e59ea]{padding:24px;background:var(--d-surface);min-height:120px}.ba-col.after .ba-body[data-v-b86e59ea]{background:#fff}.code[data-v-b86e59ea]{background:#0d1117;border-radius:12px;overflow:hidden;margin:16px 0;border:1px solid #1c2128}.code-bar[data-v-b86e59ea]{display:flex;align-items:center;gap:8px;padding:9px 14px;background:#161b22;border-bottom:1px solid #1c2128}.code-bar .d[data-v-b86e59ea]{width:10px;height:10px;border-radius:50%;background:#30363d}.code-bar .fn[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:11.5px;color:#8b949e;margin-left:4px}.code pre[data-v-b86e59ea]{margin:0;padding:18px;overflow-x:auto;font-size:12.5px;line-height:1.7;color:#c9d1d9}.code .c[data-v-b86e59ea]{color:#8b949e}.code .k[data-v-b86e59ea]{color:#ff7b72}.code .s[data-v-b86e59ea]{color:#a5d6ff}.code .p[data-v-b86e59ea]{color:#79c0ff}.code .n[data-v-b86e59ea]{color:#d2a8ff}.code .v[data-v-b86e59ea]{color:#ffa657}.pill[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;border:1px solid var(--d-line);background:var(--d-surface);color:var(--d-fg-soft)}.pill.blue[data-v-b86e59ea]{background:var(--d-accent-soft);border-color:var(--d-accent-bd);color:var(--d-accent-2)}.pill.green[data-v-b86e59ea]{background:var(--d-green-soft);border-color:#bfe3cc;color:var(--d-green)}.pill.amber[data-v-b86e59ea]{background:var(--d-amber-soft);border-color:#f0d9b8;color:var(--d-amber)}.pill.red[data-v-b86e59ea]{background:var(--d-red-soft);border-color:#f0cccc;color:var(--d-red)}.pill.mono[data-v-b86e59ea]{font-family:JetBrains Mono,monospace}ul.clean[data-v-b86e59ea]{list-style:none;padding:0;margin:14px 0}ul.clean li[data-v-b86e59ea]{position:relative;padding:8px 0 8px 26px;color:var(--d-fg-soft);border-bottom:1px solid var(--d-line-2)}ul.clean li[data-v-b86e59ea]:last-child{border-bottom:none}ul.clean li[data-v-b86e59ea]:before{content:"";position:absolute;left:4px;top:17px;width:7px;height:7px;border-radius:50%;background:var(--d-accent)}ul.clean.check li[data-v-b86e59ea]:before{content:"✓";background:none;color:var(--d-green);font-weight:800;top:7px;left:0;font-size:14px}ul.clean.cross li[data-v-b86e59ea]:before{content:"✕";background:none;color:var(--d-red);font-weight:800;top:7px;left:0;font-size:13px}ul.clean li b[data-v-b86e59ea]{color:var(--d-fg)}ul.clean li .path[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.roadmap[data-v-b86e59ea]{position:relative;margin:24px 0}.phase[data-v-b86e59ea]{position:relative;display:grid;grid-template-columns:120px 1fr;gap:24px;padding:0 0 32px}.phase[data-v-b86e59ea]:not(:last-child):after{content:"";position:absolute;left:59px;top:36px;bottom:0;width:2px;background:var(--d-line)}.phase-tag[data-v-b86e59ea]{text-align:right;padding-top:4px}.phase-tag .pt[data-v-b86e59ea]{display:inline-block;font-family:JetBrains Mono,monospace;font-size:12px;font-weight:700;color:var(--d-accent-2);background:var(--d-accent-soft);border:1px solid var(--d-accent-bd);padding:5px 10px;border-radius:8px}.phase-tag .pe[data-v-b86e59ea]{font-size:11.5px;color:var(--d-fg-faint);margin-top:8px}.phase-body[data-v-b86e59ea]{background:var(--d-bg);border:1px solid var(--d-line);border-radius:14px;padding:18px 20px;box-shadow:var(--d-shadow-sm)}.phase-body h4[data-v-b86e59ea]{font-size:16px;margin-bottom:8px}.phase-body p[data-v-b86e59ea]{font-size:14px;margin-bottom:12px}.phase-body ul[data-v-b86e59ea]{margin:0}.matrix[data-v-b86e59ea]{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}.anti[data-v-b86e59ea]{border:1px solid var(--d-line);border-radius:12px;padding:16px;background:var(--d-bg)}.anti .ah[data-v-b86e59ea]{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:700;margin-bottom:8px}.anti .ah .verdict[data-v-b86e59ea]{margin-left:auto;font-size:11px;font-weight:800;padding:2px 8px;border-radius:999px}.verdict.pass[data-v-b86e59ea]{background:var(--d-green-soft);color:var(--d-green)}.verdict.fail[data-v-b86e59ea]{background:var(--d-red-soft);color:var(--d-red)}.verdict.warn[data-v-b86e59ea]{background:var(--d-amber-soft);color:var(--d-amber)}.anti p[data-v-b86e59ea]{font-size:13px;margin:0;color:var(--d-fg-muted)}.footer[data-v-b86e59ea]{margin-top:80px;padding-top:28px;border-top:1px solid var(--d-line);font-size:13px;color:var(--d-fg-faint);display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}.kbd[data-v-b86e59ea]{font-family:JetBrains Mono,monospace;font-size:11px;background:var(--d-surface-2);border:1px solid var(--d-line);border-bottom-width:2px;border-radius:5px;padding:1px 6px}@media(max-width:980px){.layout[data-v-b86e59ea]{grid-template-columns:1fr}.sidebar[data-v-b86e59ea]{position:static;height:auto}.nav[data-v-b86e59ea]{display:flex;flex-wrap:wrap;gap:4px}.content-inner[data-v-b86e59ea]{padding:40px 22px 80px}.stat-grid[data-v-b86e59ea]{grid-template-columns:repeat(2,1fr)}.ba[data-v-b86e59ea]{grid-template-columns:1fr}.ba-col+.ba-col[data-v-b86e59ea]{border-left:none;border-top:1px solid var(--d-line)}.palette[data-v-b86e59ea]{grid-template-columns:repeat(2,1fr)}.matrix[data-v-b86e59ea]{grid-template-columns:1fr}}.ds-page .p[data-v-b86e59ea],.ds-page .stage.p-skin[data-v-b86e59ea],.ds-page [data-p][data-v-b86e59ea]{--p-font-sans: var(--font-ui);--p-font-mono: var(--font-mono);--p-bg: var(--color-bg);--p-surface: var(--color-surface);--p-surface-raised: var(--color-surface-raised);--p-surface-sunken: var(--color-surface-sunken);--p-text: var(--color-text);--p-text-muted: var(--color-text-muted);--p-text-faint: var(--color-text-faint);--p-text-on-accent: var(--color-text-on-accent);--p-line: var(--color-line);--p-line-strong: var(--color-line-strong);--p-accent: var(--color-accent);--p-accent-hover: var(--color-accent-hover);--p-accent-soft: var(--color-accent-soft);--p-accent-bd: var(--color-accent-bd);--p-success: var(--color-success);--p-success-soft: var(--color-success-soft);--p-success-bd: var(--color-success-bd);--p-warning: var(--color-warning);--p-warning-soft: var(--color-warning-soft);--p-warning-bd: var(--color-warning-bd);--p-danger: var(--color-danger);--p-danger-soft: var(--color-danger-soft);--p-danger-bd: var(--color-danger-bd);--p-info: var(--color-info);--p-sp-1: var(--space-1);--p-sp-2: var(--space-2);--p-sp-3: var(--space-3);--p-sp-4: var(--space-4);--p-sp-5: var(--space-5);--p-sp-6: var(--space-6);--p-sp-8: var(--space-8);--p-r-xs: var(--radius-xs);--p-r-sm: var(--radius-sm);--p-r-md: var(--radius-md);--p-r-lg: var(--radius-lg);--p-r-xl: var(--radius-xl);--p-r-2xl: var(--radius-2xl);--p-r-full: var(--radius-full);--p-sh-xs: var(--shadow-xs);--p-sh-sm: var(--shadow-sm);--p-sh-md: var(--shadow-md);--p-sh-lg: var(--shadow-lg);--p-sh-xl: var(--shadow-xl);--p-font-size-xs: var(--text-xs);--p-font-size-sm: var(--text-sm);--p-font-size-base: var(--text-base);--p-font-size-md: var(--text-base);--p-font-size-lg: var(--text-lg);--p-font-size-xl: var(--text-xl);--p-font-size-2xl: var(--text-2xl);--p-leading-tight: var(--leading-tight);--p-leading-normal: var(--leading-normal);--p-leading-relaxed: var(--leading-relaxed);--p-ease: var(--ease-out);--p-ease-inout: var(--ease-in-out);--p-dur-fast: var(--duration-fast);--p-dur: var(--duration-base);--p-dur-slow: var(--duration-slow);font-family:var(--font-ui);color:var(--color-text);font-size:var(--text-base)}[data-p=dark][data-v-b86e59ea]{--p-bg: #0d1117;--p-surface: #161b22;--p-surface-raised: #1c2128;--p-surface-sunken: #0d1117;--p-text: #c9cdd4;--p-text-muted: #9aa0a8;--p-text-faint: #6b7280;--p-line: #2d333b;--p-line-strong: #3d444d;--p-accent: #58a6ff;--p-accent-hover: #79b8ff;--p-accent-soft: rgba(88,166,255,.14);--p-accent-bd: rgba(88,166,255,.28);--p-success: #3fb950;--p-success-soft: rgba(63,185,80,.14);--p-success-bd: rgba(63,185,80,.28);--p-warning: #d29922;--p-warning-soft: rgba(210,153,34,.14);--p-warning-bd: rgba(210,153,34,.28);--p-danger: #f85149;--p-danger-soft: rgba(248,81,73,.14);--p-danger-bd: rgba(248,81,73,.28);--p-sh-sm: 0 1px 2px rgba(0,0,0,.4);--p-sh-md: 0 4px 12px rgba(0,0,0,.45);--p-sh-lg: 0 12px 32px rgba(0,0,0,.55);--p-selection: rgba(88,166,255,.32)}.p-ic[data-v-b86e59ea]{width:16px;height:16px;flex:none;display:inline-block;vertical-align:middle}.p-btn[data-v-b86e59ea]{--_h: 36px;--_px: 16px;--_fs: var(--p-font-size-base);--_r: var(--p-r-md);display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--_h);padding:0 var(--_px);border-radius:var(--_r);font-family:var(--p-font-sans);font-size:var(--_fs);font-weight:600;line-height:1;border:1px solid transparent;cursor:pointer;white-space:nowrap;transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease),transform var(--p-dur-fast) var(--p-ease)}.p-btn[data-v-b86e59ea]:active{transform:scale(.98)}.p-btn[data-v-b86e59ea]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--p-accent-soft),0 0 0 1px var(--p-accent)}.p-btn .p-ic[data-v-b86e59ea]{width:16px;height:16px}.p-btn.sm[data-v-b86e59ea]{--_h: 30px;--_px: 12px;--_fs: var(--p-font-size-sm);--_r: var(--p-r-sm)}.p-btn.sm .p-ic[data-v-b86e59ea]{width:14px;height:14px}.p-btn.lg[data-v-b86e59ea]{--_h: 42px;--_px: 20px;--_fs: var(--p-font-size-md);--_r: var(--p-r-lg)}.p-btn.primary[data-v-b86e59ea]{background:var(--p-accent);color:var(--p-text-on-accent);border-color:var(--p-accent);box-shadow:var(--p-sh-xs)}.p-btn.primary[data-v-b86e59ea]:hover{background:var(--p-accent-hover);border-color:var(--p-accent-hover)}.p-btn.secondary[data-v-b86e59ea]{background:var(--p-surface-raised);color:var(--p-text);border-color:var(--p-line-strong);box-shadow:var(--p-sh-xs)}.p-btn.secondary[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);border-color:var(--p-line-strong)}.p-btn.ghost[data-v-b86e59ea]{background:transparent;color:var(--p-text);border-color:transparent}.p-btn.ghost[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);color:var(--p-text)}.p-btn.danger[data-v-b86e59ea]{background:var(--p-danger);color:#fff;border-color:var(--p-danger);box-shadow:var(--p-sh-xs)}.p-btn.danger[data-v-b86e59ea]:hover{filter:brightness(.96)}.p-btn.danger-soft[data-v-b86e59ea]{background:var(--p-danger-soft);color:var(--p-danger);border-color:var(--p-danger-bd)}.p-btn.danger-soft[data-v-b86e59ea]:hover{background:var(--p-danger);color:#fff;border-color:var(--p-danger)}.p-btn[disabled][data-v-b86e59ea],.p-btn.disabled[data-v-b86e59ea]{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}.p-icon-btn[data-v-b86e59ea]{--_s: 32px;display:inline-grid;place-items:center;width:var(--_s);height:var(--_s);flex:none;border-radius:var(--p-r-md);border:1px solid transparent;background:transparent;color:var(--p-text-muted);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-icon-btn[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);color:var(--p-text)}.p-icon-btn[data-v-b86e59ea]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--p-accent-soft)}.p-icon-btn.sm[data-v-b86e59ea]{--_s: 26px;border-radius:var(--p-r-sm)}.p-icon-btn.lg[data-v-b86e59ea]{--_s: 44px}.p-icon-btn .p-ic[data-v-b86e59ea]{width:16px;height:16px}.p-icon-btn.lg .p-ic[data-v-b86e59ea]{width:20px;height:20px}.p-badge[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:var(--p-r-full);font-family:var(--p-font-sans);font-size:var(--p-font-size-xs);font-weight:600;line-height:1;border:1px solid var(--p-line);background:var(--p-surface);color:var(--p-text);white-space:nowrap}.p-badge.sm[data-v-b86e59ea]{height:18px;padding:0 7px;font-size:11px}.p-badge .bd[data-v-b86e59ea]{width:7px;height:7px;border-radius:50%;background:currentColor}.p-badge.neutral[data-v-b86e59ea]{background:var(--p-surface-sunken);border-color:var(--p-line);color:var(--p-text-muted)}.p-badge.info[data-v-b86e59ea]{background:var(--p-accent-soft);border-color:var(--p-accent-bd);color:var(--p-accent-hover)}.p-badge.success[data-v-b86e59ea]{background:var(--p-success-soft);border-color:var(--p-success-bd);color:var(--p-success)}.p-badge.warning[data-v-b86e59ea]{background:var(--p-warning-soft);border-color:var(--p-warning-bd);color:var(--p-warning)}.p-badge.danger[data-v-b86e59ea]{background:var(--p-danger-soft);border-color:var(--p-danger-bd);color:var(--p-danger)}.p-badge.solid[data-v-b86e59ea]{background:var(--p-text);color:var(--p-bg);border-color:var(--p-text)}.p-badge .p-ic[data-v-b86e59ea]{width:12px;height:12px}.p-kbd[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:3px}.p-kbd kbd[data-v-b86e59ea]{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border:1px solid var(--p-line);border-bottom-width:2px;border-radius:var(--p-r-xs);background:var(--p-surface-sunken);color:var(--p-text-muted);font-family:var(--p-font-sans);font-size:11px;line-height:1}.p-pill[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border-radius:var(--p-r-md);border:1px solid transparent;background:transparent;font-family:var(--p-font-sans);font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-pill[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);color:var(--p-text)}.p-pill .pp-strong[data-v-b86e59ea]{font-weight:700;color:var(--p-text)}.p-pill .pp-sub[data-v-b86e59ea]{color:var(--p-accent);font-weight:600}.p-pill .p-ic[data-v-b86e59ea]{width:14px;height:14px;color:var(--p-text-faint)}.p-card[data-v-b86e59ea]{background:var(--p-surface);border:1px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;color:var(--p-text)}.p-card.interactive[data-v-b86e59ea]{transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease);cursor:pointer}.p-card.interactive[data-v-b86e59ea]:hover{background:var(--p-surface);border-color:var(--p-line-strong)}.p-card-head[data-v-b86e59ea]{display:flex;align-items:center;gap:9px;padding:10px 14px;border-bottom:1px solid var(--p-line);background:var(--p-surface)}.p-card-title[data-v-b86e59ea]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text);font-family:var(--p-font-mono)}.p-card-body[data-v-b86e59ea]{padding:14px;font-size:var(--p-font-size-base);color:var(--p-text);line-height:var(--p-leading-normal)}.p-card-foot[data-v-b86e59ea]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid var(--p-line);background:var(--p-surface)}.p-field[data-v-b86e59ea]{display:flex;flex-direction:column;gap:6px}.p-label[data-v-b86e59ea]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-input[data-v-b86e59ea],.p-select[data-v-b86e59ea],.p-textarea[data-v-b86e59ea]{width:100%;height:38px;padding:0 12px;border-radius:var(--p-r-md);border:1px solid var(--p-line-strong);background:var(--p-surface-raised);font-family:var(--p-font-sans);font-size:var(--p-font-size-base);color:var(--p-text);box-shadow:var(--p-sh-xs);transition:border-color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease)}.p-textarea[data-v-b86e59ea]{height:auto;min-height:84px;padding:10px 12px;resize:vertical;line-height:var(--p-leading-normal)}.p-input[data-v-b86e59ea]:hover,.p-select[data-v-b86e59ea]:hover,.p-textarea[data-v-b86e59ea]:hover{border-color:var(--p-line-strong)}.p-input[data-v-b86e59ea]:focus,.p-select[data-v-b86e59ea]:focus,.p-textarea[data-v-b86e59ea]:focus{outline:none;border-color:var(--p-accent);box-shadow:0 0 0 3px var(--p-accent-soft)}.p-input[data-v-b86e59ea]::placeholder,.p-textarea[data-v-b86e59ea]::placeholder{color:var(--p-text-faint)}.p-input.sm[data-v-b86e59ea]{height:32px;font-size:var(--p-font-size-sm);border-radius:var(--p-r-sm)}.p-hint[data-v-b86e59ea]{font-size:var(--p-font-size-xs);color:var(--p-text-faint)}.p-dialog[data-v-b86e59ea]{width:480px;max-width:calc(100vw - 48px);background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-xl);box-shadow:var(--p-sh-xl);overflow:hidden;color:var(--p-text)}.p-dialog-head[data-v-b86e59ea]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px 14px}.p-dialog-title[data-v-b86e59ea]{font-size:var(--p-font-size-lg);font-weight:700;letter-spacing:-.01em}.p-dialog-desc[data-v-b86e59ea]{font-size:var(--p-font-size-base);color:var(--p-text-muted);margin-top:4px;line-height:var(--p-leading-normal)}.p-dialog-body[data-v-b86e59ea]{padding:4px 22px 18px}.p-dialog-foot[data-v-b86e59ea]{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 20px}.p-toast[data-v-b86e59ea]{display:flex;align-items:flex-start;gap:11px;width:360px;padding:13px 14px;background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-lg);box-shadow:var(--p-sh-md)}.p-toast .ti[data-v-b86e59ea]{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;flex:none;margin-top:1px}.p-toast.success .ti[data-v-b86e59ea]{background:var(--p-success-soft);color:var(--p-success)}.p-toast.warning .ti[data-v-b86e59ea]{background:var(--p-warning-soft);color:var(--p-warning)}.p-toast .tt[data-v-b86e59ea]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-text)}.p-toast .td[data-v-b86e59ea]{font-size:var(--p-font-size-sm);color:var(--p-text-muted);margin-top:2px;line-height:1.45}.p-spinner[data-v-b86e59ea]{width:18px;height:18px;animation:p-spin-b86e59ea .85s linear infinite}.p-spinner.sm[data-v-b86e59ea]{width:14px;height:14px}.p-spinner circle[data-v-b86e59ea]{fill:none;stroke-width:2.2;stroke-linecap:round}.p-spinner .track[data-v-b86e59ea]{stroke:var(--p-line)}.p-spinner .arc[data-v-b86e59ea]{stroke:var(--p-accent);stroke-dasharray:56 56;stroke-dashoffset:38}@keyframes p-spin-b86e59ea{to{transform:rotate(360deg)}}.p-thinking[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:9px;font-size:var(--p-font-size-sm);color:var(--p-text-muted);font-family:var(--p-font-sans)}.p-bubble-user[data-v-b86e59ea]{align-self:flex-end;max-width:78%;background:var(--p-accent-soft);border:1px solid var(--p-accent-bd);color:var(--p-text);border-radius:18px 18px 5px;padding:11px 15px;font-size:var(--p-font-size-md);line-height:var(--p-leading-normal);box-shadow:var(--p-sh-xs)}.p-msg[data-v-b86e59ea]{max-width:760px;font-size:var(--p-font-size-md);line-height:var(--p-leading-relaxed);color:var(--p-text)}.p-msg p[data-v-b86e59ea]{margin:0 0 10px;color:var(--p-text)}.p-msg code[data-v-b86e59ea]{font-family:var(--p-font-mono);background:var(--p-surface-sunken);border:1px solid var(--p-line);color:var(--p-accent-hover);padding:1px 6px;border-radius:5px;font-size:.9em}.p-agent[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden}.p-agent-head[data-v-b86e59ea]{display:flex;align-items:center;gap:10px;padding:11px 14px}.p-agent-av[data-v-b86e59ea]{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:var(--p-surface-sunken);border:1px solid var(--p-line);color:var(--p-text-muted);flex:none}.p-agent-name[data-v-b86e59ea]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-agent-phase[data-v-b86e59ea]{font-size:var(--p-font-size-xs);color:var(--p-text-muted)}.p-agent-body[data-v-b86e59ea]{padding:0 14px 13px}.p-tool[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden}.p-tool-head[data-v-b86e59ea]{display:flex;align-items:center;gap:9px;padding:9px 13px;background:var(--p-surface);border-bottom:1px solid var(--p-line)}.p-tool-ic[data-v-b86e59ea]{width:18px;height:18px;border-radius:5px;display:grid;place-items:center;background:var(--p-accent-soft);color:var(--p-accent);flex:none}.p-tool-name[data-v-b86e59ea]{font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-tool-body[data-v-b86e59ea]{padding:12px 13px}.p-code[data-v-b86e59ea]{font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);line-height:1.65;background:var(--p-surface-sunken);border:1px solid var(--p-line);border-radius:var(--p-r-md);padding:11px 13px;color:var(--p-text);overflow-x:auto}.p-action[data-v-b86e59ea]{border-radius:var(--p-r-md);overflow:hidden;border:1px solid var(--p-accent-bd);background:var(--p-surface)}.p-action.warn[data-v-b86e59ea]{border-color:var(--p-warning-bd)}.p-action-head[data-v-b86e59ea]{display:flex;align-items:center;gap:9px;padding:10px 14px;background:var(--p-accent-soft);border-bottom:1px solid var(--p-accent-bd)}.p-action.warn .p-action-head[data-v-b86e59ea]{background:var(--p-warning-soft);border-bottom-color:var(--p-warning-bd)}.p-action-title[data-v-b86e59ea]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-accent-hover)}.p-action.warn .p-action-title[data-v-b86e59ea]{color:var(--p-warning)}.p-action-body[data-v-b86e59ea]{padding:14px;font-size:var(--p-font-size-base);color:var(--p-text);line-height:var(--p-leading-normal)}.p-action-foot[data-v-b86e59ea]{display:flex;justify-content:flex-end;gap:8px;padding:11px 14px;border-top:1px solid var(--p-line);background:var(--p-surface)}.p-todo[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-md);padding:6px}.p-todo-row[data-v-b86e59ea]{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--p-r-md);font-size:var(--p-font-size-base);color:var(--p-text)}.p-todo-row.done[data-v-b86e59ea]{color:var(--p-text-faint);text-decoration:line-through}.p-todo-row.active[data-v-b86e59ea]{background:var(--p-accent-soft);color:var(--p-text)}.p-todo-check[data-v-b86e59ea]{width:16px;flex:none;font-size:var(--p-font-size-base);line-height:1;text-align:center;user-select:none;color:var(--p-text-faint)}.p-todo-row.done .p-todo-check[data-v-b86e59ea]{color:var(--p-success)}.p-todo-row.active .p-todo-check[data-v-b86e59ea]{color:var(--p-accent);font-weight:500}.p-dot[data-v-b86e59ea]{width:7px;height:7px;border-radius:50%;flex:none;background:var(--p-text-faint)}.p-dot.done[data-v-b86e59ea]{background:var(--p-success)}.p-dot.error[data-v-b86e59ea]{background:var(--p-danger)}.p-dot.running[data-v-b86e59ea]{background:var(--p-accent);box-shadow:0 0 0 0 var(--p-accent-soft);animation:p-pulse-b86e59ea 1.4s ease-out infinite}@keyframes p-pulse-b86e59ea{0%{box-shadow:0 0 #1783ff66}to{box-shadow:0 0 0 6px #1783ff00}}.p-tool-group[data-v-b86e59ea]{border:1px solid var(--p-line);border-radius:var(--p-r-md);background:var(--p-surface);overflow:hidden}.p-tool-group-head[data-v-b86e59ea]{display:flex;align-items:center;gap:8px;height:32px;padding:0 11px;cursor:pointer;font-size:var(--p-font-size-sm);color:var(--p-text-muted);user-select:none}.p-tool-group-head[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);color:var(--p-text)}.p-tool-group-head .tg-title[data-v-b86e59ea]{font-weight:600;color:var(--p-text)}.p-tool-group-head .tg-meta[data-v-b86e59ea]{color:var(--p-text-faint)}.p-tool-group-head .tg-car[data-v-b86e59ea]{margin-left:auto;width:14px;height:14px;color:var(--p-text-faint);transition:transform var(--p-dur) var(--p-ease)}.p-tool-group.open .p-tool-group-head .tg-car[data-v-b86e59ea]{transform:rotate(90deg)}.p-tool-row[data-v-b86e59ea]{display:flex;align-items:center;gap:8px;height:30px;padding:0 11px;border-top:1px solid var(--p-line-2, var(--p-line));cursor:pointer;font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);color:var(--p-text)}.p-tool-row[data-v-b86e59ea]:hover{background:var(--p-surface-sunken)}.p-tool-row .tr-ic[data-v-b86e59ea]{width:14px;height:14px;color:var(--p-text-faint);flex:none}.p-tool-row .tr-name[data-v-b86e59ea]{font-weight:600;color:var(--p-text);flex:none}.p-tool-row .tr-arg[data-v-b86e59ea]{color:var(--p-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.p-tool-row .tr-time[data-v-b86e59ea]{margin-left:auto;color:var(--p-text-faint);font-size:var(--p-font-size-xs);flex:none}.p-tool-row .tr-car[data-v-b86e59ea]{width:13px;height:13px;color:var(--p-text-faint);flex:none;transition:transform var(--p-dur) var(--p-ease)}.p-tool-row.expanded[data-v-b86e59ea]{background:var(--p-surface-sunken)}.p-tool-row.expanded .tr-car[data-v-b86e59ea]{transform:rotate(90deg)}.p-tool-detail[data-v-b86e59ea]{padding:0 11px 11px;background:var(--p-surface-sunken);border-top:1px solid var(--p-line)}.p-tool-detail .p-code[data-v-b86e59ea]{margin-top:10px}.p-composer[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-xl);box-shadow:var(--p-sh-md);overflow:hidden}.p-composer[data-v-b86e59ea]:focus-within{border-color:var(--p-accent);box-shadow:var(--p-sh-md),0 0 0 3px var(--p-accent-soft)}.p-composer-ta[data-v-b86e59ea]{padding:14px 16px 8px;font-family:var(--p-font-sans);font-size:var(--p-font-size-md);color:var(--p-text);line-height:var(--p-leading-normal)}.p-composer-ta.ph[data-v-b86e59ea]{color:var(--p-text-faint)}.p-composer-bar[data-v-b86e59ea]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px 8px}.p-composer-left[data-v-b86e59ea],.p-composer-right[data-v-b86e59ea]{display:flex;align-items:center;gap:2px}.p-send[data-v-b86e59ea]{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--p-accent);color:#fff;border:none;cursor:pointer;box-shadow:var(--p-sh-xs);transition:transform var(--p-dur-fast) var(--p-ease),background var(--p-dur) var(--p-ease)}.p-send[data-v-b86e59ea]:hover{background:var(--p-accent-hover)}.p-send[data-v-b86e59ea]:active{transform:scale(.92)}.p-send .p-ic[data-v-b86e59ea]{width:16px;height:16px}.p[data-v-b86e59ea] ::selection,[data-p][data-v-b86e59ea] ::selection{background:var(--p-selection)}.p-link[data-v-b86e59ea]{color:var(--p-accent);text-decoration:none;font-family:var(--p-font-sans);transition:color var(--p-dur) var(--p-ease)}.p-link[data-v-b86e59ea]:hover{color:var(--p-accent-hover);text-decoration:underline}.p-link[data-v-b86e59ea]:focus-visible{outline:none;box-shadow:var(--p-focus-ring);border-radius:var(--p-r-xs)}.p-link.muted[data-v-b86e59ea]{color:var(--p-text-muted)}.p-link.muted[data-v-b86e59ea]:hover{color:var(--p-text)}.p-link .p-ic[data-v-b86e59ea]{width:var(--p-ic-sm);height:var(--p-ic-sm);vertical-align:-2px}.p-menu[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-lg);box-shadow:var(--p-sh-sm);padding:var(--p-sp-1);min-width:180px;font-family:var(--p-font-sans);color:var(--p-text)}.p-menu-item[data-v-b86e59ea]{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-sm);color:var(--p-text);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-menu-item[data-v-b86e59ea]:hover{background:var(--p-surface-sunken);color:var(--p-text)}.p-menu-item.active[data-v-b86e59ea],.p-menu-item.active[data-v-b86e59ea]:hover{background:var(--p-accent-soft);color:var(--p-accent-hover)}.p-menu-item.danger[data-v-b86e59ea]{color:var(--p-danger)}.p-menu-item.danger[data-v-b86e59ea]:hover{background:var(--p-danger-soft);color:var(--p-danger)}.p-menu-item.disabled[data-v-b86e59ea]{opacity:.5;cursor:not-allowed}.p-menu-item.disabled[data-v-b86e59ea]:hover{background:transparent;color:var(--p-text)}.p-menu-item .p-ic[data-v-b86e59ea]{width:var(--p-ic-sm);height:var(--p-ic-sm)}.p-menu-item.lg[data-v-b86e59ea]{min-height:44px;padding:12px 14px;font-size:var(--p-font-size-base)}.p-menu-sep[data-v-b86e59ea]{height:1px;background:var(--p-line);margin:4px 0}.p-seg[data-v-b86e59ea]{display:inline-flex;gap:2px;padding:2px;background:var(--p-surface-sunken);border:1px solid var(--p-line);border-radius:var(--p-r-md);font-family:var(--p-font-sans)}.p-seg-item[data-v-b86e59ea]{padding:5px 12px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text);cursor:pointer;white-space:nowrap;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease)}.p-seg-item[data-v-b86e59ea]:hover{color:var(--p-text)}.p-seg-item.on[data-v-b86e59ea]{background:var(--p-surface-raised);color:var(--p-text);box-shadow:var(--p-sh-xs)}.p-tabs[data-v-b86e59ea]{display:flex;align-items:center;gap:0;border-bottom:1px solid var(--p-line);font-family:var(--p-font-sans)}.p-tab[data-v-b86e59ea]{padding:8px 14px;font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text-muted);cursor:pointer;white-space:nowrap;border-bottom:2px solid transparent;margin-bottom:-1px;transition:color var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease)}.p-tab[data-v-b86e59ea]:hover{color:var(--p-text)}.p-tab.on[data-v-b86e59ea]{color:var(--p-accent);border-bottom-color:var(--p-accent)}.p-switch[data-v-b86e59ea]{position:relative;display:inline-block;width:36px;height:20px;flex:none;border-radius:var(--p-r-full);background:var(--p-line-strong);cursor:pointer;transition:background var(--p-dur) var(--p-ease)}.p-switch[data-v-b86e59ea]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:var(--p-r-full);background:var(--p-surface-raised);box-shadow:var(--p-sh-xs);transition:transform var(--p-dur) var(--p-ease)}.p-switch.on[data-v-b86e59ea]{background:var(--p-accent)}.p-switch.on[data-v-b86e59ea]:after{transform:translate(16px)}.p-switch[data-v-b86e59ea]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.p-check[data-v-b86e59ea]{width:17px;height:17px;flex:none;display:inline-grid;place-items:center;border:1.5px solid var(--p-line-strong);border-radius:var(--p-r-sm);background:var(--p-surface-raised);color:var(--p-text-on-accent);cursor:pointer;transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease)}.p-check.on[data-v-b86e59ea]{background:var(--p-accent);border-color:var(--p-accent)}.p-check[data-v-b86e59ea]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.p-check .p-ic[data-v-b86e59ea]{width:12px;height:12px}.p-avatar[data-v-b86e59ea]{width:32px;height:32px;flex:none;display:grid;place-items:center;border-radius:var(--p-r-md);background:var(--p-surface-sunken);border:1px solid var(--p-line);color:var(--p-text-muted);font-size:var(--p-font-size-sm);font-weight:600}.p-avatar.sm[data-v-b86e59ea]{width:24px;height:24px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-xs)}.p-avatar .p-ic[data-v-b86e59ea]{width:16px;height:16px}.p-avatar.sm .p-ic[data-v-b86e59ea]{width:13px;height:13px}.p-empty[data-v-b86e59ea]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:32px 16px;color:var(--p-text-muted);text-align:center}.p-empty .em-ic[data-v-b86e59ea]{width:48px;height:48px;color:var(--p-text-faint)}.p-empty .em-title[data-v-b86e59ea]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-text)}.p-empty .em-hint[data-v-b86e59ea]{font-size:var(--p-font-size-sm);color:var(--p-text-muted)}.p-divider[data-v-b86e59ea]{width:100%;height:1px;background:var(--p-line);border:none}.p-divider-v[data-v-b86e59ea]{width:1px;align-self:stretch;background:var(--p-line);border:none}.p-tip[data-v-b86e59ea]{position:relative;display:inline-flex}.p-tip .p-tooltip[data-v-b86e59ea]{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--p-text);color:var(--p-bg);font-size:var(--p-font-size-xs);padding:4px 8px;border-radius:var(--p-r-sm);white-space:nowrap;opacity:0;pointer-events:none;transition:opacity var(--p-dur-fast) var(--p-ease)}.p-tip:hover .p-tooltip[data-v-b86e59ea]{opacity:1}.p-banner[data-v-b86e59ea]{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:var(--p-r-md);border:1px solid var(--p-line);background:var(--p-surface);font-size:var(--p-font-size-sm);color:var(--p-text)}.p-banner .bn-ic[data-v-b86e59ea]{width:18px;height:18px;flex:none}.p-banner.info[data-v-b86e59ea]{background:var(--p-accent-soft);border-color:var(--p-accent-bd)}.p-banner.info .bn-ic[data-v-b86e59ea]{color:var(--p-accent)}.p-banner.warning[data-v-b86e59ea]{background:var(--p-warning-soft);border-color:var(--p-warning-bd)}.p-banner.warning .bn-ic[data-v-b86e59ea]{color:var(--p-warning)}.p-banner.danger[data-v-b86e59ea]{background:var(--p-danger-soft);border-color:var(--p-danger-bd)}.p-banner.danger .bn-ic[data-v-b86e59ea]{color:var(--p-danger)}.p-sheet[data-v-b86e59ea]{background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-xl) var(--p-r-xl) 0 0;box-shadow:var(--p-sh-xl);padding:8px 16px 20px}.p-sheet-handle[data-v-b86e59ea]{width:36px;height:4px;border-radius:var(--p-r-full);background:var(--p-line-strong);margin:0 auto 8px}.p-skeleton[data-v-b86e59ea]{background:var(--p-surface-sunken);border-radius:var(--p-r-sm);animation:p-skel-b86e59ea 1.2s var(--p-ease-inout) infinite alternate}@keyframes p-skel-b86e59ea{0%{opacity:.5}to{opacity:1}}.p-cmdbar[data-v-b86e59ea]{display:flex;align-items:center;gap:8px;width:100%}.p-cmd[data-v-b86e59ea]{flex:1;min-width:0;height:38px;display:flex;align-items:center;gap:10px;padding:0 10px 0 14px;background:var(--p-surface-sunken);border:1px solid var(--p-line);border-radius:var(--p-r-md);font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);color:var(--p-text-muted)}.p-cmd .cmd-text[data-v-b86e59ea]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-cmd .cmd-copy[data-v-b86e59ea]{margin-left:auto;flex:none;display:grid;place-items:center;width:26px;height:26px;border:none;background:transparent;border-radius:var(--p-r-sm);color:var(--p-text-faint);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-cmd .cmd-copy[data-v-b86e59ea]:hover{background:var(--p-surface-raised);color:var(--p-text)}.p-cmd .cmd-copy .p-ic[data-v-b86e59ea]{width:15px;height:15px}.p-topbar[data-v-b86e59ea]{display:flex;align-items:center;justify-content:space-between;gap:12px;height:48px;padding:0 16px;background:var(--p-surface-raised);border:1px solid var(--p-line);border-radius:var(--p-r-lg)}.p-topbar .tb-title[data-v-b86e59ea]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-topbar .tb-actions[data-v-b86e59ea]{display:flex;align-items:center;gap:4px}.p-topbar.frost[data-v-b86e59ea]{background:#ffffffb8;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-color:#fff9}[data-p=dark] .p-topbar.frost[data-v-b86e59ea]{background:#161b22b8;border-color:#ffffff14}.demo-family-black[data-v-b86e59ea]{--p-accent: #14171c;--p-accent-hover: #2f3540;--p-accent-soft: #f1f2f4;--p-accent-bd: #d8dbe0;--p-text-on-accent: #ffffff}.demo-row[data-v-b86e59ea]{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.demo-stack[data-v-b86e59ea]{display:flex;flex-direction:column;gap:12px;width:100%}.demo-col[data-v-b86e59ea]{display:flex;flex-direction:column;gap:10px}.demo-grow[data-v-b86e59ea]{flex:1;min-width:0}.demo-chat[data-v-b86e59ea]{display:flex;flex-direction:column;gap:14px;width:100%;max-width:560px}.icon-grid[data-v-b86e59ea]{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px;margin:14px 0}.icon-group-label[data-v-b86e59ea]{grid-column:1 / -1;margin-top:10px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--d-fg-muted)}.icon-cell[data-v-b86e59ea]{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--d-line);border-radius:8px;background:var(--d-surface)}.icon-cell .kw-icon[data-v-b86e59ea]{width:20px;height:20px;color:var(--d-fg-soft)}.icon-cell .ic-name[data-v-b86e59ea]{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--d-fg)}.icon-sizes[data-v-b86e59ea]{display:flex;align-items:end;gap:22px;flex-wrap:wrap}.icon-sizes .sz[data-v-b86e59ea]{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:11px;color:var(--d-fg-muted);font-family:JetBrains Mono,ui-monospace,monospace}.p-code-inline[data-v-b86e59ea]{font-family:var(--p-font-mono);background:var(--p-surface-sunken);color:var(--p-text);padding:0 5px;border-radius:var(--p-r-sm);font-size:.9em}.p-code-block[data-v-b86e59ea]{border:1px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;background:var(--p-surface-sunken)}.p-code-block-head[data-v-b86e59ea]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--p-surface);border-bottom:1px solid var(--p-line);font-family:var(--p-font-mono);font-size:var(--p-font-size-xs);color:var(--p-text-muted)}.p-code-block pre[data-v-b86e59ea]{margin:0;padding:12px 14px;font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);line-height:1.65;color:var(--p-text);overflow-x:auto}.p-diff[data-v-b86e59ea]{border:1px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;font-family:var(--p-font-mono);font-size:var(--p-font-size-sm)}.p-diff-head[data-v-b86e59ea]{padding:8px 12px;background:var(--p-surface);border-bottom:1px solid var(--p-line);font-size:var(--p-font-size-xs);color:var(--p-text-muted)}.p-diff-row[data-v-b86e59ea]{display:flex;gap:10px;padding:2px 12px;line-height:1.6}.p-diff-row .pm[data-v-b86e59ea]{width:14px;flex:none;color:var(--p-text-faint)}.p-diff-row.add[data-v-b86e59ea]{background:var(--p-success-soft)}.p-diff-row.add .pm[data-v-b86e59ea]{color:var(--p-success)}.p-diff-row.del[data-v-b86e59ea]{background:var(--p-danger-soft)}.p-diff-row.del .pm[data-v-b86e59ea]{color:var(--p-danger)}.p-diff-row .p-diff-code[data-v-b86e59ea]{color:var(--p-text)}.p-field-error[data-v-b86e59ea]{color:var(--p-danger);font-size:var(--p-font-size-xs)}.p-btn .p-spinner[data-v-b86e59ea]{vertical-align:middle}.p-btn .p-spinner .track[data-v-b86e59ea]{stroke:currentColor;opacity:.35}.p-btn .p-spinner .arc[data-v-b86e59ea]{stroke:currentColor}.ds-page[data-v-b86e59ea]{position:fixed;inset:0;z-index:var(--z-max);overflow-y:auto}.ds-topbar[data-v-b86e59ea]{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-4);background:var(--color-surface);border-bottom:1px solid var(--color-line)}.ds-back[data-v-b86e59ea]{display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-3);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-raised);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);cursor:pointer}.ds-back[data-v-b86e59ea]:hover{background:var(--color-surface-sunken)}.ds-topbar-title[data-v-b86e59ea]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)} diff --git a/apps/kimi-code/dist-web/assets/Tooltip-CsrTX-eT.js b/apps/kimi-code/dist-web/assets/Tooltip-CsrTX-eT.js new file mode 100644 index 0000000000..149593d8ca --- /dev/null +++ b/apps/kimi-code/dist-web/assets/Tooltip-CsrTX-eT.js @@ -0,0 +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-DtRfJ0vw.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-CDU05fwN.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/kimi-code/dist-web/assets/__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js b/apps/kimi-code/dist-web/assets/__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js new file mode 100644 index 0000000000..b480ffe6ce --- /dev/null +++ b/apps/kimi-code/dist-web/assets/__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js @@ -0,0 +1 @@ +const e={};export{e as default}; diff --git a/apps/kimi-code/dist-web/assets/arc-Doj0wRZ0.js b/apps/kimi-code/dist-web/assets/arc-Doj0wRZ0.js new file mode 100644 index 0000000000..77445a6978 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/arc-Doj0wRZ0.js @@ -0,0 +1 @@ +import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./mermaidParser.worker-Dx4jPi9z.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,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*ur*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),sy))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(Fy?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+j*j&&(V=w,W=p),{cx:V,cy:W,x01:-n,y01:-d,x11:V*(v/T-1),y11:W*(v/T-1)}}function hn(){var l=cn,h=yn,I=X(0),D=null,v=gn,A=dn,Y=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,$=rn(c-f),t=c>f;if(a||(a=n=O()),sy))a.moveTo(0,0);else if($>tn-y)a.moveTo(s*z(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=$,S=$,V=Y.apply(this,arguments)/2,W=V>y&&(D?+D.apply(this,arguments):F(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(W>y){var j=sn(W/u*q(V)),G=sn(W/s*q(V));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(S-=G*2)>y?(G*=t?1:-1,m+=G,g-=G):(S=0,m=g=(f+c)/2)}var B=s*z(m),C=s*q(m),H=u*z(T),J=u*q(T);if(w>y){var K=s*z(g),L=s*q(g),N=u*z(R),Q=u*q(R),E;if($y?x>y?(e=M(N,Q,B,C,s,x,t),r=M(K,L,H,J,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(H,J):p>y?(e=M(H,J,K,L,u,-p,t),r=M(B,C,N,Q,u,-p,t),a.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()},w.exports=r}),(function(w,U,L){var u=L(0);function h(){}for(var a in u)h[a]=u[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,w.exports=h}),(function(w,U,L){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(0),e=L(7),i=L(3),f=L(1),r=L(13),v=L(12),t=L(11);function s(c,l,T){u.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(u.prototype);for(var o in u)s[o]=u[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,N=0;N-1&&S>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(S,1);var b=g.source.owner.getEdges().indexOf(g);if(b==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,N=this.getNodes(),b=N.length,A=0;AT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?d=N[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new v(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,N,b,A,S,V,X=this.nodes,Z=X.length,D=0;DN&&(l=N),TA&&(g=A),dN&&(l=N),TA&&(g=A),d=this.nodes.length){var Z=0;T.forEach(function(D){D.owner==c&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,U,L){var u,h=L(1);function a(e){u=L(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,v){if(f==null&&r==null&&v==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{v=f,r=i,f=e;var t=r.getOwner(),s=v.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,v);if(f.isInterGraph=!0,f.source=r,f.target=v,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 u){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,v=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 v=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(v=1);var t=v*i[0],s=i[1]/v;i[0]t)return i[0]=f,i[1]=o,i[2]=v,i[3]=X,!1;if(rv)return i[0]=s,i[1]=r,i[2]=S,i[3]=t,!1;if(fv?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>v?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-E===y?v>f?(i[2]=V,i[3]=X,m=!0):(i[2]=S,i[3]=A,m=!0):E===y&&(v>f?(i[2]=b,i[3]=A,m=!0):(i[2]=Z,i[3]=X,m=!0)),n&&m)return!1;if(f>v?r>t?(I=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,R=f+-N/y,i[0]=R,i[1]=W;break;case 2:R=g,W=r+d*y,i[0]=R,i[1]=W;break;case 3:W=T,R=f+N/y,i[0]=R,i[1]=W;break;case 4:R=l,W=r+-d*y,i[0]=R,i[1]=W;break}if(!m)switch(M){case 1:Q=A,x=v+-_/y,i[2]=x,i[3]=Q;break;case 2:x=Z,Q=t+D*y,i[2]=x,i[3]=Q;break;case 3:Q=X,x=v+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-D*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,v=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,N=void 0,b=void 0,A=void 0,S=void 0,V=void 0,X=void 0,Z=void 0;return N=s-v,A=r-t,V=t*v-r*s,b=T-c,S=o-l,X=l*c-o*T,Z=N*S-b*A,Z===0?null:(g=(A*X-S*V)/Z,d=(b*V-N*X)/Z,new u(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,w.exports=h}),(function(w,U,L){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},w.exports=u}),(function(w,U,L){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,w.exports=u}),(function(w,U,L){var u=(function(){function r(v,t){for(var s=0;s"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},w.exports=h}),(function(w,U,L){function u(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(N.push(A[0]);N.length>0&&c;){var S=N[0];N.splice(0,1),d.add(S);for(var V=S.getEdges(),g=0;g-1&&A.splice(_,1)}d=new Set,b=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(X,1);var Z=b.getNeighborsList();Z.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&S.push(n),T.set(n,p)}})}l=l.concat(S),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,U,L){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},w.exports=u}),(function(w,U,L){var u=L(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 u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},w.exports=h}),(function(w,U,L){function u(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;oN||d>N)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>N||d>N)&&(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||N>=g[0].length)){for(var b=0;br}}]),i})();w.exports=e}),(function(w,U,L){function u(){}u.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 Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,r=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(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 gt=n-2;gt>=J;gt--){var mt=u.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==J&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=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},w.exports=u}),(function(w,U,L){var u=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,v=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=v,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 U={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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),v=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,N=i(551).DimensionD,b=i(551).Layout,A=i(551).Integer,S=i(551).IGeometry,V=i(551).LGraph,X=i(551).Transform,Z=i(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var _ in f)D[_]=f[_];D.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new v(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.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)},D.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},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.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 m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.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 m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});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},D.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()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),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,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var M=new Map,R=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)),B=O[tt],O[tt]=O[H],O[H]=B;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=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.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(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:B,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:H,gap:O.gap})}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.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=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;Q.has(H)?Q.get(H).push(B):Q.set(H,[B]),Q.has(B)?Q.get(B).push(H):Q.set(B,[H])}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.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 Y=function(H,B){var tt=[],ht=[],J=new Z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var gt=it;for(J.push(gt),It.add(gt),tt[Nt].push(gt);J.length!=0;){gt=J.shift(),B.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(J.push(At),It.add(At),tt[Nt].push(At))})}Nt++}}),{components:tt,isFixed:ht}},rt=Y(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=Y(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=n.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;RE&&(E=Math.floor(M.y)),I=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=V.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var M=0;M1;){var B=H[0];H.splice(0,1);var tt=z.indexOf(B);tt>=0&&z.splice(tt,1),$--,Y--}m!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(E-p)/Y,J=O;rt!=Y;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=m){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;pm&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var Q=m[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 Y=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,M)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,M=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,M,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;EQ&&(Q=Y.rect.height)}p+=Q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,M=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(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),M;return IR&&(R=$.getWidth())});var W=I/y,x=M/y,Q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,z=(E-p+Math.sqrt(Q))/(2*(W+E)),Y;m?(Y=Math.ceil(z),Y==z&&Y++):Y=Math.floor(z);var rt=Y*(W+E)-E;return R>rt&&(rt=R),rt+=E*2,rt},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function($,O){var H=W;return M.idealRowWidth?(H=I,H($.id,O.id)):H($,O)});for(var x=0,Q=0,z=0;z0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var M=n.rowWidth[I];if(M+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+R)/(M+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,R=0;RM&&(M=E[R].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)Y[0]+=this.grid[rt][M-1].length+this.grid[rt][M].length-1;if(I0)for(var rt=M;rt<=R;rt++)Y[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=A.MAX_VALUE,O,H,B=0;B{var f=i(551).FDLayoutNode,r=i(551).IMath;function v(s,o,c,l){f.call(this,s,o,c,l)}v.prototype=Object.create(f.prototype);for(var t in f)v[t]=f[t];v.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)},v.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){k=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?N[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){k=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?N[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}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(P){var k=0,K=0,q=0,at=0;if(P.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?k++:K++:N[g.get(j.top)]-N[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,P){E[P]=[F.position.x,F.position.y],y[P]=[d[g.get(F.nodeId)],N[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var P=l.alignmentConstraint.vertical,k=function(et){var j=new Set;P[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).x,P[et].forEach(function(pt){E[F]=[wt,N[g.get(pt)]],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},K=0;K0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).y,q[et].forEach(function(pt){E[F]=[d[g.get(pt)],wt],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,Y=rt);if(z0){var Et={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,P){var k={x:d[g.get(F.nodeId)],y:N[g.get(F.nodeId)]},K=F.position,q=X(K,k);Et.x+=q.x,Et.y+=q.y}),Et.x/=l.fixedNodeConstraint.length,Et.y/=l.fixedNodeConstraint.length,d.forEach(function(F,P){d[P]+=Et.x}),N.forEach(function(F,P){N[P]+=Et.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,N[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(P){var k=new Set;Dt[P].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=Z(k).x,k.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=N[g.get(K.values().next().value)]:q=Z(k).y,k.forEach(function(at){R.has(at)||(N[g.get(at)]=q)})},Ft=0;Ft{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,G){(function(U,L){C.exports=L(dr())})(vr,function(w){return(()=>{var U={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](),N;!(l=(N=d.next()).done)&&(c.push(N.value),!(o&&c.length===o));l=!0);}catch(b){T=!0,g=b}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,v={};v.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var M=0;M1){N=g[0],b=N.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),X},v.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,N=!1,b=void 0;try{for(var A=s.nodeIndexes[Symbol.iterator](),S;!(d=(S=A.next()).done);d=!0){var V=S.value,X=f(V,2),Z=X[0],D=X[1],_=o.cy.getElementById(Z);if(_){var n=_.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;ml&&(l=p),Eg&&(g=y)}}}catch(x){N=!0,b=x}finally{try{!d&&A.return&&A.return()}finally{if(N)throw b}}var I=t.x-(l+c)/2,M=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+M})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,Y=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=Y),rtg&&(g=$)});var R=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()+R,Q.getCenterY()+W)})}}},v.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,N=void 0,b=void 0,A=void 0,S=void 0,V=t.descendants().not(":parent"),X=V.length,Z=0;ZN&&(l=N),TA&&(g=A),d{var f=i(548),r=i(140).CoSELayout,v=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,N){var b=d.cy,A=d.eles,S=A.nodes(),V=A.edges(),X=void 0,Z=void 0,D=void 0,_={};d.randomize&&(X=N.nodeIndexes,Z=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(b,A),E=function W(x,Q,z,Y){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),B),W(J,H,z,Y)}}},y=function(x,Q,z){for(var Y=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/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 M=new r,R=M.newGraphManager();return E(R.addRoot(),f.getTopMostNodes(S),M,d),y(M,R,V),I(M,d),M.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(N,b){for(var A=0;A0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(S,A.eles,I),D.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,X.push(o(A))}),A.quality=="default"||A.quality=="proof"){var M=S.collection();if(A.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(z.nodeIndexes.set(vt.nodes()[mt].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),M.length>1){var rt=M.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),D.push(M),X.push(z);for(var $=Y.length-1;$>=0;$--)D.splice(Y[$],1),X.splice(Y[$],1),_.splice(Y[$],1)}}D.forEach(function(vt,it){A.eles=vt,Z.push(l(A,X[it])),t.relocateComponent(_[it],Z[it],A)})}else D.forEach(function(vt,it){t.relocateComponent(_[it],X[it],A)});var O=new Set;if(D.length>1){var H=[],B=V.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(A.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else Z[it][Ot.id()]&&mt.nodes.push({x:Z[it][Ot.id()].getLeft(),y:Z[it][Ot.id()].getTop(),width:Z[it][Ot.id()].getWidth(),height:Z[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else Z[it][Et.id()]&&Z[it][Dt.id()]&&mt.edges.push({startX:Z[it][Et.id()].getCenterX(),startY:Z[it][Et.id()].getCenterY(),endX:Z[it][Dt.id()].getCenterX(),endY:Z[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var tt=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+tt[it].dx}),mt=vt.yCoords.map(function(At){return At+tt[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(Z[vt]).forEach(function(it){var gt=Z[vt][it];gt.setCenter(gt.getCenterX()+tt[ht].dx,gt.getCenterY()+tt[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(_.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=o(A);X.push(y)}A.quality=="default"||A.quality=="proof"?(Z.push(l(A,X[0])),t.relocateComponent(_[0],Z[0],A)):t.relocateComponent(_[0],X[0],A)}var J=function(it,gt){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return Z.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(S,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});A.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,A,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,v=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,N=new Map,b=new Map,A=[],S=[],V=[],X=[],Z=[],D=[],_=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,M=o.nodeSeparation,R=void 0,W=function(){for(var P=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=A[nt],lt=0;ltut&&(ut=Z[Lt],wt=Lt)}return wt},Q=function(P){var k=void 0;if(P){k=Math.floor(Math.random()*m);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(k.isParent()?A[P].push(b.get(k.id())):A[P].push(k.id()))})});var Nt=function(P){var k=N.get(P),K=void 0;d.get(P).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,A[k].push(K),A[N.get(K)].push(P)})},vt=!0,it=!1,gt=void 0;try{for(var mt=d.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){it=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){R=m{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(579);return h})()})})(se)),se.exports}var yr=pr(),Er=Be(yr),De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,G)=>C-G+2,"L"),R:dt((C,G)=>C-2,"R"),T:dt((C,G)=>C-G+2,"T"),B:dt((C,G)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),Wt=dt(function(C){const G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),me=dt(function(C,G){const w=Wt(C)&&qt(G),U=qt(C)&&Wt(G);return w||U},"isArchitectureDirectionXY"),Tr=dt(function(C){const G=C[0],w=C[1],U=Wt(G)&&qt(w),L=qt(G)&&Wt(w);return U||L},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,G){const w=`${C}${G}`;return Nr(w)?w:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,G],w){const U=w[0],L=w[1];return Wt(U)?qt(L)?[C+(U==="L"?-1:1),G+(L==="T"?1:-1)]:[C+(U==="L"?-1:1),G]:Wt(L)?[C+(L==="L"?1:-1),G+(U==="T"?1:-1)]:[C,G+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,G){return me(C,G)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(C){return C.type==="service"},"isArchitectureService"),Mr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=ir.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qe,this.getAccTitle=Qe,this.setDiagramTitle=Je,this.getDiagramTitle=Ke,this.getAccDescription=je,this.setAccDescription=_e,this.clear()}static{dt(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",tr()}addService({id:C,icon:G,in:w,title:U,iconText:L}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[w]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:G,iconText:L,title:U,edges:[],in:w}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:C,in:G}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[G]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:G}}getJunctions(){return Object.values(this.nodes).filter(Mr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:G,in:w,title:U}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[w]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[w]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:G,title:U,in:w}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:G,lhsDir:w,rhsDir:U,lhsInto:L,rhsInto:u,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(w))throw new Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(w)}`);if(!Ie(U))throw new Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[G]===void 0&&this.groups[G]===void 0)throw new Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes[C].in,f=this.nodes[G].in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${C}] 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 [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:C,lhsDir:w,lhsInto:L,lhsGroup:h,rhsId:G,rhsDir:U,rhsInto:u,rhsGroup:a,title:e};this.edges.push(r),this.nodes[C]&&this.nodes[G]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[G].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},G=Object.entries(this.nodes).reduce((a,[e,i])=>(a[e]=i.edges.reduce((f,r)=>{const v=this.getNode(r.lhsId)?.in,t=this.getNode(r.rhsId)?.in;if(v&&t&&v!==t){const s=Ar(r.lhsDir,r.rhsDir);s!=="bend"&&(C[v]??={},C[v][t]=s,C[t]??={},C[t][v]=s)}if(r.lhsId===e){const s=pe(r.lhsDir,r.rhsDir);s&&(f[s]=r.rhsId)}else{const s=pe(r.rhsDir,r.lhsDir);s&&(f[s]=r.lhsId)}return f},{}),a),{}),w=Object.keys(G)[0],U={[w]:1},L=Object.keys(G).reduce((a,e)=>e===w?a:{...a,[e]:1},{}),u=dt(a=>{const e={[a]:[0,0]},i=[a];for(;i.length>0;){const f=i.shift();if(f){U[f]=1,delete L[f];const r=G[f],[v,t]=e[f];Object.entries(r).forEach(([s,o])=>{U[o]||(e[o]=Lr([v,t],s),i.push(o))})}}return e},"BFS"),h=[u(w)];for(;Object.keys(L).length>0;)h.push(u(Object.keys(L)[0]));this.dataStructures={adjList:G,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements[C]=G}getElementById(C){return this.elements[C]}getConfig(){return er({...Or,...rr().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,G)=>{lr(C,G),C.groups.map(w=>G.addGroup(w)),C.services.map(w=>G.addService({...w,type:"service"})),C.junctions.map(w=>G.addJunction({...w,type:"junction"})),C.edges.map(w=>G.addEdge(w))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const G=await fr("architecture",C);Re.debug(G);const w=Pe.parser?.yy;if(!(w instanceof be))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.");Dr(G,w)},"parse")},xr=dt(C=>` + .edge { + stroke-width: ${C.archEdgeWidth}; + stroke: ${C.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${C.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${C.archGroupBorderColor}; + stroke-width: ${C.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),Ir=xr,re=dt(C=>`${C}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:hr,blank:{body:re("")}}},Rr=dt(async function(C,G,w,U){const L=w.getConfigField("padding"),u=w.getConfigField("iconSize"),h=u/2,a=u/6,e=a/2;await Promise.all(G.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:v,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Fe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:N,y:b}=i[0].midpoint();let{x:A,y:S}=i[0].targetEndpoint();const V=L+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?A+=o==="L"?-V:V:S+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&w.getNode(s)?.type==="junction"&&(Wt(o)?A+=o==="L"?h:-h:S+=o==="T"?h:-h),i[0]._private.rscratch){const X=C.insert("g");if(X.insert("path").attr("d",`M ${g},${d} L ${N},${b} L${A},${S} `).attr("class","edge").attr("id",`${U}-${or(f,s,{prefix:"L"})}`),v){const Z=Wt(r)?oe[r](g,a):g-e,D=qt(r)?oe[r](d,a):d-e;X.insert("polygon").attr("points",xe[r](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(c){const Z=Wt(o)?oe[o](A,a):A-e,D=qt(o)?oe[o](S,a):S-e;X.insert("polygon").attr("points",xe[o](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(T){const Z=me(r,o)?"XY":Wt(r)?"X":"Y";let D=0;Z==="X"?D=Math.abs(g-A):Z==="Y"?D=Math.abs(d-S)/1.5:D=Math.abs(g-A)/2;const _=X.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},ye()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Z==="X")_.attr("transform","translate("+N+", "+b+")");else if(Z==="Y")_.attr("transform","translate("+N+", "+b+") rotate(-90)");else if(Z==="XY"){const n=pe(r,o);if(n&&Tr(n)){const m=_.node().getBoundingClientRect(),[p,E]=Cr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*E*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",` + translate(${N}, ${b-m.height/2}) + translate(${p*y.width/2}, ${E*y.height/2}) + rotate(${-1*p*E*45}, 0, ${m.height/2}) + `)}}}}}))},"drawEdges"),Sr=dt(async function(C,G,w,U){const u=w.getConfigField("padding")*.75,h=w.getConfigField("fontSize"),e=w.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:v,x1:t,y1:s}=i.boundingBox(),o=C.append("rect");o.attr("id",`${U}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",v).attr("height",r).attr("class","node-bkg");const c=C.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:u,width:u,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=u,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ye()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Fr=dt(async function(C,G,w,U){const L=ye();for(const u of w){const h=G.append("g"),a=C.getConfigField("iconSize");if(u.title){const r=h.append("g");await Ee(r,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(u.icon)e.html(`${await ve(u.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(u.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ar(u.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${U}-node-${u.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${U}-service-${u.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();u.width=i,u.height=f,C.setElementForId(u.id,h)}return 0},"drawServices"),br=dt(function(C,G,w,U){w.forEach(L=>{const u=G.append("g"),h=C.getConfigField("iconSize");u.append("g").append("rect").attr("id",`${U}-node-${L.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),u.attr("class","architecture-junction");const{width:e,height:i}=u._groups[0][0].getBBox();u.width=e,u.height=i,C.setElementForId(L.id,u)})},"drawJunctions");sr([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,G){G.nodes().map(w=>{const U=ie(w);if(U.type==="group")return;U.x=w.position().x,U.y=w.position().y,C.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,G){C.forEach(w=>{G.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,G){C.forEach(w=>{const{lhsId:U,rhsId:L,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=w,v=me(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${U}-${L}`,label:r,source:U,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:t,classes:v})})}dt(He,"addEdges");function We(C,G,w){const U=dt((a,e)=>Object.entries(a).reduce((i,[f,r])=>{let v=0;const t=Object.entries(r);if(t.length===1)return i[f]=t[0][1],i;for(let s=0;s{const e={},i={};return Object.entries(a).forEach(([f,[r,v]])=>{const t=C.getNode(f)?.in??"default";e[v]??={},e[v][t]??=[],e[v][t].push(f),i[r]??={},i[r][t]??=[],i[r][t].push(f)}),{horiz:Object.values(U(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(U(i,"vertical")).filter(f=>f.length>1)}}),[u,h]=L.reduce(([a,e],{horiz:i,vert:f})=>[[...a,...i],[...e,...f]],[[],[]]);return{horizontal:u,vertical:h}}dt(We,"getAlignments");function Ve(C,G){const w=[],U=dt(u=>`${u[0]},${u[1]}`,"posToStr"),L=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([f,r])=>[U(r),f])),a=[U([0,0])],e={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const r=h[f];if(r){const v=L(f);Object.entries(i).forEach(([t,s])=>{const o=U([v[0]+s[0],v[1]+s[1]]),c=h[o];c&&!e[o]&&(a.push(o),w.push({[De[t]]:c,[De[mr(t)]]:r,gap:1.5*G.getConfigField("iconSize")}))})}}}}),w}dt(Ve,"getRelativeConstraints");function ze(C,G,w,U,L,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=nr("body").append("div").attr("id","cy").attr("style","display:none"),i=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(w,i),Ge(C,i,L),Ue(G,i,L),He(U,i);const f=We(L,u,h),r=Ve(u,L),v=L.getConfigField("iconSize"),t=L.getConfigField("idealEdgeLengthMultiplier")*v,s=.5*v,o=L.getConfigField("edgeElasticity"),c=i.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),nodeSeparation:L.getConfigField("nodeSeparation"),numIter:L.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?t:s},edgeElasticity(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?o:.001},alignmentConstraint:f,relativePlacementConstraint:r});c.one("layoutstop",()=>{function l(T,g,d,N){let b,A;const{x:S,y:V}=T,{x:X,y:Z}=g;A=(N-V+(S-d)*(V-Z)/(S-X))/Math.sqrt(1+Math.pow((V-Z)/(S-X),2)),b=Math.sqrt(Math.pow(N-V,2)+Math.pow(d-S,2)-Math.pow(A,2));const D=Math.sqrt(Math.pow(X-S,2)+Math.pow(Z-V,2));b=b/D;let _=(X-S)*(N-V)-(Z-V)*(d-S);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let n=(X-S)*(d-S)+(Z-V)*(N-V);switch(!0){case n>=0:n=1;break;case n<0:n=-1;break}return A=Math.abs(A)*_,b=b*n,{distances:A,weights:b}}dt(l,"getSegmentWeights"),i.startBatch();for(const T of Object.values(i.edges()))if(T.data?.()){const{x:g,y:d}=T.source().position(),{x:N,y:b}=T.target().position();if(g!==N&&d!==b){const A=T.sourceEndpoint(),S=T.targetEndpoint(),{sourceDir:V}=Fe(T),[X,Z]=qt(V)?[A.x,S.y]:[S.x,A.y],{weights:D,distances:_}=l(A,S,X,Z);T.style("segment-distances",_),T.style("segment-weights",D)}}i.endBatch(),c.run()}),c.run(),i.ready(l=>{Re.info("Ready",l),a(i)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,G,w,U)=>{const L=U.db;L.setDiagramId(G);const u=L.getServices(),h=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),i=L.getDataStructures(),f=ke(G),r=f.append("g");r.attr("class","architecture-edges");const v=f.append("g");v.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Fr(L,v,u,G),br(L,v,h,G);const s=await ze(u,h,a,e,L,i);await Rr(r,s,L,G),await Sr(t,s,L,G),Ye(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},Wr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{Wr as diagram}; diff --git a/apps/kimi-code/dist-web/assets/architectureDiagram-3BPJPVTR-bSps5znF.js b/apps/kimi-code/dist-web/assets/architectureDiagram-3BPJPVTR-bSps5znF.js new file mode 100644 index 0000000000..96d59bfd31 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/architectureDiagram-3BPJPVTR-bSps5znF.js @@ -0,0 +1,36 @@ +import{b4 as Be,_ as dt,I as ke,af as Ze,l as Re,b as qe,a as Qe,p as Je,q as Ke,g as je,s as _e,z as tr,F as er,D as rr,G as ir,c as ye,aO as Ee,b5 as ve,i as ar,d as nr,x as or,b6 as sr,b7 as hr}from"./mermaid.core-zKrc8Ye9.js";import{p as lr}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{p as fr}from"./wardley-L42UT6IY-gSV1j6uw.js";import{c as Se}from"./cytoscape.esm-nFXppDBa.js";import"./index-DtRfJ0vw.js";var se={exports:{}},he={exports:{}},le={exports:{}},cr=le.exports,we;function gr(){return we||(we=1,(function(C,G){(function(U,L){C.exports=L()})(cr,function(){return(function(w){var U={};function L(u){if(U[u])return U[u].exports;var h=U[u]={i:u,l:!1,exports:{}};return w[u].call(h.exports,h,h.exports,L),h.l=!0,h.exports}return L.m=w,L.c=U,L.i=function(u){return u},L.d=function(u,h,a){L.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:a})},L.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return L.d(h,"a",h),h},L.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},L.p="",L(L.s=28)})([(function(w,U,L){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,w.exports=u}),(function(w,U,L){var u=L(2),h=L(8),a=L(9);function e(f,r,v){u.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(u.prototype);for(var i in u)e[i]=u[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 v=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(v.getOwner()==r)return v;if(v.getOwner()==t)break;v=v.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)},w.exports=e}),(function(w,U,L){function u(h){this.vGraphObject=h}w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(13),e=L(0),i=L(16),f=L(5);function r(t,s,o,c){o==null&&c==null&&(c=s),u.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(u.prototype);for(var v in u)r[v]=u[v];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()},w.exports=r}),(function(w,U,L){var u=L(0);function h(){}for(var a in u)h[a]=u[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,w.exports=h}),(function(w,U,L){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(0),e=L(7),i=L(3),f=L(1),r=L(13),v=L(12),t=L(11);function s(c,l,T){u.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(u.prototype);for(var o in u)s[o]=u[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,N=0;N-1&&S>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(S,1);var b=g.source.owner.getEdges().indexOf(g);if(b==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,N=this.getNodes(),b=N.length,A=0;AT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?d=N[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new v(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,N,b,A,S,V,X=this.nodes,Z=X.length,D=0;DN&&(l=N),TA&&(g=A),dN&&(l=N),TA&&(g=A),d=this.nodes.length){var Z=0;T.forEach(function(D){D.owner==c&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,U,L){var u,h=L(1);function a(e){u=L(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,v){if(f==null&&r==null&&v==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{v=f,r=i,f=e;var t=r.getOwner(),s=v.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,v);if(f.isInterGraph=!0,f.source=r,f.target=v,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 u){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,v=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 v=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(v=1);var t=v*i[0],s=i[1]/v;i[0]t)return i[0]=f,i[1]=o,i[2]=v,i[3]=X,!1;if(rv)return i[0]=s,i[1]=r,i[2]=S,i[3]=t,!1;if(fv?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>v?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-E===y?v>f?(i[2]=V,i[3]=X,m=!0):(i[2]=S,i[3]=A,m=!0):E===y&&(v>f?(i[2]=b,i[3]=A,m=!0):(i[2]=Z,i[3]=X,m=!0)),n&&m)return!1;if(f>v?r>t?(I=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,R=f+-N/y,i[0]=R,i[1]=W;break;case 2:R=g,W=r+d*y,i[0]=R,i[1]=W;break;case 3:W=T,R=f+N/y,i[0]=R,i[1]=W;break;case 4:R=l,W=r+-d*y,i[0]=R,i[1]=W;break}if(!m)switch(M){case 1:Q=A,x=v+-_/y,i[2]=x,i[3]=Q;break;case 2:x=Z,Q=t+D*y,i[2]=x,i[3]=Q;break;case 3:Q=X,x=v+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-D*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,v=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,N=void 0,b=void 0,A=void 0,S=void 0,V=void 0,X=void 0,Z=void 0;return N=s-v,A=r-t,V=t*v-r*s,b=T-c,S=o-l,X=l*c-o*T,Z=N*S-b*A,Z===0?null:(g=(A*X-S*V)/Z,d=(b*V-N*X)/Z,new u(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,w.exports=h}),(function(w,U,L){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},w.exports=u}),(function(w,U,L){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,w.exports=u}),(function(w,U,L){var u=(function(){function r(v,t){for(var s=0;s"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},w.exports=h}),(function(w,U,L){function u(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(N.push(A[0]);N.length>0&&c;){var S=N[0];N.splice(0,1),d.add(S);for(var V=S.getEdges(),g=0;g-1&&A.splice(_,1)}d=new Set,b=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(X,1);var Z=b.getNeighborsList();Z.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&S.push(n),T.set(n,p)}})}l=l.concat(S),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,U,L){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},w.exports=u}),(function(w,U,L){var u=L(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 u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},w.exports=h}),(function(w,U,L){function u(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;oN||d>N)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>N||d>N)&&(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||N>=g[0].length)){for(var b=0;br}}]),i})();w.exports=e}),(function(w,U,L){function u(){}u.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 Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,r=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(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 gt=n-2;gt>=J;gt--){var mt=u.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==J&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=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},w.exports=u}),(function(w,U,L){var u=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,v=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=v,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 U={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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];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 v in f)r[v]=f[v];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),v=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,N=i(551).DimensionD,b=i(551).Layout,A=i(551).Integer,S=i(551).IGeometry,V=i(551).LGraph,X=i(551).Transform,Z=i(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var _ in f)D[_]=f[_];D.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new v(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.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)},D.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},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.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 m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.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 m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});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},D.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()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),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,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var M=new Map,R=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)),B=O[tt],O[tt]=O[H],O[H]=B;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=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.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(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:B,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:H,gap:O.gap})}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.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=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;Q.has(H)?Q.get(H).push(B):Q.set(H,[B]),Q.has(B)?Q.get(B).push(H):Q.set(B,[H])}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.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 Y=function(H,B){var tt=[],ht=[],J=new Z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var gt=it;for(J.push(gt),It.add(gt),tt[Nt].push(gt);J.length!=0;){gt=J.shift(),B.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(J.push(At),It.add(At),tt[Nt].push(At))})}Nt++}}),{components:tt,isFixed:ht}},rt=Y(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=Y(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=n.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;RE&&(E=Math.floor(M.y)),I=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=V.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var M=0;M1;){var B=H[0];H.splice(0,1);var tt=z.indexOf(B);tt>=0&&z.splice(tt,1),$--,Y--}m!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(E-p)/Y,J=O;rt!=Y;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=m){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;pm&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var Q=m[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 Y=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,M)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,M=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,M,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;EQ&&(Q=Y.rect.height)}p+=Q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,M=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(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),M;return IR&&(R=$.getWidth())});var W=I/y,x=M/y,Q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,z=(E-p+Math.sqrt(Q))/(2*(W+E)),Y;m?(Y=Math.ceil(z),Y==z&&Y++):Y=Math.floor(z);var rt=Y*(W+E)-E;return R>rt&&(rt=R),rt+=E*2,rt},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function($,O){var H=W;return M.idealRowWidth?(H=I,H($.id,O.id)):H($,O)});for(var x=0,Q=0,z=0;z0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var M=n.rowWidth[I];if(M+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+R)/(M+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,R=0;RM&&(M=E[R].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)Y[0]+=this.grid[rt][M-1].length+this.grid[rt][M].length-1;if(I0)for(var rt=M;rt<=R;rt++)Y[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=A.MAX_VALUE,O,H,B=0;B{var f=i(551).FDLayoutNode,r=i(551).IMath;function v(s,o,c,l){f.call(this,s,o,c,l)}v.prototype=Object.create(f.prototype);for(var t in f)v[t]=f[t];v.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)},v.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){k=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?N[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){k=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?N[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}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(P){var k=0,K=0,q=0,at=0;if(P.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?k++:K++:N[g.get(j.top)]-N[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,P){E[P]=[F.position.x,F.position.y],y[P]=[d[g.get(F.nodeId)],N[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var P=l.alignmentConstraint.vertical,k=function(et){var j=new Set;P[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).x,P[et].forEach(function(pt){E[F]=[wt,N[g.get(pt)]],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},K=0;K0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).y,q[et].forEach(function(pt){E[F]=[d[g.get(pt)],wt],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,Y=rt);if(z0){var Et={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,P){var k={x:d[g.get(F.nodeId)],y:N[g.get(F.nodeId)]},K=F.position,q=X(K,k);Et.x+=q.x,Et.y+=q.y}),Et.x/=l.fixedNodeConstraint.length,Et.y/=l.fixedNodeConstraint.length,d.forEach(function(F,P){d[P]+=Et.x}),N.forEach(function(F,P){N[P]+=Et.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,N[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(P){var k=new Set;Dt[P].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=Z(k).x,k.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=N[g.get(K.values().next().value)]:q=Z(k).y,k.forEach(function(at){R.has(at)||(N[g.get(at)]=q)})},Ft=0;Ft{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,G){(function(U,L){C.exports=L(dr())})(vr,function(w){return(()=>{var U={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](),N;!(l=(N=d.next()).done)&&(c.push(N.value),!(o&&c.length===o));l=!0);}catch(b){T=!0,g=b}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,v={};v.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var M=0;M1){N=g[0],b=N.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),X},v.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,N=!1,b=void 0;try{for(var A=s.nodeIndexes[Symbol.iterator](),S;!(d=(S=A.next()).done);d=!0){var V=S.value,X=f(V,2),Z=X[0],D=X[1],_=o.cy.getElementById(Z);if(_){var n=_.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;ml&&(l=p),Eg&&(g=y)}}}catch(x){N=!0,b=x}finally{try{!d&&A.return&&A.return()}finally{if(N)throw b}}var I=t.x-(l+c)/2,M=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+M})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,Y=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=Y),rtg&&(g=$)});var R=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()+R,Q.getCenterY()+W)})}}},v.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,N=void 0,b=void 0,A=void 0,S=void 0,V=t.descendants().not(":parent"),X=V.length,Z=0;ZN&&(l=N),TA&&(g=A),d{var f=i(548),r=i(140).CoSELayout,v=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,N){var b=d.cy,A=d.eles,S=A.nodes(),V=A.edges(),X=void 0,Z=void 0,D=void 0,_={};d.randomize&&(X=N.nodeIndexes,Z=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(b,A),E=function W(x,Q,z,Y){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),B),W(J,H,z,Y)}}},y=function(x,Q,z){for(var Y=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/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 M=new r,R=M.newGraphManager();return E(R.addRoot(),f.getTopMostNodes(S),M,d),y(M,R,V),I(M,d),M.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(N,b){for(var A=0;A0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(S,A.eles,I),D.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,X.push(o(A))}),A.quality=="default"||A.quality=="proof"){var M=S.collection();if(A.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(z.nodeIndexes.set(vt.nodes()[mt].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),M.length>1){var rt=M.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),D.push(M),X.push(z);for(var $=Y.length-1;$>=0;$--)D.splice(Y[$],1),X.splice(Y[$],1),_.splice(Y[$],1)}}D.forEach(function(vt,it){A.eles=vt,Z.push(l(A,X[it])),t.relocateComponent(_[it],Z[it],A)})}else D.forEach(function(vt,it){t.relocateComponent(_[it],X[it],A)});var O=new Set;if(D.length>1){var H=[],B=V.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(A.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else Z[it][Ot.id()]&&mt.nodes.push({x:Z[it][Ot.id()].getLeft(),y:Z[it][Ot.id()].getTop(),width:Z[it][Ot.id()].getWidth(),height:Z[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else Z[it][Et.id()]&&Z[it][Dt.id()]&&mt.edges.push({startX:Z[it][Et.id()].getCenterX(),startY:Z[it][Et.id()].getCenterY(),endX:Z[it][Dt.id()].getCenterX(),endY:Z[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var tt=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+tt[it].dx}),mt=vt.yCoords.map(function(At){return At+tt[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(Z[vt]).forEach(function(it){var gt=Z[vt][it];gt.setCenter(gt.getCenterX()+tt[ht].dx,gt.getCenterY()+tt[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(_.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=o(A);X.push(y)}A.quality=="default"||A.quality=="proof"?(Z.push(l(A,X[0])),t.relocateComponent(_[0],Z[0],A)):t.relocateComponent(_[0],X[0],A)}var J=function(it,gt){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return Z.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(S,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});A.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,A,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,v=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,N=new Map,b=new Map,A=[],S=[],V=[],X=[],Z=[],D=[],_=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,M=o.nodeSeparation,R=void 0,W=function(){for(var P=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=A[nt],lt=0;ltut&&(ut=Z[Lt],wt=Lt)}return wt},Q=function(P){var k=void 0;if(P){k=Math.floor(Math.random()*m);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(k.isParent()?A[P].push(b.get(k.id())):A[P].push(k.id()))})});var Nt=function(P){var k=N.get(P),K=void 0;d.get(P).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,A[k].push(K),A[N.get(K)].push(P)})},vt=!0,it=!1,gt=void 0;try{for(var mt=d.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){it=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){R=m{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(579);return h})()})})(se)),se.exports}var yr=pr();const Er=Be(yr);var De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,G)=>C-G+2,"L"),R:dt((C,G)=>C-2,"R"),T:dt((C,G)=>C-G+2,"T"),B:dt((C,G)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),Wt=dt(function(C){const G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),me=dt(function(C,G){const w=Wt(C)&&qt(G),U=qt(C)&&Wt(G);return w||U},"isArchitectureDirectionXY"),Tr=dt(function(C){const G=C[0],w=C[1],U=Wt(G)&&qt(w),L=qt(G)&&Wt(w);return U||L},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,G){const w=`${C}${G}`;return Nr(w)?w:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,G],w){const U=w[0],L=w[1];return Wt(U)?qt(L)?[C+(U==="L"?-1:1),G+(L==="T"?1:-1)]:[C+(U==="L"?-1:1),G]:Wt(L)?[C+(L==="L"?1:-1),G+(U==="T"?1:-1)]:[C,G+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,G){return me(C,G)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(C){return C.type==="service"},"isArchitectureService"),Mr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=ir.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qe,this.getAccTitle=Qe,this.setDiagramTitle=Je,this.getDiagramTitle=Ke,this.getAccDescription=je,this.setAccDescription=_e,this.clear()}static{dt(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",tr()}addService({id:C,icon:G,in:w,title:U,iconText:L}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[w]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:G,iconText:L,title:U,edges:[],in:w}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:C,in:G}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[G]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:G}}getJunctions(){return Object.values(this.nodes).filter(Mr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:G,in:w,title:U}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[w]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[w]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:G,title:U,in:w}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:G,lhsDir:w,rhsDir:U,lhsInto:L,rhsInto:u,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(w))throw new Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(w)}`);if(!Ie(U))throw new Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[G]===void 0&&this.groups[G]===void 0)throw new Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes[C].in,f=this.nodes[G].in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${C}] 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 [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:C,lhsDir:w,lhsInto:L,lhsGroup:h,rhsId:G,rhsDir:U,rhsInto:u,rhsGroup:a,title:e};this.edges.push(r),this.nodes[C]&&this.nodes[G]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[G].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},G=Object.entries(this.nodes).reduce((a,[e,i])=>(a[e]=i.edges.reduce((f,r)=>{const v=this.getNode(r.lhsId)?.in,t=this.getNode(r.rhsId)?.in;if(v&&t&&v!==t){const s=Ar(r.lhsDir,r.rhsDir);s!=="bend"&&(C[v]??={},C[v][t]=s,C[t]??={},C[t][v]=s)}if(r.lhsId===e){const s=pe(r.lhsDir,r.rhsDir);s&&(f[s]=r.rhsId)}else{const s=pe(r.rhsDir,r.lhsDir);s&&(f[s]=r.lhsId)}return f},{}),a),{}),w=Object.keys(G)[0],U={[w]:1},L=Object.keys(G).reduce((a,e)=>e===w?a:{...a,[e]:1},{}),u=dt(a=>{const e={[a]:[0,0]},i=[a];for(;i.length>0;){const f=i.shift();if(f){U[f]=1,delete L[f];const r=G[f],[v,t]=e[f];Object.entries(r).forEach(([s,o])=>{U[o]||(e[o]=Lr([v,t],s),i.push(o))})}}return e},"BFS"),h=[u(w)];for(;Object.keys(L).length>0;)h.push(u(Object.keys(L)[0]));this.dataStructures={adjList:G,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements[C]=G}getElementById(C){return this.elements[C]}getConfig(){return er({...Or,...rr().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,G)=>{lr(C,G),C.groups.map(w=>G.addGroup(w)),C.services.map(w=>G.addService({...w,type:"service"})),C.junctions.map(w=>G.addJunction({...w,type:"junction"})),C.edges.map(w=>G.addEdge(w))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const G=await fr("architecture",C);Re.debug(G);const w=Pe.parser?.yy;if(!(w instanceof be))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.");Dr(G,w)},"parse")},xr=dt(C=>` + .edge { + stroke-width: ${C.archEdgeWidth}; + stroke: ${C.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${C.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${C.archGroupBorderColor}; + stroke-width: ${C.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),Ir=xr,re=dt(C=>`${C}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:hr,blank:{body:re("")}}},Rr=dt(async function(C,G,w,U){const L=w.getConfigField("padding"),u=w.getConfigField("iconSize"),h=u/2,a=u/6,e=a/2;await Promise.all(G.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:v,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Fe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:N,y:b}=i[0].midpoint();let{x:A,y:S}=i[0].targetEndpoint();const V=L+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?A+=o==="L"?-V:V:S+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&w.getNode(s)?.type==="junction"&&(Wt(o)?A+=o==="L"?h:-h:S+=o==="T"?h:-h),i[0]._private.rscratch){const X=C.insert("g");if(X.insert("path").attr("d",`M ${g},${d} L ${N},${b} L${A},${S} `).attr("class","edge").attr("id",`${U}-${or(f,s,{prefix:"L"})}`),v){const Z=Wt(r)?oe[r](g,a):g-e,D=qt(r)?oe[r](d,a):d-e;X.insert("polygon").attr("points",xe[r](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(c){const Z=Wt(o)?oe[o](A,a):A-e,D=qt(o)?oe[o](S,a):S-e;X.insert("polygon").attr("points",xe[o](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(T){const Z=me(r,o)?"XY":Wt(r)?"X":"Y";let D=0;Z==="X"?D=Math.abs(g-A):Z==="Y"?D=Math.abs(d-S)/1.5:D=Math.abs(g-A)/2;const _=X.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},ye()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Z==="X")_.attr("transform","translate("+N+", "+b+")");else if(Z==="Y")_.attr("transform","translate("+N+", "+b+") rotate(-90)");else if(Z==="XY"){const n=pe(r,o);if(n&&Tr(n)){const m=_.node().getBoundingClientRect(),[p,E]=Cr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*E*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",` + translate(${N}, ${b-m.height/2}) + translate(${p*y.width/2}, ${E*y.height/2}) + rotate(${-1*p*E*45}, 0, ${m.height/2}) + `)}}}}}))},"drawEdges"),Sr=dt(async function(C,G,w,U){const u=w.getConfigField("padding")*.75,h=w.getConfigField("fontSize"),e=w.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:v,x1:t,y1:s}=i.boundingBox(),o=C.append("rect");o.attr("id",`${U}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",v).attr("height",r).attr("class","node-bkg");const c=C.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:u,width:u,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=u,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ye()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Fr=dt(async function(C,G,w,U){const L=ye();for(const u of w){const h=G.append("g"),a=C.getConfigField("iconSize");if(u.title){const r=h.append("g");await Ee(r,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(u.icon)e.html(`${await ve(u.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(u.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ar(u.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${U}-node-${u.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${U}-service-${u.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();u.width=i,u.height=f,C.setElementForId(u.id,h)}return 0},"drawServices"),br=dt(function(C,G,w,U){w.forEach(L=>{const u=G.append("g"),h=C.getConfigField("iconSize");u.append("g").append("rect").attr("id",`${U}-node-${L.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),u.attr("class","architecture-junction");const{width:e,height:i}=u._groups[0][0].getBBox();u.width=e,u.height=i,C.setElementForId(L.id,u)})},"drawJunctions");sr([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,G){G.nodes().map(w=>{const U=ie(w);if(U.type==="group")return;U.x=w.position().x,U.y=w.position().y,C.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,G){C.forEach(w=>{G.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,G){C.forEach(w=>{const{lhsId:U,rhsId:L,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=w,v=me(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${U}-${L}`,label:r,source:U,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:t,classes:v})})}dt(He,"addEdges");function We(C,G,w){const U=dt((a,e)=>Object.entries(a).reduce((i,[f,r])=>{let v=0;const t=Object.entries(r);if(t.length===1)return i[f]=t[0][1],i;for(let s=0;s{const e={},i={};return Object.entries(a).forEach(([f,[r,v]])=>{const t=C.getNode(f)?.in??"default";e[v]??={},e[v][t]??=[],e[v][t].push(f),i[r]??={},i[r][t]??=[],i[r][t].push(f)}),{horiz:Object.values(U(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(U(i,"vertical")).filter(f=>f.length>1)}}),[u,h]=L.reduce(([a,e],{horiz:i,vert:f})=>[[...a,...i],[...e,...f]],[[],[]]);return{horizontal:u,vertical:h}}dt(We,"getAlignments");function Ve(C,G){const w=[],U=dt(u=>`${u[0]},${u[1]}`,"posToStr"),L=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([f,r])=>[U(r),f])),a=[U([0,0])],e={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const r=h[f];if(r){const v=L(f);Object.entries(i).forEach(([t,s])=>{const o=U([v[0]+s[0],v[1]+s[1]]),c=h[o];c&&!e[o]&&(a.push(o),w.push({[De[t]]:c,[De[mr(t)]]:r,gap:1.5*G.getConfigField("iconSize")}))})}}}}),w}dt(Ve,"getRelativeConstraints");function ze(C,G,w,U,L,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=nr("body").append("div").attr("id","cy").attr("style","display:none"),i=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(w,i),Ge(C,i,L),Ue(G,i,L),He(U,i);const f=We(L,u,h),r=Ve(u,L),v=L.getConfigField("iconSize"),t=L.getConfigField("idealEdgeLengthMultiplier")*v,s=.5*v,o=L.getConfigField("edgeElasticity"),c=i.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),nodeSeparation:L.getConfigField("nodeSeparation"),numIter:L.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?t:s},edgeElasticity(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?o:.001},alignmentConstraint:f,relativePlacementConstraint:r});c.one("layoutstop",()=>{function l(T,g,d,N){let b,A;const{x:S,y:V}=T,{x:X,y:Z}=g;A=(N-V+(S-d)*(V-Z)/(S-X))/Math.sqrt(1+Math.pow((V-Z)/(S-X),2)),b=Math.sqrt(Math.pow(N-V,2)+Math.pow(d-S,2)-Math.pow(A,2));const D=Math.sqrt(Math.pow(X-S,2)+Math.pow(Z-V,2));b=b/D;let _=(X-S)*(N-V)-(Z-V)*(d-S);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let n=(X-S)*(d-S)+(Z-V)*(N-V);switch(!0){case n>=0:n=1;break;case n<0:n=-1;break}return A=Math.abs(A)*_,b=b*n,{distances:A,weights:b}}dt(l,"getSegmentWeights"),i.startBatch();for(const T of Object.values(i.edges()))if(T.data?.()){const{x:g,y:d}=T.source().position(),{x:N,y:b}=T.target().position();if(g!==N&&d!==b){const A=T.sourceEndpoint(),S=T.targetEndpoint(),{sourceDir:V}=Fe(T),[X,Z]=qt(V)?[A.x,S.y]:[S.x,A.y],{weights:D,distances:_}=l(A,S,X,Z);T.style("segment-distances",_),T.style("segment-weights",D)}}i.endBatch(),c.run()}),c.run(),i.ready(l=>{Re.info("Ready",l),a(i)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,G,w,U)=>{const L=U.db;L.setDiagramId(G);const u=L.getServices(),h=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),i=L.getDataStructures(),f=ke(G),r=f.append("g");r.attr("class","architecture-edges");const v=f.append("g");v.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Fr(L,v,u,G),br(L,v,h,G);const s=await ze(u,h,a,e,L,i);await Rr(r,s,L,G),await Sr(t,s,L,G),Ye(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},Vr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{Vr as diagram}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js b/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js new file mode 100644 index 0000000000..d1478cb650 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js @@ -0,0 +1,132 @@ +import{g as pe}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{an as fe,ao as Ut,ap as xe,aq as ye,ar as be,as as we,at as me,au as Se,av as Le,aw as ke,ax as ve,ay as Ee,az as _e,aA as Te,aB as De,aC as Be,aD as Ne,aE as Ie,aF as Ce,aG as Oe,aH as Re,aI as Ae,aJ as ze,aK as Me,aL as Pe,_ as d,D as at,d as D,e as Fe,l as k,z as We,B as Ye,aM as He,R as Ke,S as Ue,c as A,O as Xe,aN as P,aO as vt,aP as $,aQ as Ve,u as tt,k as je,aR as Ge,i as Ot,aS as Rt,aT as Ze}from"./mermaidParser.worker-Dx4jPi9z.js";import{G as qe}from"./graph-BwjfAU3j.js";import{c as Je}from"./channel-DNkUo9e6.js";function Qe(e){return Array.isArray(e)}function $e(e){if(fe(e))return e;const t=Ut(e);if(!tr(e))return{};if(Qe(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(xe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?rr(i,e):yt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return yt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ar(a,e),yt(a,e),er(a,e),a}function tr(e){switch(Ut(e)){case Pe:case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:return!0;default:return!1}}function yt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function er(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function ar(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=(function(){var e=d(function(T,m,u,y){for(u=u||{},y=T.length;y--;u[T[y]]=m);return u},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],o=[8,10,21,28,29,30,31,39,43,46],p=[1,23],b=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:d(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:d(function(m,u,y,L,E,h,W){var f=h.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[f-1]),L.setHierarchy(h[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[f]),typeof h[f].length=="number"?this.$=h[f]:this.$=[h[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[f-1]),this.$=[h[f-1]].concat(h[f]);break;case 14:L.getLogger().debug("Rule: link: ",h[f],m),this.$={edgeTypeStr:h[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[f-3],h[f-1],h[f]),this.$={edgeTypeStr:h[f],label:h[f-1]};break;case 18:const O=parseInt(h[f]),q=L.generateId();this.$={id:q,type:"space",label:"",width:O,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[f-2],h[f-1],h[f]," typestr: ",h[f-1].edgeTypeStr);const j=L.edgeStrToEdgeData(h[f-1].edgeTypeStr),st=L.edgeStrToEdgeStartData(h[f-1].edgeTypeStr),dt=L.edgeStrToThickness(h[f-1].edgeTypeStr),R=L.edgeStrToPattern(h[f-1].edgeTypeStr);this.$=[{id:h[f-2].id,label:h[f-2].label,type:h[f-2].type,directions:h[f-2].directions},{id:h[f-2].id+"-"+h[f].id,start:h[f-2].id,end:h[f].id,label:h[f-1].label,type:"edge",thickness:dt,pattern:R,directions:h[f].directions,arrowTypeEnd:j,arrowTypeStart:st},{id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[f-1],h[f]),this.$={id:h[f-1].id,label:h[f-1].label,type:L.typeStr2Type(h[f-1].typeStr),directions:h[f-1].directions,widthInColumns:parseInt(h[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[f]),this.$={id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[f]),this.$={type:"column-setting",columns:h[f]==="auto"?-1:parseInt(h[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[f-2],h[f-1]),L.generateId(),this.$={...h[f-2],type:"composite",children:h[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[f-2],h[f-1],h[f]);const G=L.generateId();this.$={id:G,type:"composite",label:"",children:h[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[f]),this.$={id:h[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[f-1],h[f]),this.$={id:h[f-1],label:h[f].label,typeStr:h[f].typeStr,directions:h[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[f]),this.$=[h[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[f-1],h[f]),this.$=[h[f-1]].concat(h[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[f-2],h[f-1],h[f]),this.$={typeStr:h[f-2]+h[f],label:h[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[f-3],h[f-2]," #3:",h[f-1],h[f]),this.$={typeStr:h[f-3]+h[f],label:h[f-2],directions:h[f-1]};break;case 35:case 36:this.$={type:"classDef",id:h[f-1].trim(),css:h[f].trim()};break;case 37:this.$={type:"applyClass",id:h[f-1].trim(),styleClass:h[f].trim()};break;case 38:this.$={type:"applyStyles",id:h[f-1].trim(),stylesStr:h[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(o,[2,16],{14:22,15:p,16:b}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(x,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(m,u){if(u.recoverable)this.trace(m);else{var y=new Error(m);throw y.hash=u,y}},"parseError"),parse:d(function(m){var u=this,y=[0],L=[],E=[null],h=[],W=this.table,f="",O=0,q=0,j=2,st=1,dt=h.slice.call(arguments,1),R=Object.create(this.lexer),G={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(G.yy[ut]=this.yy[ut]);R.setInput(m,G.yy),G.yy.lexer=R,G.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var pt=R.yylloc;h.push(pt);var de=R.options&&R.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(Y){y.length=y.length-2*Y,E.length=E.length-Y,h.length=h.length-Y}d(ue,"popStack");function It(){var Y;return Y=L.pop()||R.lex()||st,typeof Y!="number"&&(Y instanceof Array&&(L=Y,Y=L.pop()),Y=u.symbols_[Y]||Y),Y}d(It,"lex");for(var F,J,K,ft,Q={},it,Z,Ct,nt;;){if(J=y[y.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=It()),K=W[J]&&W[J][F]),typeof K>"u"||!K.length||!K[0]){var xt="";nt=[];for(it in W[J])this.terminals_[it]&&it>j&&nt.push("'"+this.terminals_[it]+"'");R.showPosition?xt="Parse error on line "+(O+1)+`: +`+R.showPosition()+` +Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xt="Parse error on line "+(O+1)+": Unexpected "+(F==st?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xt,{text:R.match,token:this.terminals_[F]||F,line:R.yylineno,loc:pt,expected:nt})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(K[0]){case 1:y.push(F),E.push(R.yytext),h.push(R.yylloc),y.push(K[1]),F=null,q=R.yyleng,f=R.yytext,O=R.yylineno,pt=R.yylloc;break;case 2:if(Z=this.productions_[K[1]][1],Q.$=E[E.length-Z],Q._$={first_line:h[h.length-(Z||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(Z||1)].first_column,last_column:h[h.length-1].last_column},de&&(Q._$.range=[h[h.length-(Z||1)].range[0],h[h.length-1].range[1]]),ft=this.performAction.apply(Q,[f,q,O,G.yy,K[1],E,h].concat(dt)),typeof ft<"u")return ft;Z&&(y=y.slice(0,-1*Z*2),E=E.slice(0,-1*Z),h=h.slice(0,-1*Z)),y.push(this.productions_[K[1]][0]),E.push(Q.$),h.push(Q._$),Ct=W[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},_=(function(){var T={EOF:1,parseError:d(function(u,y){if(this.yy.parser)this.yy.parser.parseError(u,y);else throw new Error(u)},"parseError"),setInput:d(function(m,u){return this.yy=u||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 u=m.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),m},"input"),unput:d(function(m){var u=m.length,y=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;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),y.length-1&&(this.yylineno-=y.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:y?(y.length===L.length?this.yylloc.first_column:0)+L[L.length-y.length].length-y[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: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(),u=new Array(m.length+1).join("-");return m+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:d(function(m,u){var y,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],y=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,u,y,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hu[0].length)){if(u=y,L=h,this.options.backtrack_lexer){if(m=this.test_match(y,E[h]),m!==!1)return m;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(m=this.test_match(u,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var u=this.next();return u||this.lex()},"lex"),begin:d(function(u){this.conditionStack.push(u)},"begin"),popState:d(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:d(function(u){this.begin(u)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(u,y,L,E){switch(L){case 0:return u.getLogger().debug("Found block-beta"),10;case 1:return u.getLogger().debug("Found id-block"),29;case 2:return u.getLogger().debug("Found block"),10;case 3:u.getLogger().debug(".",y.yytext);break;case 4:u.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),u.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:u.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return u.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),u.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",u.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),u.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),u.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),u.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),u.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),u.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),u.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),u.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),u.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),u.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),u.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return u.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return u.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return u.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return u.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return u.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return u.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return u.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),u.getLogger().debug("LEX ARR START"),37;case 74:return u.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return u.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:u.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:u.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return u.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:u.getLogger().debug("LEX POPPING"),this.popState();break;case 84:u.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",u.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return u.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return u.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=_;function I(){this.yy={}}return d(I,"Parser"),I.prototype=S,S.Parser=I,new I})();wt.parser=wt;var sr=wt,X=new Map,Et=[],mt=new Map,At="color",zt="fill",ir="bgFill",Xt=",",nr=A(),lt=new Map,_t="",cr=d(e=>je.sanitizeText(e,nr),"sanitizeText"),lr=d(function(e,t=""){let a=lt.get(e);a||(a={id:e,styles:[],textStyles:[]},lt.set(e,a)),t?.split(Xt).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(At).exec(s)){const r=i.replace(zt,ir).replace(At,zt);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),or=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Xt))},"addStyle2Node"),hr=d(function(e,t){e.split(",").forEach(function(a){let s=X.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},X.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Vt=d((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=cr(r.label)),r.type==="classDef"){lr(r.id,r.css);continue}if(r.type==="applyClass"){hr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&or(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Vt(r.children,r),r.type==="space"){const l=r.width??1;for(let g=0;g{k.debug("Clear called"),We(),rt={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",rt]]),Tt=[],lt=new Map,Et=[],mt=new Map,_t=""},"clear");function jt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(jt,"typeStr2Type");function Gt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}d(Gt,"edgeTypeStr2Type");function Zt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Zt,"edgeStrToEdgeData");function qt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}d(qt,"edgeStrToEdgeStartData");function Jt(e){return e.includes("==")?"thick":"normal"}d(Jt,"edgeStrToThickness");function Qt(e){return e.includes(".-")?"dotted":"solid"}d(Qt,"edgeStrToPattern");var Mt=0,dr=d(()=>(Mt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mt),"generateId"),ur=d(e=>{rt.children=e,Vt(e,rt),Tt=rt.children},"setHierarchy"),pr=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),fr=d(()=>[...X.values()],"getBlocksFlat"),xr=d(()=>Tt||[],"getBlocks"),yr=d(()=>Et,"getEdges"),br=d(e=>X.get(e),"getBlock"),wr=d(e=>{X.set(e.id,e)},"setBlock"),mr=d(e=>{_t=e},"setDiagramId"),Sr=d(()=>_t,"getDiagramId"),Lr=d(()=>k,"getLogger"),kr=d(function(){return lt},"getClasses"),vr={getConfig:d(()=>at().block,"getConfig"),typeStr2Type:jt,edgeTypeStr2Type:Gt,edgeStrToEdgeData:Zt,edgeStrToEdgeStartData:qt,edgeStrToThickness:Jt,edgeStrToPattern:Qt,getLogger:Lr,getBlocksFlat:fr,getBlocks:xr,getEdges:yr,setHierarchy:ur,getBlock:br,setBlock:wr,getColumns:pr,getClasses:kr,clear:gr,generateId:dr,setDiagramId:mr,getDiagramId:Sr},Er=vr,bt=d((e,t)=>{const a=Je,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return Ye(s,i,c,t)},"fade"),_r=d(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${bt(e.mainBkg,.5)}; + fill: ${bt(e.clusterBkg,.5)}; + stroke: ${bt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${pe()} +`,"getStyles"),Tr=_r,Dr=d((e,t,a,s)=>{t.forEach(i=>{Pr[i](e,a,s)})},"insertMarkers"),Br=d((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Nr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ir=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Cr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Or=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Rr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Ar=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),zr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Mr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pr={extension:Br,composition:Nr,aggregation:Ir,dependency:Cr,lollipop:Or,point:Rr,circle:Ar,cross:zr,barb:Mr},Fr=Dr,C=A()?.block?.padding??8;function St(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}d(St,"calculateBlockPosition");var Wr=d(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,s=0){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let i=0,c=0;if(e.children?.length>0){for(const x of e.children)ot(x,t);const r=Wr(e);i=r.width,c=r.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,c);for(const x of e.children)x.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${x.id} ${i} ${c} ${JSON.stringify(x.size)}`),x.size.width=i*(x.widthInColumns??1)+C*((x.widthInColumns??1)-1),x.size.height=c,x.size.x=0,x.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${x.id} maxWidth:${i} maxHeight:${c}`));for(const x of e.children)ot(x,t,i,c);const n=e.columns??-1;let l=0;for(const x of e.children)l+=x.widthInColumns??1;let g=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(x>0){const w=(p-x*C-C)/x;k.debug("abc95 (growing to fit) width",e.id,p,e.size?.width,w);for(const v of e.children)v.size&&(v.size.width=w)}}e.size={width:p,height:b,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Dt(e,t){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const s=e?.children[0]?.size?.width??0,i=e.children.length*s+(e.children.length-1)*C;k.debug("widthOfChildren 88",i,"posX");const c=new Map;{let o=0;for(const p of e.children){if(!p.size)continue;const{py:b}=St(a,o),x=c.get(b)??0;p.size.height>x&&c.set(b,p.size.height);let w=p?.widthInColumns??1;a>0&&(w=Math.min(w,a-o%a)),o+=w}}const r=new Map;{let o=0;const p=[...c.keys()].sort((b,x)=>b-x);for(const b of p)r.set(b,o),o+=(c.get(b)??0)+C}let n=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,g=0;for(const o of e.children){const p=e;if(!o.size)continue;const{width:b,height:x}=o.size,{px:w,py:v}=St(a,n);if(v!=g&&(g=v,l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,k.debug("New row in layout for block",e.id," and child ",o.id,g)),k.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${n} (px, py) ${w},${v} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${b}${C}`),p.size){const _=b/2;o.size.x=l+C+_,k.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${l} new startingPosX${o.size.x} ${_} padding=${C} width=${b} halfWidth=${_} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${b*(o?.widthInColumns??1)/2}`),l=o.size.x+_;const I=r.get(v)??0,T=c.get(v)??x;o.size.y=p.size.y-p.size.height/2+I+T/2+C,k.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${l}${C}${_}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${b*(o?.widthInColumns??1)/2}`)}o.children&&Dt(o);let S=o?.widthInColumns??1;a>0&&(S=Math.min(S,a-n%a)),n+=S,k.debug("abc88 columnsPos",o,n)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Dt,"layoutBlocks");function Bt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Bt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}d(Bt,"findBounds");function $t(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Dt(t),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:s,maxX:i,maxY:c}=Bt(t),r=c-s,n=i-a;return{x:a,y:s,width:n,height:r}}d($t,"layout");var Yr=d(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=A(),n=P(r);return await vt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),U=Yr,Hr=d((e,t,a,s,i)=>{t.arrowTypeStart&&Pt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Pt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Kr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Pt=d((e,t,a,s,i,c)=>{const r=Kr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},Ur=d(async(e,t)=>{const a=A(),s=P(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await vt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),g=l;if(s){const p=n.children[0],b=D(n);l=p.getBoundingClientRect(),g=l,b.attr("width",l.width),b.attr("height",l.height)}else{const p=D(n).select("text").node();p&&typeof p.getBBox=="function"&&(g=p.getBBox())}c.attr("transform",$(g,s)),Lt[t.id]=i,t.width=l.width,t.height=l.height;let o;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=p,et(o,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startRight=p,et(o,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=p,et(o,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endRight=p,et(o,t.endLabelRight)}return n},"insertEdgeLabel");function et(e,t){P(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(et,"setTerminalWidth");var Xr=d((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=A(),{subGraphTitleTotalMargin:i}=Ve(s);if(e.label){const c=Lt[e.id];let r=e.x,n=e.y;if(a){const l=tt.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=M[e.id].startRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=M[e.id].endRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Vr=d((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),jr=d((e,t,a)=>{k.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let p=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Vr(t,c)&&!i){const r=jr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Gr=d(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const g=c.node(t.v);var o=c.node(t.w);o?.intersect&&g?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Ft(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Ft(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const p=n.filter(m=>!Number.isNaN(m.y));let b=Ue;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x,y:w}=He(a),v=Ke().x(x).y(w).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const _=e.append("path").attr("d",v(p)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let I="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(I=Xe(!0)),Hr(_,a,I,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),Zr=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),qr=d((e,t,a,s)=>{const i=Zr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,g=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*g},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*g,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*g},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*g,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-g},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r+g}]:i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:[{x:0,y:0}]},"getArrowPoints");function te(e,t){return e.intersect(t)}d(te,"intersectNode");var Jr=te;function ee(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),g=Math.abs(t*a*r/l);s.x0}d(kt,"sameSign");var $r=se,ta=ie;function ie(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,g=i-e.height/2-n,o=0;o1&&c.sort(function(w,v){var S=w.x-a.x,_=w.y-a.y,I=Math.sqrt(S*S+_*_),T=v.x-a.x,m=v.y-a.y,u=Math.sqrt(T*T+m*m);return I{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,g;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,g=n):(i<0&&(r=-r),l=r,g=i===0?0:r*c/i),{x:a+l,y:s+g}},"intersectRect"),ra=ea,B={node:Jr,circle:Qr,ellipse:re,polygon:ta,rect:ra},z=d(async(e,t,a,s)=>{const i=A();let c;const r=t.useHtmlLabels||P(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o;t.labelType==="markdown"?o=vt(l,Ot(Rt(g),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):o=await U(l,Ot(Rt(g),i),t.labelStyle,!1,s);let p=o.getBBox();const b=t.padding/2;if(P(i)){const x=o.children[0],w=D(o);await Ze(x,g),p=x.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):l.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:b,label:l}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function V(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(V,"insertPolygonShape");var aa=d(async(e,t)=>{t.useHtmlLabels||P(A())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await z(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),N(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),sa=aa,Wt=d(e=>e?" "+e:"","formatClass"),H=d((e,t)=>`${t||"node default"}${Wt(e.classes)} ${Wt(e.class)}`,"getClassesFromNode"),Yt=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=V(a,r,r,n);return l.attr("style",t.style),N(t,l),t.intersect=function(g){return k.warn("Intersect called"),B.polygon(t,n,g)},a},"question"),ia=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),na=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],g=V(a,n,c,l);return g.attr("style",t.style),N(t,g),t.intersect=function(o){return B.polygon(t,l,o)},a},"hexagon"),ca=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,g=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,o=qr(t.directions,s,t,g),p=V(a,g,c,o);return p.attr("style",t.style),N(t,p),t.intersect=function(b){return B.polygon(t,o,b)},a},"block_arrow"),la=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return V(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),oa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),ha=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),ga=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),da=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ua=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),pa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,g=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return N(t,g),t.intersect=function(o){const p=B.rect(t,o),b=p.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let x=r*r*(1-b*b/(c*c));x!=0&&(x=Math.sqrt(x)),x=r-x,o.y-t.y>0&&(x=-x),p.y+=x}return p},a},"cylinder"),fa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"rect"),xa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"composite"),ya=d(async(e,t)=>{const{shapeSvg:a}=await z(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return N(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ht(e,t,a,s){const i=[],c=d(n=>{i.push(n,0)},"addBorder"),r=d(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}d(ht,"applyNodePropertyBorders");var ba=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const g=await U(r,l,t.labelStyle,!0,!0);let o={width:0,height:0};if(P(A())){const v=g.children[0],S=D(g);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}k.info("Text 2",n);const p=n.slice(1,n.length);let b=g.getBBox();const x=await U(r,p.join?p.join("
"):p,t.labelStyle,!0,!0);if(P(A())){const v=x.children[0],S=D(x);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}const w=t.padding/2;return D(x).attr("transform","translate( "+(o.width>b.width?0:(b.width-o.width)/2)+", "+(b.height+w+5)+")"),D(g).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return N(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ma=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),N(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),Sa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),N(t,n),t.intersect=function(g){return k.info("DoubleCircle intersect",t,s.width/2+i+c,g),B.circle(t,s.width/2+i+c,g)},a},"doublecircle"),La=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),ka=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Ht=d((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),va=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),Ea=d(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),g=r.insert("line");let o=0,p=s;const b=r.insert("g").attr("class","label");let x=0;const w=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await U(b,v,t.labelStyle,!0,!0);let _=S.getBBox();if(P(A())){const E=S.children[0],h=D(S);_=E.getBoundingClientRect(),h.attr("width",_.width),h.attr("height",_.height)}t.classData.annotations[0]&&(p+=_.height+s,o+=_.width);let I=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(P(A())?I+="<"+t.classData.type+">":I+="<"+t.classData.type+">");const T=await U(b,I,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(P(A())){const E=T.children[0],h=D(T);m=E.getBoundingClientRect(),h.attr("width",m.width),h.attr("height",m.height)}p+=m.height+s,m.width>o&&(o=m.width);const u=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,u.push(f)}),p+=i;const y=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,y.push(f)}),p+=i,w){let E=(o-_.width)/2;D(S).attr("transform","translate( "+(-1*o/2+E)+", "+-1*p/2+")"),x=_.height+s}let L=(o-m.width)/2;return D(T).attr("transform","translate( "+(-1*o/2+L)+", "+(-1*p/2+x)+")"),x+=m.height+s,l.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,u.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x+i/2)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),x+=i,g.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,y.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(p/2)-a).attr("width",o+t.padding).attr("height",p+t.padding),N(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Kt={rhombus:Yt,composite:xa,question:Yt,rect:fa,labelRect:ya,rectWithTitle:ba,choice:ia,circle:ma,doublecircle:Sa,stadium:wa,hexagon:na,block_arrow:ca,rect_left_inv_arrow:la,lean_right:oa,lean_left:ha,trapezoid:ga,inv_trapezoid:da,rect_right_inv_arrow:ua,cylinder:pa,start:ka,end:va,note:sa,subroutine:La,fork:Ht,join:Ht,class_box:Ea},ct={},ne=d(async(e,t,a)=>{let s,i;if(t.link){let c;A().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Kt[t.shape](s,t,a)}else i=await Kt[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ct[t.id]=s,t.haveCallback&&ct[t.id].attr("class",ct[t.id].attr("class")+" clickable"),s},"insertNode"),_a=d(e=>{const t=ct[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Nt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=Ge(s?.styles??[]),g=s.label,o=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:g,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:s.type,padding:n??at()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}d(Nt,"getNodeFromBlock");async function ce(e,t,a){const s=Nt(t,a,!1);if(s.type==="group")return;const i=at(),c=await ne(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}d(ce,"calculateBlockSize");async function le(e,t,a){const s=Nt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=at();await ne(e,s,{config:c}),t.intersect=s?.intersect,_a(s)}}d(le,"insertBlockPositioned");async function gt(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await gt(e,i.children,a,s)}d(gt,"performOperations");async function oe(e,t,a){await gt(e,t,a,ce)}d(oe,"calculateBlockSizes");async function he(e,t,a){await gt(e,t,a,le)}d(he,"insertBlocks");async function ge(e,t,a,s,i){const c=new qe({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const g=n.size,o=l.size,p=[{x:g.x,y:g.y},{x:g.x+(o.x-g.x)/2,y:g.y+(o.y-g.y)/2},{x:o.x,y:o.y}],b=i?`${i}-${r.id}`:r.id,x=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",w=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${x} ${w} flowchart-link LS-a1 LE-b1`;Gr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v},void 0,"block",c,i),r.label&&(await Ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v}),Xr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}d(ge,"insertEdges");var Ta=d(function(e,t){return t.db.getClasses()},"getClasses"),Da=d(async function(e,t,a,s){const{securityLevel:i,block:c}=at(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),g=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Fr(g,["point","circle","cross"],s.type,t);const p=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),w=g.insert("g").attr("class","block");await oe(w,p,r);const v=$t(r);if(await he(w,p,r),await ge(w,x,b,r,t),v){const S=v,_=Math.max(1,Math.round(.125*(S.width/S.height))),I=S.height+_+10,T=S.width+10,{useMaxWidth:m}=c;Fe(g,I,T,!!m),k.debug("Here Bounds",v,S),g.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ba={draw:Da,getClasses:Ta},Ra={parser:sr,db:Er,renderer:Ba,styles:Tr};export{Ra as diagram}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CilEmNW0.js b/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CilEmNW0.js new file mode 100644 index 0000000000..a66a7f77e6 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/blockDiagram-GPEHLZMM-CilEmNW0.js @@ -0,0 +1,132 @@ +import{g as pe}from"./chunk-FMBD7UC4-_3v8zWlF.js";import{an as fe,ao as Ut,ap as xe,aq as ye,ar as be,as as we,at as me,au as Se,av as Le,aw as ke,ax as ve,ay as Ee,az as _e,aA as Te,aB as De,aC as Be,aD as Ne,aE as Ie,aF as Ce,aG as Oe,aH as Re,aI as Ae,aJ as ze,aK as Me,aL as Pe,_ as d,D as at,d as D,e as Fe,l as k,z as We,B as Ye,aM as He,a9 as Ke,aa as Ue,c as A,O as Xe,aN as P,aO as vt,aP as $,aQ as Ve,u as tt,k as je,aR as Ge,i as Ot,aS as Rt,aT as Ze}from"./mermaid.core-zKrc8Ye9.js";import{G as qe}from"./graph--OzhPTMs.js";import{c as Je}from"./channel-Bt325_7a.js";import"./index-DtRfJ0vw.js";function Qe(e){return Array.isArray(e)}function $e(e){if(fe(e))return e;const t=Ut(e);if(!tr(e))return{};if(Qe(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(xe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?rr(i,e):yt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return yt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ar(a,e),yt(a,e),er(a,e),a}function tr(e){switch(Ut(e)){case Pe:case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:return!0;default:return!1}}function yt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function er(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function ar(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=(function(){var e=d(function(T,m,u,y){for(u=u||{},y=T.length;y--;u[T[y]]=m);return u},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],o=[8,10,21,28,29,30,31,39,43,46],p=[1,23],b=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:d(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:d(function(m,u,y,L,E,h,W){var f=h.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[f-1]),L.setHierarchy(h[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[f]),typeof h[f].length=="number"?this.$=h[f]:this.$=[h[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[f-1]),this.$=[h[f-1]].concat(h[f]);break;case 14:L.getLogger().debug("Rule: link: ",h[f],m),this.$={edgeTypeStr:h[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[f-3],h[f-1],h[f]),this.$={edgeTypeStr:h[f],label:h[f-1]};break;case 18:const O=parseInt(h[f]),q=L.generateId();this.$={id:q,type:"space",label:"",width:O,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[f-2],h[f-1],h[f]," typestr: ",h[f-1].edgeTypeStr);const j=L.edgeStrToEdgeData(h[f-1].edgeTypeStr),st=L.edgeStrToEdgeStartData(h[f-1].edgeTypeStr),dt=L.edgeStrToThickness(h[f-1].edgeTypeStr),R=L.edgeStrToPattern(h[f-1].edgeTypeStr);this.$=[{id:h[f-2].id,label:h[f-2].label,type:h[f-2].type,directions:h[f-2].directions},{id:h[f-2].id+"-"+h[f].id,start:h[f-2].id,end:h[f].id,label:h[f-1].label,type:"edge",thickness:dt,pattern:R,directions:h[f].directions,arrowTypeEnd:j,arrowTypeStart:st},{id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[f-1],h[f]),this.$={id:h[f-1].id,label:h[f-1].label,type:L.typeStr2Type(h[f-1].typeStr),directions:h[f-1].directions,widthInColumns:parseInt(h[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[f]),this.$={id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[f]),this.$={type:"column-setting",columns:h[f]==="auto"?-1:parseInt(h[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[f-2],h[f-1]),L.generateId(),this.$={...h[f-2],type:"composite",children:h[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[f-2],h[f-1],h[f]);const G=L.generateId();this.$={id:G,type:"composite",label:"",children:h[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[f]),this.$={id:h[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[f-1],h[f]),this.$={id:h[f-1],label:h[f].label,typeStr:h[f].typeStr,directions:h[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[f]),this.$=[h[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[f-1],h[f]),this.$=[h[f-1]].concat(h[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[f-2],h[f-1],h[f]),this.$={typeStr:h[f-2]+h[f],label:h[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[f-3],h[f-2]," #3:",h[f-1],h[f]),this.$={typeStr:h[f-3]+h[f],label:h[f-2],directions:h[f-1]};break;case 35:case 36:this.$={type:"classDef",id:h[f-1].trim(),css:h[f].trim()};break;case 37:this.$={type:"applyClass",id:h[f-1].trim(),styleClass:h[f].trim()};break;case 38:this.$={type:"applyStyles",id:h[f-1].trim(),stylesStr:h[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(o,[2,16],{14:22,15:p,16:b}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(x,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(m,u){if(u.recoverable)this.trace(m);else{var y=new Error(m);throw y.hash=u,y}},"parseError"),parse:d(function(m){var u=this,y=[0],L=[],E=[null],h=[],W=this.table,f="",O=0,q=0,j=2,st=1,dt=h.slice.call(arguments,1),R=Object.create(this.lexer),G={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(G.yy[ut]=this.yy[ut]);R.setInput(m,G.yy),G.yy.lexer=R,G.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var pt=R.yylloc;h.push(pt);var de=R.options&&R.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(Y){y.length=y.length-2*Y,E.length=E.length-Y,h.length=h.length-Y}d(ue,"popStack");function It(){var Y;return Y=L.pop()||R.lex()||st,typeof Y!="number"&&(Y instanceof Array&&(L=Y,Y=L.pop()),Y=u.symbols_[Y]||Y),Y}d(It,"lex");for(var F,J,K,ft,Q={},it,Z,Ct,nt;;){if(J=y[y.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=It()),K=W[J]&&W[J][F]),typeof K>"u"||!K.length||!K[0]){var xt="";nt=[];for(it in W[J])this.terminals_[it]&&it>j&&nt.push("'"+this.terminals_[it]+"'");R.showPosition?xt="Parse error on line "+(O+1)+`: +`+R.showPosition()+` +Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xt="Parse error on line "+(O+1)+": Unexpected "+(F==st?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xt,{text:R.match,token:this.terminals_[F]||F,line:R.yylineno,loc:pt,expected:nt})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(K[0]){case 1:y.push(F),E.push(R.yytext),h.push(R.yylloc),y.push(K[1]),F=null,q=R.yyleng,f=R.yytext,O=R.yylineno,pt=R.yylloc;break;case 2:if(Z=this.productions_[K[1]][1],Q.$=E[E.length-Z],Q._$={first_line:h[h.length-(Z||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(Z||1)].first_column,last_column:h[h.length-1].last_column},de&&(Q._$.range=[h[h.length-(Z||1)].range[0],h[h.length-1].range[1]]),ft=this.performAction.apply(Q,[f,q,O,G.yy,K[1],E,h].concat(dt)),typeof ft<"u")return ft;Z&&(y=y.slice(0,-1*Z*2),E=E.slice(0,-1*Z),h=h.slice(0,-1*Z)),y.push(this.productions_[K[1]][0]),E.push(Q.$),h.push(Q._$),Ct=W[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},_=(function(){var T={EOF:1,parseError:d(function(u,y){if(this.yy.parser)this.yy.parser.parseError(u,y);else throw new Error(u)},"parseError"),setInput:d(function(m,u){return this.yy=u||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 u=m.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),m},"input"),unput:d(function(m){var u=m.length,y=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;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),y.length-1&&(this.yylineno-=y.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:y?(y.length===L.length?this.yylloc.first_column:0)+L[L.length-y.length].length-y[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: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(),u=new Array(m.length+1).join("-");return m+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:d(function(m,u){var y,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],y=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,u,y,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hu[0].length)){if(u=y,L=h,this.options.backtrack_lexer){if(m=this.test_match(y,E[h]),m!==!1)return m;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(m=this.test_match(u,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var u=this.next();return u||this.lex()},"lex"),begin:d(function(u){this.conditionStack.push(u)},"begin"),popState:d(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:d(function(u){this.begin(u)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(u,y,L,E){switch(L){case 0:return u.getLogger().debug("Found block-beta"),10;case 1:return u.getLogger().debug("Found id-block"),29;case 2:return u.getLogger().debug("Found block"),10;case 3:u.getLogger().debug(".",y.yytext);break;case 4:u.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),u.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:u.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return u.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),u.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",u.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),u.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),u.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),u.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),u.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),u.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),u.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),u.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),u.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),u.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),u.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return u.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return u.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return u.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return u.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return u.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return u.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return u.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),u.getLogger().debug("LEX ARR START"),37;case 74:return u.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return u.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:u.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:u.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return u.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:u.getLogger().debug("LEX POPPING"),this.popState();break;case 84:u.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",u.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return u.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return u.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=_;function I(){this.yy={}}return d(I,"Parser"),I.prototype=S,S.Parser=I,new I})();wt.parser=wt;var sr=wt,X=new Map,Et=[],mt=new Map,At="color",zt="fill",ir="bgFill",Xt=",",nr=A(),lt=new Map,_t="",cr=d(e=>je.sanitizeText(e,nr),"sanitizeText"),lr=d(function(e,t=""){let a=lt.get(e);a||(a={id:e,styles:[],textStyles:[]},lt.set(e,a)),t?.split(Xt).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(At).exec(s)){const r=i.replace(zt,ir).replace(At,zt);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),or=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Xt))},"addStyle2Node"),hr=d(function(e,t){e.split(",").forEach(function(a){let s=X.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},X.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Vt=d((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=cr(r.label)),r.type==="classDef"){lr(r.id,r.css);continue}if(r.type==="applyClass"){hr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&or(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Vt(r.children,r),r.type==="space"){const l=r.width??1;for(let g=0;g{k.debug("Clear called"),We(),rt={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",rt]]),Tt=[],lt=new Map,Et=[],mt=new Map,_t=""},"clear");function jt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(jt,"typeStr2Type");function Gt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}d(Gt,"edgeTypeStr2Type");function Zt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Zt,"edgeStrToEdgeData");function qt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}d(qt,"edgeStrToEdgeStartData");function Jt(e){return e.includes("==")?"thick":"normal"}d(Jt,"edgeStrToThickness");function Qt(e){return e.includes(".-")?"dotted":"solid"}d(Qt,"edgeStrToPattern");var Mt=0,dr=d(()=>(Mt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mt),"generateId"),ur=d(e=>{rt.children=e,Vt(e,rt),Tt=rt.children},"setHierarchy"),pr=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),fr=d(()=>[...X.values()],"getBlocksFlat"),xr=d(()=>Tt||[],"getBlocks"),yr=d(()=>Et,"getEdges"),br=d(e=>X.get(e),"getBlock"),wr=d(e=>{X.set(e.id,e)},"setBlock"),mr=d(e=>{_t=e},"setDiagramId"),Sr=d(()=>_t,"getDiagramId"),Lr=d(()=>k,"getLogger"),kr=d(function(){return lt},"getClasses"),vr={getConfig:d(()=>at().block,"getConfig"),typeStr2Type:jt,edgeTypeStr2Type:Gt,edgeStrToEdgeData:Zt,edgeStrToEdgeStartData:qt,edgeStrToThickness:Jt,edgeStrToPattern:Qt,getLogger:Lr,getBlocksFlat:fr,getBlocks:xr,getEdges:yr,setHierarchy:ur,getBlock:br,setBlock:wr,getColumns:pr,getClasses:kr,clear:gr,generateId:dr,setDiagramId:mr,getDiagramId:Sr},Er=vr,bt=d((e,t)=>{const a=Je,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return Ye(s,i,c,t)},"fade"),_r=d(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${bt(e.mainBkg,.5)}; + fill: ${bt(e.clusterBkg,.5)}; + stroke: ${bt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${pe()} +`,"getStyles"),Tr=_r,Dr=d((e,t,a,s)=>{t.forEach(i=>{Pr[i](e,a,s)})},"insertMarkers"),Br=d((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Nr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ir=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Cr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Or=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Rr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Ar=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),zr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Mr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pr={extension:Br,composition:Nr,aggregation:Ir,dependency:Cr,lollipop:Or,point:Rr,circle:Ar,cross:zr,barb:Mr},Fr=Dr,C=A()?.block?.padding??8;function St(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}d(St,"calculateBlockPosition");var Wr=d(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,s=0){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let i=0,c=0;if(e.children?.length>0){for(const x of e.children)ot(x,t);const r=Wr(e);i=r.width,c=r.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,c);for(const x of e.children)x.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${x.id} ${i} ${c} ${JSON.stringify(x.size)}`),x.size.width=i*(x.widthInColumns??1)+C*((x.widthInColumns??1)-1),x.size.height=c,x.size.x=0,x.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${x.id} maxWidth:${i} maxHeight:${c}`));for(const x of e.children)ot(x,t,i,c);const n=e.columns??-1;let l=0;for(const x of e.children)l+=x.widthInColumns??1;let g=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(x>0){const w=(p-x*C-C)/x;k.debug("abc95 (growing to fit) width",e.id,p,e.size?.width,w);for(const v of e.children)v.size&&(v.size.width=w)}}e.size={width:p,height:b,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Dt(e,t){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const s=e?.children[0]?.size?.width??0,i=e.children.length*s+(e.children.length-1)*C;k.debug("widthOfChildren 88",i,"posX");const c=new Map;{let o=0;for(const p of e.children){if(!p.size)continue;const{py:b}=St(a,o),x=c.get(b)??0;p.size.height>x&&c.set(b,p.size.height);let w=p?.widthInColumns??1;a>0&&(w=Math.min(w,a-o%a)),o+=w}}const r=new Map;{let o=0;const p=[...c.keys()].sort((b,x)=>b-x);for(const b of p)r.set(b,o),o+=(c.get(b)??0)+C}let n=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,g=0;for(const o of e.children){const p=e;if(!o.size)continue;const{width:b,height:x}=o.size,{px:w,py:v}=St(a,n);if(v!=g&&(g=v,l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,k.debug("New row in layout for block",e.id," and child ",o.id,g)),k.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${n} (px, py) ${w},${v} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${b}${C}`),p.size){const _=b/2;o.size.x=l+C+_,k.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${l} new startingPosX${o.size.x} ${_} padding=${C} width=${b} halfWidth=${_} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${b*(o?.widthInColumns??1)/2}`),l=o.size.x+_;const I=r.get(v)??0,T=c.get(v)??x;o.size.y=p.size.y-p.size.height/2+I+T/2+C,k.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${l}${C}${_}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${b*(o?.widthInColumns??1)/2}`)}o.children&&Dt(o);let S=o?.widthInColumns??1;a>0&&(S=Math.min(S,a-n%a)),n+=S,k.debug("abc88 columnsPos",o,n)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Dt,"layoutBlocks");function Bt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Bt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}d(Bt,"findBounds");function $t(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Dt(t),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:s,maxX:i,maxY:c}=Bt(t),r=c-s,n=i-a;return{x:a,y:s,width:n,height:r}}d($t,"layout");var Yr=d(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=A(),n=P(r);return await vt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),U=Yr,Hr=d((e,t,a,s,i)=>{t.arrowTypeStart&&Pt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Pt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Kr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Pt=d((e,t,a,s,i,c)=>{const r=Kr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},Ur=d(async(e,t)=>{const a=A(),s=P(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await vt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),g=l;if(s){const p=n.children[0],b=D(n);l=p.getBoundingClientRect(),g=l,b.attr("width",l.width),b.attr("height",l.height)}else{const p=D(n).select("text").node();p&&typeof p.getBBox=="function"&&(g=p.getBBox())}c.attr("transform",$(g,s)),Lt[t.id]=i,t.width=l.width,t.height=l.height;let o;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=p,et(o,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startRight=p,et(o,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=p,et(o,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endRight=p,et(o,t.endLabelRight)}return n},"insertEdgeLabel");function et(e,t){P(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(et,"setTerminalWidth");var Xr=d((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=A(),{subGraphTitleTotalMargin:i}=Ve(s);if(e.label){const c=Lt[e.id];let r=e.x,n=e.y;if(a){const l=tt.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=M[e.id].startRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=M[e.id].endRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Vr=d((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),jr=d((e,t,a)=>{k.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let p=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Vr(t,c)&&!i){const r=jr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Gr=d(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const g=c.node(t.v);var o=c.node(t.w);o?.intersect&&g?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Ft(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Ft(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const p=n.filter(m=>!Number.isNaN(m.y));let b=Ue;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x,y:w}=He(a),v=Ke().x(x).y(w).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const _=e.append("path").attr("d",v(p)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let I="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(I=Xe(!0)),Hr(_,a,I,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),Zr=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),qr=d((e,t,a,s)=>{const i=Zr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,g=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*g},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*g,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*g},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*g,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-g},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r+g}]:i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:[{x:0,y:0}]},"getArrowPoints");function te(e,t){return e.intersect(t)}d(te,"intersectNode");var Jr=te;function ee(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),g=Math.abs(t*a*r/l);s.x0}d(kt,"sameSign");var $r=se,ta=ie;function ie(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,g=i-e.height/2-n,o=0;o1&&c.sort(function(w,v){var S=w.x-a.x,_=w.y-a.y,I=Math.sqrt(S*S+_*_),T=v.x-a.x,m=v.y-a.y,u=Math.sqrt(T*T+m*m);return I{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,g;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,g=n):(i<0&&(r=-r),l=r,g=i===0?0:r*c/i),{x:a+l,y:s+g}},"intersectRect"),ra=ea,B={node:Jr,circle:Qr,ellipse:re,polygon:ta,rect:ra},z=d(async(e,t,a,s)=>{const i=A();let c;const r=t.useHtmlLabels||P(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o;t.labelType==="markdown"?o=vt(l,Ot(Rt(g),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):o=await U(l,Ot(Rt(g),i),t.labelStyle,!1,s);let p=o.getBBox();const b=t.padding/2;if(P(i)){const x=o.children[0],w=D(o);await Ze(x,g),p=x.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):l.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:b,label:l}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function V(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(V,"insertPolygonShape");var aa=d(async(e,t)=>{t.useHtmlLabels||P(A())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await z(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),N(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),sa=aa,Wt=d(e=>e?" "+e:"","formatClass"),H=d((e,t)=>`${t||"node default"}${Wt(e.classes)} ${Wt(e.class)}`,"getClassesFromNode"),Yt=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=V(a,r,r,n);return l.attr("style",t.style),N(t,l),t.intersect=function(g){return k.warn("Intersect called"),B.polygon(t,n,g)},a},"question"),ia=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),na=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],g=V(a,n,c,l);return g.attr("style",t.style),N(t,g),t.intersect=function(o){return B.polygon(t,l,o)},a},"hexagon"),ca=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,g=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,o=qr(t.directions,s,t,g),p=V(a,g,c,o);return p.attr("style",t.style),N(t,p),t.intersect=function(b){return B.polygon(t,o,b)},a},"block_arrow"),la=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return V(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),oa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),ha=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),ga=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),da=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ua=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),pa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,g=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return N(t,g),t.intersect=function(o){const p=B.rect(t,o),b=p.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let x=r*r*(1-b*b/(c*c));x!=0&&(x=Math.sqrt(x)),x=r-x,o.y-t.y>0&&(x=-x),p.y+=x}return p},a},"cylinder"),fa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"rect"),xa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"composite"),ya=d(async(e,t)=>{const{shapeSvg:a}=await z(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return N(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ht(e,t,a,s){const i=[],c=d(n=>{i.push(n,0)},"addBorder"),r=d(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}d(ht,"applyNodePropertyBorders");var ba=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const g=await U(r,l,t.labelStyle,!0,!0);let o={width:0,height:0};if(P(A())){const v=g.children[0],S=D(g);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}k.info("Text 2",n);const p=n.slice(1,n.length);let b=g.getBBox();const x=await U(r,p.join?p.join("
"):p,t.labelStyle,!0,!0);if(P(A())){const v=x.children[0],S=D(x);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}const w=t.padding/2;return D(x).attr("transform","translate( "+(o.width>b.width?0:(b.width-o.width)/2)+", "+(b.height+w+5)+")"),D(g).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return N(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ma=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),N(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),Sa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),N(t,n),t.intersect=function(g){return k.info("DoubleCircle intersect",t,s.width/2+i+c,g),B.circle(t,s.width/2+i+c,g)},a},"doublecircle"),La=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),ka=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Ht=d((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),va=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),Ea=d(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),g=r.insert("line");let o=0,p=s;const b=r.insert("g").attr("class","label");let x=0;const w=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await U(b,v,t.labelStyle,!0,!0);let _=S.getBBox();if(P(A())){const E=S.children[0],h=D(S);_=E.getBoundingClientRect(),h.attr("width",_.width),h.attr("height",_.height)}t.classData.annotations[0]&&(p+=_.height+s,o+=_.width);let I=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(P(A())?I+="<"+t.classData.type+">":I+="<"+t.classData.type+">");const T=await U(b,I,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(P(A())){const E=T.children[0],h=D(T);m=E.getBoundingClientRect(),h.attr("width",m.width),h.attr("height",m.height)}p+=m.height+s,m.width>o&&(o=m.width);const u=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,u.push(f)}),p+=i;const y=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,y.push(f)}),p+=i,w){let E=(o-_.width)/2;D(S).attr("transform","translate( "+(-1*o/2+E)+", "+-1*p/2+")"),x=_.height+s}let L=(o-m.width)/2;return D(T).attr("transform","translate( "+(-1*o/2+L)+", "+(-1*p/2+x)+")"),x+=m.height+s,l.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,u.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x+i/2)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),x+=i,g.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,y.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(p/2)-a).attr("width",o+t.padding).attr("height",p+t.padding),N(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Kt={rhombus:Yt,composite:xa,question:Yt,rect:fa,labelRect:ya,rectWithTitle:ba,choice:ia,circle:ma,doublecircle:Sa,stadium:wa,hexagon:na,block_arrow:ca,rect_left_inv_arrow:la,lean_right:oa,lean_left:ha,trapezoid:ga,inv_trapezoid:da,rect_right_inv_arrow:ua,cylinder:pa,start:ka,end:va,note:sa,subroutine:La,fork:Ht,join:Ht,class_box:Ea},ct={},ne=d(async(e,t,a)=>{let s,i;if(t.link){let c;A().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Kt[t.shape](s,t,a)}else i=await Kt[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ct[t.id]=s,t.haveCallback&&ct[t.id].attr("class",ct[t.id].attr("class")+" clickable"),s},"insertNode"),_a=d(e=>{const t=ct[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Nt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=Ge(s?.styles??[]),g=s.label,o=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:g,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:s.type,padding:n??at()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}d(Nt,"getNodeFromBlock");async function ce(e,t,a){const s=Nt(t,a,!1);if(s.type==="group")return;const i=at(),c=await ne(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}d(ce,"calculateBlockSize");async function le(e,t,a){const s=Nt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=at();await ne(e,s,{config:c}),t.intersect=s?.intersect,_a(s)}}d(le,"insertBlockPositioned");async function gt(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await gt(e,i.children,a,s)}d(gt,"performOperations");async function oe(e,t,a){await gt(e,t,a,ce)}d(oe,"calculateBlockSizes");async function he(e,t,a){await gt(e,t,a,le)}d(he,"insertBlocks");async function ge(e,t,a,s,i){const c=new qe({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const g=n.size,o=l.size,p=[{x:g.x,y:g.y},{x:g.x+(o.x-g.x)/2,y:g.y+(o.y-g.y)/2},{x:o.x,y:o.y}],b=i?`${i}-${r.id}`:r.id,x=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",w=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${x} ${w} flowchart-link LS-a1 LE-b1`;Gr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v},void 0,"block",c,i),r.label&&(await Ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v}),Xr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}d(ge,"insertEdges");var Ta=d(function(e,t){return t.db.getClasses()},"getClasses"),Da=d(async function(e,t,a,s){const{securityLevel:i,block:c}=at(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),g=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Fr(g,["point","circle","cross"],s.type,t);const p=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),w=g.insert("g").attr("class","block");await oe(w,p,r);const v=$t(r);if(await he(w,p,r),await ge(w,x,b,r,t),v){const S=v,_=Math.max(1,Math.round(.125*(S.width/S.height))),I=S.height+_+10,T=S.width+10,{useMaxWidth:m}=c;Fe(g,I,T,!!m),k.debug("Here Bounds",v,S),g.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ba={draw:Da,getClasses:Ta},Aa={parser:sr,db:Er,renderer:Ba,styles:Tr};export{Aa as diagram}; diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DjQbQYqy.js b/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DjQbQYqy.js new file mode 100644 index 0000000000..f5ecd6bbc8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DjQbQYqy.js @@ -0,0 +1,10 @@ +import{g as Oe,d as Re}from"./chunk-ND2GUHAM-D-Pih1kA.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-zKrc8Ye9.js";import"./index-DtRfJ0vw.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[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],Ot=[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],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[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],Qt={trace:y(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:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;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:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[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:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +`+D.showPosition()+` +Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,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 x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.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),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=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 R=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===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),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(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=Ae;function It(){this.yy={}}return y(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=y(function(){return ye},"getC4Type"),Ue=y(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=y(function(e,t,s,o,l,r,a,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(p=>p.from===t&&p.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.techn={text:l};if(r==null)u.descr={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.descr={text:r};if(typeof a=="object"){let[p,g]=Object.entries(a)[0];u[p]=g}else u.sprite=a;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Ve=y(function(e,t,s,o,l,r,a){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.tags=r;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.link=a;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=y(function(e,t,s,o,l,r,a,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.shadowing=r;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.shape=a;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ke=y(function(e,t,s,o,l,r,a){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(r);if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(a)}},"updateRelStyle"),Je=y(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const r=Object.values(t)[0];o=parseInt(r)}else o=parseInt(t);if(typeof s=="object"){const r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=y(function(){return Ut},"getC4ShapeInRow"),$e=y(function(){return Ft},"getC4BoundaryInRow"),t0=y(function(){return B},"getCurrentBoundaryParse"),e0=y(function(){return F},"getParentBoundaryParse"),ge=y(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=y(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=y(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=y(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,s0=y(function(){return Pt},"getRels"),r0=y(function(){return ee},"getTitle"),l0=y(function(e){ae=e},"setWrap"),mt=y(function(){return ae},"autoWrap"),o0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=y(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:s0,getTitle:r0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:y(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=y(function(e,t){return Re(e,t)},"drawRect"),_e=y(function(e,t,s,o,l,r){const a=e.append("image");a.attr("width",t),a.attr("height",s),a.attr("x",o),a.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:Le.sanitizeUrl(r);a.attr("xlink:href",n)},"drawImage"),f0=y((e,t,s,o)=>{const l=e.append("g");let r=0;for(let a of t){let n=a.textColor?a.textColor:"#444444",i=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,d=a.offsetY?parseInt(a.offsetY):0,p="";if(r===0){let m=l.append("line");m.attr("x1",a.startPoint.x),m.attr("y1",a.startPoint.y),m.attr("x2",a.endPoint.x),m.attr("y2",a.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),r=-1}else{let m=l.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(a.label.text,l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:n},g),a.techn&&a.techn.text!==""&&(g=s.messageFont(),Q(s)("["+a.techn.text+"]",l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),p0=y(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",r=t.borderColor?t.borderColor:"#444444",a=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:r,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=a,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=y(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],r=t.fontColor?t.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=r,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:r},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=r,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:r,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:r,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=r,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:r},d)),t.height},"drawC4Shape"),g0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=y(function(e,t){const o=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,r,a,n,i,u,d){const p=r.append("text").attr("x",a+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(p,d)}y(e,"byText");function t(l,r,a,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=y(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=y(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),k0=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let r=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=r.length;let a=0;t[e].height=0,t[e].width=0;for(const n of r)t[e].width=Math.max(Tt(n,o),t[e].width),a=ue(n,o),t[e].height=t[e].height+a}}y(j,"calcC4ShapeTextWH");var ve=y(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Tt(t.label.text,l);j("label",t,o,l,r),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=y(function(e,t,s,o){let l=0;for(const r of o){l=0;const a=s[r];let n=St(_,a.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,a.typeC4Shape.width=Tt("«"+a.typeC4Shape.text+"»",n),a.typeC4Shape.height=n.fontSize+2,a.typeC4Shape.Y=_.c4ShapePadding,l=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height);let i=a.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,a.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",a,i,d,u),a.label.Y=l+8,l=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=St(_,a.typeC4Shape.text);j("type",a,i,m,u),a.type.Y=l+5,l=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=St(_,a.techn.text);j("techn",a,i,m,u),a.techn.Y=l+5,l=a.techn.Y+a.techn.height}let p=l,g=a.label.width;if(a.descr&&a.descr.text!==""){let m=St(_,a.typeC4Shape.text);j("descr",a,i,m,u),a.descr.Y=l+20,l=a.descr.Y+a.descr.height,g=Math.max(a.label.width,a.descr.width),p=l-a.descr.textLines*5}g=g+_.c4ShapePadding,a.width=Math.max(a.width||_.width,g,_.width),a.height=Math.max(a.height||_.height,p,_.height),a.margin=a.margin||_.c4ShapeMargin,e.insert(a),z.drawC4Shape(t,a,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{y(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=y(function(e,t){let s=e.x,o=e.y,l=t.x,r=t.y,a=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-r),d=u/i,p=e.height/e.width,g=null;return o==r&&sl?g=new Y(s,n):s==l&&or&&(g=new Y(a,o)),s>l&&o=d?g=new Y(s,n+d*e.width/2):g=new Y(a-i/u*e.height/2,o+e.height):s=d?g=new Y(s+e.width,n+d*e.width/2):g=new Y(a+i/u*e.height/2,o+e.height):sr?p>=d?g=new Y(s+e.width,n-d*e.width/2):g=new Y(a+e.height/2*i/u,o):s>l&&o>r&&(p>=d?g=new Y(s,n-e.width/2*d):g=new Y(a-e.height/2*i/u,o)),g},"getIntersectPoint"),C0=y(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),w0=y(function(e,t,s,o,l){let r=0;for(let a of t){r=r+1;let n=a.wrap&&_.wrap,i=k0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=r+": "+a.label.text);let d=Tt(a.label.text,i);j("label",a,n,i,d),a.techn&&a.techn.text!==""&&(d=Tt(a.techn.text,i),j("techn",a,n,i,d)),a.descr&&a.descr.text!==""&&(d=Tt(a.descr.text,i),j("descr",a,n,i,d));let p=s(a.from),g=s(a.to),m=C0(p,g);a.startPoint=m.startPoint,a.endPoint=m.endPoint}z.drawRels(e,t,_,l)},"drawRels");function ne(e,t,s,o,l){let r=new me(l);r.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[a,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(a==0||a%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;r.setData(O,O,S,S)}else{let O=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,S=r.data.starty;r.setData(O,O,S,S)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),g=l.db.getC4ShapeKeys(n.alias);g.length>0&&Ee(r,e,p,g),t=n.alias;let m=l.db.getBoundaries(t);m.length>0&&ne(e,t,r,m,l),n.alias!=="global"&&ve(e,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}y(ne,"drawInsideBoundary");var T0=y(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let r;l==="sandbox"&&(r=Nt("#i"+t));const a=l==="sandbox"?Nt(r.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?a.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");ne(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),w0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Vt,u.data.stopy=zt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",g)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:T0},O0=y(e=>`.person { + stroke: ${e.personBorder}; + fill: ${e.personBkg}; + } +`,"getStyles"),R0=O0,B0={parser:Ye,db:Zt,renderer:fe,styles:R0,init:y(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{B0 as diagram}; diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js b/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js new file mode 100644 index 0000000000..f8b9f3b82d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js @@ -0,0 +1,10 @@ +import{g as Oe,d as Re}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaidParser.worker-Dx4jPi9z.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[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],Ot=[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],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[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],Qt={trace:y(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:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;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:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[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:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +`+D.showPosition()+` +Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,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 x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.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),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=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 R=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===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),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(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=Ae;function It(){this.yy={}}return y(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=y(function(){return ye},"getC4Type"),Ue=y(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=y(function(e,t,s,o,l,r,a,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(p=>p.from===t&&p.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.techn={text:l};if(r==null)u.descr={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.descr={text:r};if(typeof a=="object"){let[p,g]=Object.entries(a)[0];u[p]=g}else u.sprite=a;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Ve=y(function(e,t,s,o,l,r,a){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.tags=r;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.link=a;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=y(function(e,t,s,o,l,r,a,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.shadowing=r;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.shape=a;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ke=y(function(e,t,s,o,l,r,a){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(r);if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(a)}},"updateRelStyle"),Je=y(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const r=Object.values(t)[0];o=parseInt(r)}else o=parseInt(t);if(typeof s=="object"){const r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=y(function(){return Ut},"getC4ShapeInRow"),$e=y(function(){return Ft},"getC4BoundaryInRow"),t0=y(function(){return B},"getCurrentBoundaryParse"),e0=y(function(){return F},"getParentBoundaryParse"),ge=y(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=y(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=y(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=y(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,s0=y(function(){return Pt},"getRels"),r0=y(function(){return ee},"getTitle"),l0=y(function(e){ae=e},"setWrap"),mt=y(function(){return ae},"autoWrap"),o0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=y(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:s0,getTitle:r0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:y(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=y(function(e,t){return Re(e,t)},"drawRect"),_e=y(function(e,t,s,o,l,r){const a=e.append("image");a.attr("width",t),a.attr("height",s),a.attr("x",o),a.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:Le.sanitizeUrl(r);a.attr("xlink:href",n)},"drawImage"),f0=y((e,t,s,o)=>{const l=e.append("g");let r=0;for(let a of t){let n=a.textColor?a.textColor:"#444444",i=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,d=a.offsetY?parseInt(a.offsetY):0,p="";if(r===0){let m=l.append("line");m.attr("x1",a.startPoint.x),m.attr("y1",a.startPoint.y),m.attr("x2",a.endPoint.x),m.attr("y2",a.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),r=-1}else{let m=l.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(a.label.text,l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:n},g),a.techn&&a.techn.text!==""&&(g=s.messageFont(),Q(s)("["+a.techn.text+"]",l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),p0=y(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",r=t.borderColor?t.borderColor:"#444444",a=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:r,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=a,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=y(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],r=t.fontColor?t.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=r,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:r},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=r,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:r,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:r,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=r,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:r},d)),t.height},"drawC4Shape"),g0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=y(function(e,t){const o=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,r,a,n,i,u,d){const p=r.append("text").attr("x",a+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(p,d)}y(e,"byText");function t(l,r,a,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=y(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=y(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),k0=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let r=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=r.length;let a=0;t[e].height=0,t[e].width=0;for(const n of r)t[e].width=Math.max(Tt(n,o),t[e].width),a=ue(n,o),t[e].height=t[e].height+a}}y(j,"calcC4ShapeTextWH");var ve=y(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Tt(t.label.text,l);j("label",t,o,l,r),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=y(function(e,t,s,o){let l=0;for(const r of o){l=0;const a=s[r];let n=St(_,a.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,a.typeC4Shape.width=Tt("«"+a.typeC4Shape.text+"»",n),a.typeC4Shape.height=n.fontSize+2,a.typeC4Shape.Y=_.c4ShapePadding,l=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height);let i=a.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,a.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",a,i,d,u),a.label.Y=l+8,l=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=St(_,a.typeC4Shape.text);j("type",a,i,m,u),a.type.Y=l+5,l=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=St(_,a.techn.text);j("techn",a,i,m,u),a.techn.Y=l+5,l=a.techn.Y+a.techn.height}let p=l,g=a.label.width;if(a.descr&&a.descr.text!==""){let m=St(_,a.typeC4Shape.text);j("descr",a,i,m,u),a.descr.Y=l+20,l=a.descr.Y+a.descr.height,g=Math.max(a.label.width,a.descr.width),p=l-a.descr.textLines*5}g=g+_.c4ShapePadding,a.width=Math.max(a.width||_.width,g,_.width),a.height=Math.max(a.height||_.height,p,_.height),a.margin=a.margin||_.c4ShapeMargin,e.insert(a),z.drawC4Shape(t,a,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{y(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=y(function(e,t){let s=e.x,o=e.y,l=t.x,r=t.y,a=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-r),d=u/i,p=e.height/e.width,g=null;return o==r&&sl?g=new Y(s,n):s==l&&or&&(g=new Y(a,o)),s>l&&o=d?g=new Y(s,n+d*e.width/2):g=new Y(a-i/u*e.height/2,o+e.height):s=d?g=new Y(s+e.width,n+d*e.width/2):g=new Y(a+i/u*e.height/2,o+e.height):sr?p>=d?g=new Y(s+e.width,n-d*e.width/2):g=new Y(a+e.height/2*i/u,o):s>l&&o>r&&(p>=d?g=new Y(s,n-e.width/2*d):g=new Y(a-e.height/2*i/u,o)),g},"getIntersectPoint"),C0=y(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),w0=y(function(e,t,s,o,l){let r=0;for(let a of t){r=r+1;let n=a.wrap&&_.wrap,i=k0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=r+": "+a.label.text);let d=Tt(a.label.text,i);j("label",a,n,i,d),a.techn&&a.techn.text!==""&&(d=Tt(a.techn.text,i),j("techn",a,n,i,d)),a.descr&&a.descr.text!==""&&(d=Tt(a.descr.text,i),j("descr",a,n,i,d));let p=s(a.from),g=s(a.to),m=C0(p,g);a.startPoint=m.startPoint,a.endPoint=m.endPoint}z.drawRels(e,t,_,l)},"drawRels");function ne(e,t,s,o,l){let r=new me(l);r.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[a,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(a==0||a%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;r.setData(O,O,S,S)}else{let O=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,S=r.data.starty;r.setData(O,O,S,S)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),g=l.db.getC4ShapeKeys(n.alias);g.length>0&&Ee(r,e,p,g),t=n.alias;let m=l.db.getBoundaries(t);m.length>0&&ne(e,t,r,m,l),n.alias!=="global"&&ve(e,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}y(ne,"drawInsideBoundary");var T0=y(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let r;l==="sandbox"&&(r=Nt("#i"+t));const a=l==="sandbox"?Nt(r.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?a.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");ne(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),w0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Vt,u.data.stopy=zt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",g)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:T0},O0=y(e=>`.person { + stroke: ${e.personBorder}; + fill: ${e.personBkg}; + } +`,"getStyles"),R0=O0,P0={parser:Ye,db:Zt,renderer:fe,styles:R0,init:y(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{P0 as diagram}; diff --git a/apps/kimi-code/dist-web/assets/channel-Bt325_7a.js b/apps/kimi-code/dist-web/assets/channel-Bt325_7a.js new file mode 100644 index 0000000000..0c3d59a912 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-Bt325_7a.js @@ -0,0 +1 @@ +import{U as a,S as n}from"./mermaid.core-zKrc8Ye9.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-DNkUo9e6.js b/apps/kimi-code/dist-web/assets/channel-DNkUo9e6.js new file mode 100644 index 0000000000..a590a89287 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-DNkUo9e6.js @@ -0,0 +1 @@ +import{ai as o,aj as n}from"./mermaidParser.worker-Dx4jPi9z.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-BlbqWzB_.js b/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-BlbqWzB_.js new file mode 100644 index 0000000000..4296fbe0f4 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-BlbqWzB_.js @@ -0,0 +1 @@ +import{_ as a,e as w,l as x}from"./mermaid.core-zKrc8Ye9.js";var d=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=l(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"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js b/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js new file mode 100644 index 0000000000..5c6f333403 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js @@ -0,0 +1 @@ +import{_ as a,e as w,l as x}from"./mermaidParser.worker-Dx4jPi9z.js";var d=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=l(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"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-4BX2VUAB-Bjjry6OZ.js b/apps/kimi-code/dist-web/assets/chunk-4BX2VUAB-Bjjry6OZ.js new file mode 100644 index 0000000000..cbb1cdfa82 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-4BX2VUAB-Bjjry6OZ.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaid.core-zKrc8Ye9.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/kimi-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js b/apps/kimi-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js new file mode 100644 index 0000000000..9b2357e5c4 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.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/kimi-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js b/apps/kimi-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js new file mode 100644 index 0000000000..d504d5f78a --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js @@ -0,0 +1 @@ +import{_ as a,d as o}from"./mermaidParser.worker-Dx4jPi9z.js";var d=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{d as g}; diff --git a/apps/kimi-code/dist-web/assets/chunk-55IACEB6-mUr9lxTD.js b/apps/kimi-code/dist-web/assets/chunk-55IACEB6-mUr9lxTD.js new file mode 100644 index 0000000000..78aeb3e0d1 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-55IACEB6-mUr9lxTD.js @@ -0,0 +1 @@ +import{_ as a,d as o}from"./mermaid.core-zKrc8Ye9.js";var d=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{d as g}; diff --git a/apps/kimi-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js b/apps/kimi-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js new file mode 100644 index 0000000000..082e6dc05d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js @@ -0,0 +1,206 @@ +import{g as tt}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{c as st}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{g as it}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as at}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as f,l as Ie,c as F,o as rt,r as nt,u as Oe,d as de,y as ut,b as lt,a as ct,s as ot,g as ht,p as dt,q as pt,k as I,z as At,x as ft,i as gt,Q as G}from"./mermaidParser.worker-Dx4jPi9z.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],r=[1,20],n=[1,41],c=[1,26],l=[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],re=[1,103],z=[1,121],Y=[1,117],K=[1,113],Q=[1,119],W=[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],ne=[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,u,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:u.addRelation(e[s]);break;case 20:e[s-1].title=u.cleanupLabel(e[s]),u.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),u.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),u.setAccDescription(this.$);break;case 34:u.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 35:u.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 36:this.$=u.addNamespace(e[s]);break;case 37:this.$=u.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:u.setCssClass(e[s-2],e[s]);break;case 49:u.addMembers(e[s-3],e[s-1]);break;case 51:u.setCssClass(e[s-5],e[s-3]),u.addMembers(e[s-5],e[s-1]);break;case 52:u.addAnnotation(e[s-3],e[s-1]);break;case 53:u.addAnnotation(e[s-6],e[s-4]),u.addMembers(e[s-6],e[s-1]);break;case 54:u.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],u.addClass(e[s]);break;case 56:this.$=e[s-1],u.addClass(e[s-1]),u.setClassLabel(e[s-1],e[s]);break;case 60:u.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:u.addMember(e[s-1],u.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.$=u.addNote(e[s],e[s-1]);break;case 72:this.$=u.addNote(e[s]);break;case 73:this.$=e[s-2],u.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:u.setDirection("TB");break;case 77:u.setDirection("BT");break;case 78:u.setDirection("RL");break;case 79:u.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.$=u.relationType.AGGREGATION;break;case 85:this.$=u.relationType.EXTENSION;break;case 86:this.$=u.relationType.COMPOSITION;break;case 87:this.$=u.relationType.DEPENDENCY;break;case 88:this.$=u.relationType.LOLLIPOP;break;case 89:this.$=u.lineType.LINE;break;case 90:this.$=u.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],u.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],u.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],u.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],u.setLink(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],u.setLink(e[s-3],e[s-2],e[s]),u.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],u.setClickEvent(e[s-3],e[s-2],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],u.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],u.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],u.setLink(e[s-3],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],u.setLink(e[s-4],e[s-2],e[s]),u.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],u.setCssStyle(e[s-1],e[s]);break;case 106:u.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:r,38:22,42:n,43:23,46:c,48:l,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:r,42:n,46:c,48:l,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:r,38:22,42:n,43:23,46:c,48:l,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:n,43:23,48:l,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:re},{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:Q,84:111,85:112,86:W,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:Q,84:111,85:112,86:W,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(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(ne,[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:n,43:23,48:l,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:re},{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:Q,86:W,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(ne,[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:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:l,54:g,56:N},{45:163,51:re},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:Q,84:169,85:112,86:W,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(ne,[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:re},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:Q,86:W,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],u=[],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 Qe(){var S;return S=u.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(u=S,S=u.pop()),S=h.symbols_[S]||S),S}f(Qe,"lex");for(var B,V,L,xe,R={},oe,v,We,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=Qe()),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._$),We=J[p[p.length-2]][p[p.length-1]],p.push(We);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 u=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===u.length?this.yylloc.first_column:0)+u[u.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()+` +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,u,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,u;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,u=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[u]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,u,C){switch(u){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\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]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\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\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\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\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\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]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=gt(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const c=n[1]?n[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=n[2],this.parameters=n[3]?n[3].trim():"",i=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",i===""){const l=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(l)&&(i=l,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=t.length,n=t.substring(0,1),c=t.substring(r-1);je.includes(n)&&(this.visibility=n),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?r:r-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=st();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const l=de(c.currentTarget),d=l.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(ut.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),l.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=lt,this.getAccTitle=ct,this.setAccDescription=ot,this.getAccDescription=ht,this.setDiagramTitle=dt,this.getDiagramTitle=pt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let r="",n=a;if(a.indexOf("~")>0){const c=a.split("~");n=P(c[0]),r=P(c[1])}return{className:n,type:r}}setClassLabel(i,a){const r=I.sanitizeText(i,F());a&&(a=P(a));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=a,this.classes.get(n).text=`${a}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:r,type:n}=this.splitClassNameAndType(a);if(this.classes.has(r))return;const c=I.sanitizeText(r,F());this.classes.set(c,{id:c,type:n,label:c,text:`${c}${n?`<${n}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const r={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(r)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const r=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${r}`:r}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",At()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const r=this.splitClassNameAndType(i).className;this.classes.get(r).annotations.push(a)}addMember(i,a){this.addClass(i);const r=this.splitClassNameAndType(i).className,n=this.classes.get(r);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?n.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?n.methods.push(new Xe(c,"method")):c&&n.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(r=>this.addMember(i,r)))}addNote(i,a){const r=this.notes.size,n={id:`note${r}`,class:a,text:i,index:r};return this.notes.set(n.id,n),n.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(r=>{let n=r;/\d/.exec(r[0])&&(n=pe+n);const c=this.classes.get(n);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const r of i){let n=this.styleClasses.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,n)),a&&a.forEach(c=>{if(/color/.exec(c)){const l=c.replace("fill","bgFill");n.textStyles.push(l)}n.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(r)&&c.styles.push(...a.flatMap(l=>l.split(",")))})}}setTooltip(i,a){i.split(",").forEach(r=>{a!==void 0&&(this.classes.get(r).tooltip=P(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,r){const n=F();i.split(",").forEach(c=>{let l=c;/\d/.exec(c[0])&&(l=pe+l);const d=this.classes.get(l);d&&(d.link=Oe.formatUrl(a,n),n.securityLevel==="sandbox"?d.linkTarget="_top":typeof r=="string"?d.linkTarget=P(r):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,r){i.split(",").forEach(n=>{this.setClickFunc(n,a,r),this.classes.get(n).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,r){const n=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const l=n;if(this.classes.has(l)){let d=[];if(typeof r=="string"){d=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(l),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const r=a.at(-1);return r?`${r}.${i}`:i}static getAncestorIds(i){const a=i.split("."),r=new Array(a.length);r[0]=a[0];for(let n=1;n0?c[l-1]:void 0,g=l===c.length-1,N=g&&a?a:n[l];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,r){if(this.namespaces.has(i)){for(const n of a){const{className:c}=this.splitClassNameAndType(n),l=this.getClass(c);l.parent=i,this.namespaces.get(i).classes.set(c,l)}for(const n of r){const c=this.getNote(n);c.parent=i,this.namespaces.get(i).notes.set(n,c)}}}setCssStyle(i,a){const r=this.classes.get(i);if(!(!a||!r))for(const n of a)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const r=this.namespaces.get(a);if(!r)return;if(r.explicit)return a;a=r.parent}}getData(){const i=[],a=[],r=F(),n=r.class?.hierarchicalNamespaces??!0;for(const l of this.namespaces.values()){if(!n&&!l.explicit)continue;const d={id:l.id,label:n?l.label:l.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:[],look:r.look,parentId:n?l.parent:void 0};i.push(d)}for(const l of this.classes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={...l,type:void 0,isGroup:!1,parentId:d,look:r.look};i.push(m)}for(const l of this.notes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(l.class)?.id;if(g){const N={id:`edgeNote${l.index}`,start:l.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};a.push(N)}}for(const l of this.interfaces){const d={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};i.push(d)}let c=0;for(const l of this.relations){c++;const d={id:ft(l.id1,l.id2,{prefix:"id",counter:c}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:r.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:r,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { + fill: ${t.nodeBorder||t.classText}; + stroke: none; + font-family: ${t.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + + .cluster-label text { + fill: ${t.titleColor}; + } + .cluster-label span { + color: ${t.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .cluster rect { + fill: ${t.clusterBkg}; + stroke: ${t.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${t.titleColor}; + } + + .cluster span { + color: ${t.titleColor}; + } + +.nodeLabel, .edgeLabel { + color: ${t.classText}; +} + +.noteLabel .nodeLabel, .noteLabel .edgeLabel { + color: ${t.noteTextColor}; +} +.edgeLabel .label rect { + fill: ${t.mainBkg}; +} +.label text { + fill: ${t.classText}; +} + +.labelBkg { + background: ${t.mainBkg}; +} +.edgeLabel .label span { + background: ${t.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: ${t.strokeWidth}; + } + + +.divider { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.classGroup line { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${t.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth}; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +[id$="-compositionStart"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-compositionEnd"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyStart"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyEnd"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionStart"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionEnd"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationStart"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationEnd"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopStart"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopEnd"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +.edgeLabel[data-look="neo"] { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} + ${tt()} +`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const r of t.doc)r.stmt==="dir"&&(a=r.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,r){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:n,state:c,layout:l}=F();r.db.setDiagramId(i);const d=r.db.getData(),m=it(i,n);d.type=r.type,d.layoutAlgorithm=rt(l),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,r.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-727SXJPM-hp-BfASB.js b/apps/kimi-code/dist-web/assets/chunk-727SXJPM-hp-BfASB.js new file mode 100644 index 0000000000..1846816804 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-727SXJPM-hp-BfASB.js @@ -0,0 +1,206 @@ +import{g as tt}from"./chunk-FMBD7UC4-_3v8zWlF.js";import{c as st}from"./chunk-ND2GUHAM-D-Pih1kA.js";import{g as it}from"./chunk-55IACEB6-mUr9lxTD.js";import{s as at}from"./chunk-2J33WTMH-BlbqWzB_.js";import{_ as f,l as Ie,c as F,o as rt,r as nt,u as Oe,d as de,y as ut,b as lt,a as ct,s as ot,g as ht,p as dt,q as pt,k as I,z as At,x as ft,i as gt,Q as G}from"./mermaid.core-zKrc8Ye9.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],r=[1,20],n=[1,41],c=[1,26],l=[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],re=[1,103],z=[1,121],Y=[1,117],K=[1,113],Q=[1,119],W=[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],ne=[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,u,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:u.addRelation(e[s]);break;case 20:e[s-1].title=u.cleanupLabel(e[s]),u.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),u.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),u.setAccDescription(this.$);break;case 34:u.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 35:u.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 36:this.$=u.addNamespace(e[s]);break;case 37:this.$=u.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:u.setCssClass(e[s-2],e[s]);break;case 49:u.addMembers(e[s-3],e[s-1]);break;case 51:u.setCssClass(e[s-5],e[s-3]),u.addMembers(e[s-5],e[s-1]);break;case 52:u.addAnnotation(e[s-3],e[s-1]);break;case 53:u.addAnnotation(e[s-6],e[s-4]),u.addMembers(e[s-6],e[s-1]);break;case 54:u.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],u.addClass(e[s]);break;case 56:this.$=e[s-1],u.addClass(e[s-1]),u.setClassLabel(e[s-1],e[s]);break;case 60:u.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:u.addMember(e[s-1],u.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.$=u.addNote(e[s],e[s-1]);break;case 72:this.$=u.addNote(e[s]);break;case 73:this.$=e[s-2],u.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:u.setDirection("TB");break;case 77:u.setDirection("BT");break;case 78:u.setDirection("RL");break;case 79:u.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.$=u.relationType.AGGREGATION;break;case 85:this.$=u.relationType.EXTENSION;break;case 86:this.$=u.relationType.COMPOSITION;break;case 87:this.$=u.relationType.DEPENDENCY;break;case 88:this.$=u.relationType.LOLLIPOP;break;case 89:this.$=u.lineType.LINE;break;case 90:this.$=u.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],u.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],u.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],u.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],u.setLink(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],u.setLink(e[s-3],e[s-2],e[s]),u.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],u.setClickEvent(e[s-3],e[s-2],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],u.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],u.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],u.setLink(e[s-3],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],u.setLink(e[s-4],e[s-2],e[s]),u.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],u.setCssStyle(e[s-1],e[s]);break;case 106:u.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:r,38:22,42:n,43:23,46:c,48:l,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:r,42:n,46:c,48:l,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:r,38:22,42:n,43:23,46:c,48:l,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:n,43:23,48:l,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:re},{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:Q,84:111,85:112,86:W,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:Q,84:111,85:112,86:W,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(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(ne,[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:n,43:23,48:l,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:re},{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:Q,86:W,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(ne,[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:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:l,54:g,56:N},{45:163,51:re},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:Q,84:169,85:112,86:W,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(ne,[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:re},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:Q,86:W,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],u=[],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 Qe(){var S;return S=u.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(u=S,S=u.pop()),S=h.symbols_[S]||S),S}f(Qe,"lex");for(var B,V,L,xe,R={},oe,v,We,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=Qe()),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._$),We=J[p[p.length-2]][p[p.length-1]],p.push(We);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 u=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===u.length?this.yylloc.first_column:0)+u[u.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()+` +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,u,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,u;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,u=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[u]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,u,C){switch(u){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\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]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\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\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\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\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\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]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=gt(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const c=n[1]?n[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=n[2],this.parameters=n[3]?n[3].trim():"",i=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",i===""){const l=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(l)&&(i=l,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=t.length,n=t.substring(0,1),c=t.substring(r-1);je.includes(n)&&(this.visibility=n),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?r:r-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=st();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const l=de(c.currentTarget),d=l.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(ut.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),l.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=lt,this.getAccTitle=ct,this.setAccDescription=ot,this.getAccDescription=ht,this.setDiagramTitle=dt,this.getDiagramTitle=pt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let r="",n=a;if(a.indexOf("~")>0){const c=a.split("~");n=P(c[0]),r=P(c[1])}return{className:n,type:r}}setClassLabel(i,a){const r=I.sanitizeText(i,F());a&&(a=P(a));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=a,this.classes.get(n).text=`${a}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:r,type:n}=this.splitClassNameAndType(a);if(this.classes.has(r))return;const c=I.sanitizeText(r,F());this.classes.set(c,{id:c,type:n,label:c,text:`${c}${n?`<${n}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const r={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(r)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const r=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${r}`:r}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",At()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const r=this.splitClassNameAndType(i).className;this.classes.get(r).annotations.push(a)}addMember(i,a){this.addClass(i);const r=this.splitClassNameAndType(i).className,n=this.classes.get(r);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?n.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?n.methods.push(new Xe(c,"method")):c&&n.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(r=>this.addMember(i,r)))}addNote(i,a){const r=this.notes.size,n={id:`note${r}`,class:a,text:i,index:r};return this.notes.set(n.id,n),n.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(r=>{let n=r;/\d/.exec(r[0])&&(n=pe+n);const c=this.classes.get(n);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const r of i){let n=this.styleClasses.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,n)),a&&a.forEach(c=>{if(/color/.exec(c)){const l=c.replace("fill","bgFill");n.textStyles.push(l)}n.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(r)&&c.styles.push(...a.flatMap(l=>l.split(",")))})}}setTooltip(i,a){i.split(",").forEach(r=>{a!==void 0&&(this.classes.get(r).tooltip=P(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,r){const n=F();i.split(",").forEach(c=>{let l=c;/\d/.exec(c[0])&&(l=pe+l);const d=this.classes.get(l);d&&(d.link=Oe.formatUrl(a,n),n.securityLevel==="sandbox"?d.linkTarget="_top":typeof r=="string"?d.linkTarget=P(r):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,r){i.split(",").forEach(n=>{this.setClickFunc(n,a,r),this.classes.get(n).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,r){const n=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const l=n;if(this.classes.has(l)){let d=[];if(typeof r=="string"){d=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(l),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const r=a.at(-1);return r?`${r}.${i}`:i}static getAncestorIds(i){const a=i.split("."),r=new Array(a.length);r[0]=a[0];for(let n=1;n0?c[l-1]:void 0,g=l===c.length-1,N=g&&a?a:n[l];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,r){if(this.namespaces.has(i)){for(const n of a){const{className:c}=this.splitClassNameAndType(n),l=this.getClass(c);l.parent=i,this.namespaces.get(i).classes.set(c,l)}for(const n of r){const c=this.getNote(n);c.parent=i,this.namespaces.get(i).notes.set(n,c)}}}setCssStyle(i,a){const r=this.classes.get(i);if(!(!a||!r))for(const n of a)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const r=this.namespaces.get(a);if(!r)return;if(r.explicit)return a;a=r.parent}}getData(){const i=[],a=[],r=F(),n=r.class?.hierarchicalNamespaces??!0;for(const l of this.namespaces.values()){if(!n&&!l.explicit)continue;const d={id:l.id,label:n?l.label:l.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:[],look:r.look,parentId:n?l.parent:void 0};i.push(d)}for(const l of this.classes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={...l,type:void 0,isGroup:!1,parentId:d,look:r.look};i.push(m)}for(const l of this.notes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(l.class)?.id;if(g){const N={id:`edgeNote${l.index}`,start:l.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};a.push(N)}}for(const l of this.interfaces){const d={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};i.push(d)}let c=0;for(const l of this.relations){c++;const d={id:ft(l.id1,l.id2,{prefix:"id",counter:c}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:r.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:r,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { + fill: ${t.nodeBorder||t.classText}; + stroke: none; + font-family: ${t.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + + .cluster-label text { + fill: ${t.titleColor}; + } + .cluster-label span { + color: ${t.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .cluster rect { + fill: ${t.clusterBkg}; + stroke: ${t.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${t.titleColor}; + } + + .cluster span { + color: ${t.titleColor}; + } + +.nodeLabel, .edgeLabel { + color: ${t.classText}; +} + +.noteLabel .nodeLabel, .noteLabel .edgeLabel { + color: ${t.noteTextColor}; +} +.edgeLabel .label rect { + fill: ${t.mainBkg}; +} +.label text { + fill: ${t.classText}; +} + +.labelBkg { + background: ${t.mainBkg}; +} +.edgeLabel .label span { + background: ${t.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: ${t.strokeWidth}; + } + + +.divider { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.classGroup line { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${t.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth}; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +[id$="-compositionStart"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-compositionEnd"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyStart"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyEnd"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionStart"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionEnd"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationStart"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationEnd"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopStart"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopEnd"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +.edgeLabel[data-look="neo"] { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} + ${tt()} +`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const r of t.doc)r.stmt==="dir"&&(a=r.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,r){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:n,state:c,layout:l}=F();r.db.setDiagramId(i);const d=r.db.getData(),m=it(i,n);d.type=r.type,d.layoutAlgorithm=rt(l),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,r.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-DbRpkGly.js b/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-DbRpkGly.js new file mode 100644 index 0000000000..e004caa5d8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-DbRpkGly.js @@ -0,0 +1,231 @@ +import{g as Zt}from"./chunk-55IACEB6-mUr9lxTD.js";import{s as te}from"./chunk-2J33WTMH-BlbqWzB_.js";import{_ as f,l as _,c as w,r as ee,u as se,a as ie,b as re,g as ae,s as ne,p as oe,q as le,ab as ce,k as W,z as he}from"./mermaid.core-zKrc8Ye9.js";var Dt=(function(){var t=f(function(Y,a,c,r){for(c=c||{},r=Y.length;r--;c[Y[r]]=a);return c},"o"),e=[1,2],l=[1,3],s=[1,4],u=[2,4],d=[1,9],S=[1,11],g=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],A=[1,20],k=[1,21],h=[1,22],x=[1,23],D=[1,24],$=[1,26],L=[1,27],P=[1,28],I=[1,29],J=[1,30],st=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],j=[1,34],p=[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],At=[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,c,r,y,E,i,F){var o=i.length-1;switch(E){case 3:return y.setRootDoc(i[o]),i[o];case 4:this.$=[];break;case 5:i[o]!="nl"&&(i[o-1].push(i[o]),this.$=i[o-1]);break;case 6:case 7:this.$=i[o];break;case 8:this.$="nl";break;case 12:this.$=i[o];break;case 13:const q=i[o-1];q.description=y.trimColon(i[o]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[o-2],state2:i[o]};break;case 15:const gt=y.trimColon(i[o]);this.$={stmt:"relation",state1:i[o-3],state2:i[o-1],description:gt};break;case 19:this.$={stmt:"state",id:i[o-3],type:"default",description:"",doc:i[o-1]};break;case 20:var B=i[o],H=i[o-2].trim();if(i[o].match(":")){var ht=i[o].split(":");B=ht[0],H=[H,ht[1]]}this.$={stmt:"state",id:B,type:"default",description:H};break;case 21:this.$={stmt:"state",id:i[o-3],type:"default",description:i[o-5],doc:i[o-1]};break;case 22:this.$={stmt:"state",id:i[o],type:"fork"};break;case 23:this.$={stmt:"state",id:i[o],type:"join"};break;case 24:this.$={stmt:"state",id:i[o],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[o-1].trim(),note:{position:i[o-2].trim(),text:i[o].trim()}};break;case 29:this.$=i[o].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[o].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[o-3],url:i[o-2],tooltip:i[o-1]};break;case 33:this.$={stmt:"click",id:i[o-3],url:i[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[o-1].trim(),classes:i[o].trim()};break;case 36:this.$={stmt:"style",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 37:this.$={stmt:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[o].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:l,6:s},{1:[3]},{3:5,4:e,5:l,6:s},{3:6,4:e,5:l,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],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:N,57:j},{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(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:N,57:j},t(p,[2,17]),t(At,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[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(p,[2,14],{14:[1,71]}),{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,72],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(p,[2,15]),t(p,[2,19]),t(At,u,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,81],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,c){if(c.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=c,r}},"parseError"),parse:f(function(a){var c=this,r=[0],y=[],E=[null],i=[],F=this.table,o="",B=0,H=0,ht=2,q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),M={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(M.yy[Tt]=this.yy[Tt]);b.setInput(a,M.yy),M.yy.lexer=b,M.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var qt=b.options&&b.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(O){r.length=r.length-2*O,E.length=E.length-O,i.length=i.length-O}f(Qt,"popStack");function xt(){var O;return O=y.pop()||b.lex()||q,typeof O!="number"&&(O instanceof Array&&(y=O,O=y.pop()),O=c.symbols_[O]||O),O}f(xt,"lex");for(var C,U,R,_t,z={},ut,G,Lt,dt;;){if(U=r[r.length-1],this.defaultActions[U]?R=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=xt()),R=F[U]&&F[U][C]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in F[U])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(B+1)+`: +`+b.showPosition()+` +Expecting `+dt.join(", ")+", got '"+(this.terminals_[C]||C)+"'":mt="Parse error on line "+(B+1)+": Unexpected "+(C==q?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[C]||C,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(R[0]){case 1:r.push(C),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),C=null,H=b.yyleng,o=b.yytext,B=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],z.$=E[E.length-G],z._$={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&&(z._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(z,[o,H,B,M.yy,R[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_[R[1]][0]),E.push(z.$),i.push(z._$),Lt=F[r[r.length-2]][r[r.length-1]],r.push(Lt);break;case 3:return!0}}return!0},"parse")},Jt=(function(){var Y={EOF:1,parseError:f(function(c,r){if(this.yy.parser)this.yy.parser.parseError(c,r);else throw new Error(c)},"parseError"),setInput:f(function(a,c){return this.yy=c||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 c=a.match(/(?:\r\n?|\n).*/g);return c?(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 c=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;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),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===y.length?this.yylloc.first_column:0)+y[y.length-r.length].length-r[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),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(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:f(function(a,c){var r,y,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),y=a[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,r,y;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=r,y=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,E[y]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var c=this.next();return c||this.lex()},"lex"),begin:f(function(c){this.conditionStack.push(c)},"begin"),popState:f(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:f(function(c){this.begin(c)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(c,r,y,E){function i(){const F=r.yytext.indexOf("%%");if(F===0)return!1;if(F>0){const o=r.yytext.slice(0,F),B=r.yytext.slice(F);B&&c.lexer.unput(B),r.yytext=o}return!0}switch(f(i,"processId"),y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return i()?(this.popState(),"ID"):void 0;case 65:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 67:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return i()?24:void 0;case 73:return r.yytext=r.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return Y})();yt.lexer=Jt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();Dt.parser=Dt;var Ge=Dt,ue="TB",Ft="TB",It="dir",X="state",K="root",vt="relation",de="classDef",fe="style",pe="applyClass",tt="default",Bt="divider",Gt="fill:none",Yt="fill: #333",Vt="c",Mt="markdown",Ut="normal",bt="rect",kt="rectWithTitle",Se="stateStart",ye="stateEnd",Ot="divider",Nt="roundedWithTitle",ge="note",Te="noteGroup",et="statediagram",Ee="state",_e=`${et}-${Ee}`,Wt="transition",me="note",be="note-edge",ke=`${Wt} ${be}`,De=`${et}-${me}`,ve="cluster",Ce=`${et}-${ve}`,Ae="cluster-alt",xe=`${et}-${Ae}`,jt="parent",Ht="note",Le="state",Ct="----",Ie=`${Ct}${Ht}`,Rt=`${Ct}${jt}`,zt=f((t,e=Ft)=>{if(!t.doc)return e;let l=e;for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir"),Oe=f(function(t,e){return e.db.getClasses()},"getClasses"),Ne=f(async function(t,e,l,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:u,state:d,layout:S}=w();s.db.extract(s.db.getRootDocV2());const g=s.db.getData(),n=Zt(e,u);g.type=s.type,g.layoutAlgorithm=S,g.nodeSpacing=d?.nodeSpacing||50,g.rankSpacing=d?.rankSpacing||50,w().look==="neo"?g.markers=["barbNeo"]:g.markers=["barb"],g.diagramId=e,await ee(g,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((A,k)=>{const h=typeof k=="string"?k:typeof k?.id=="string"?k.id:"";if(!h){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const x=n.node()?.querySelectorAll("g");let D;if(x?.forEach(I=>{I.textContent?.trim()===h&&(D=I)}),!D){_.warn("⚠️ Could not find node matching text:",h);return}const $=D.parentNode;if(!$){_.warn("⚠️ Node has no parent, cannot wrap:",h);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),P=A.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),L.setAttribute("target","_blank"),A.tooltip){const I=A.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}$.replaceChild(L,D),L.appendChild(D),_.info("🔗 Wrapped node in tag for:",h,A.url)})}catch(N){_.error("❌ Error injecting clickable links:",N)}se.insertTitle(n,"statediagramTitleText",d?.titleTopMargin??25,s.db.getDiagramTitle()),te(n,m,et,d?.useMaxWidth??!0)},"draw"),Ye={getClasses:Oe,draw:Ne,getDir:zt},pt=new Map,V=0;function St(t="",e=0,l="",s=Ct){const u=l!==null&&l.length>0?`${s}${l}`:"";return`${Le}-${t}${u}-${e}`}f(St,"stateDomId");var Re=f((t,e,l,s,u,d,S,g)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case X:Z(t,n,l,s,u,d,S,g);break;case tt:Z(t,n,l,s,u,d,S,g);break;case vt:{Z(t,n.state1,l,s,u,d,S,g),Z(t,n.state2,l,s,u,d,S,g);const T=S==="neo",m={id:"edge"+V,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:W.sanitizeText(n.description??"",w()),arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,classes:Wt,look:S};u.push(m),V++}break}})},"setupDoc"),wt=f((t,e=Ft)=>{let l=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir");function Q(t,e,l){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(u=>{const d=l.get(u);d&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...d.styles])}));const s=t.find(u=>u.id===e.id);s?Object.assign(s,e):t.push(e)}f(Q,"insertOrUpdateNode");function Kt(t){return t?.classes?.join(" ")??""}f(Kt,"getClassesFromDbInfo");function Xt(t){return t?.styles??[]}f(Xt,"getStylesFromDbInfo");var Z=f((t,e,l,s,u,d,S,g)=>{const n=e.id,T=l.get(n),m=Kt(T),N=Xt(T),A=w();if(_.info("dataFetcher parsedItem",e,T,N),n!=="root"){let k=bt;e.start===!0?k=Se:e.start===!1&&(k=ye),e.type!==tt&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:W.sanitizeText(n,A),cssClasses:`${m} ${_e}`,cssStyles:N});const h=pt.get(n);e.description&&(Array.isArray(h.description)?(h.shape=kt,h.description.push(e.description)):h.description?.length&&h.description.length>0?(h.shape=kt,h.description===n?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=bt,h.description=e.description),h.description=W.sanitizeTextOrArray(h.description,A)),h.description?.length===1&&h.shape===kt&&(h.type==="group"?h.shape=Nt:h.shape=bt),!h.type&&e.doc&&(_.info("Setting cluster for XCX",n,wt(e)),h.type="group",h.isGroup=!0,h.dir=wt(e),h.shape=e.type===Bt?Ot:Nt,h.cssClasses=`${h.cssClasses} ${Ce} ${d?xe:""}`);const x={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:n,dir:h.dir,domId:St(n,V),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:S,labelType:"markdown"};if(x.shape===Ot&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const D={labelStyle:"",shape:ge,label:e.note.text,labelType:"markdown",cssClasses:De,cssStyles:[],cssCompiledStyles:[],id:n+Ie+"-"+V,domId:St(n,V,Ht),type:h.type,isGroup:h.type==="group",padding:A.flowchart?.padding,look:S,position:e.note.position},$=n+Rt,L={labelStyle:"",shape:Te,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,V,jt),type:"group",isGroup:!0,padding:16,look:S,position:e.note.position};V++,L.id=$,D.parentId=$,Q(s,L,g),Q(s,D,g),Q(s,x,g);let P=n,I=D.id;e.note.position==="left of"&&(P=D.id,I=n),u.push({id:P+"-"+I,start:P,end:I,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:ke,arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,look:S})}else Q(s,x,g)}e.doc&&(_.trace("Adding nodes children "),Re(e,e.doc,l,s,u,!d,S,g))},"dataFetcher"),we=f(()=>{pt.clear(),V=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$t=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),Ve=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$t(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case X:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case de:this.addStyleClass(s.id.trim(),s.classes);break;case fe:this.handleStyleDef(s);break;case pe:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),l=w();we(),Z(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,l.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),l=t.styleClass.split(",");for(const s of e){let u=this.getState(s);if(!u){const d=s.trim();this.addState(d),u=this.getState(d)}u&&(u.styles=l.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,l){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===X&&(e.id===v.START_NODE?(e.id=t.id+(l?"_start":"_end"),e.start=l):e.id=e.id.trim()),e.stmt!==K&&e.stmt!==X||!e.doc)return;const s=[];let u=[];for(const d of e.doc)if(d.type===Bt){const S=ft(d);S.doc=ft(u),s.push(S),u=[]}else u.push(d);if(s.length>0&&u.length>0){const d={stmt:X,id:ce(),type:"divider",doc:ft(u)};s.push(ft(d)),e.doc=s}e.doc.forEach(d=>this.docTranslator(e,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(t,e=tt,l=void 0,s=void 0,u=void 0,d=void 0,S=void 0,g=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:X,id:n,descriptions:[],type:e,doc:l,note:u,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=l),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),u){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=u,T.note.text=W.sanitizeText(T.note.text,w())}d&&(_.info("Setting state classes",n,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(n,m.trim()))),S&&(_.info("Setting state styles",n,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(n,m.trim()))),g&&(_.info("Setting state styles",n,S),(Array.isArray(g)?g:[g]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$t(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,l){this.links.set(t,{url:e,tooltip:l}),_.warn("Adding link",t,e,l)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=tt){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=tt){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,l=""){const s=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),d=this.startIdIfNeeded(e.id.trim()),S=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(d,S,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:W.sanitizeText(l,w())})}addRelation(t,e,l){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,l);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),d=this.endIdIfNeeded(e.trim()),S=this.endTypeIfNeeded(e);this.addState(s,u),this.addState(d,S),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:l?W.sanitizeText(l,w()):void 0})}}addDescription(t,e){const l=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;l?.descriptions?.push(W.sanitizeText(s,w()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const l=this.classes.get(t);e&&l&&e.split(v.STYLECLASS_SEP).forEach(s=>{const u=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){const S=u.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);l.textStyles.push(S)}l.styles.push(u)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(l=>{let s=this.getState(l);if(!s){const u=l.trim();this.addState(u),s=this.getState(u)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===It)}getDirection(){return this.getDirectionStatement()?.value??ue}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:It,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=w();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:zt(this.getRootDocV2())}}getConfig(){return w().state}},$e=f(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),Me=$e;export{Ve as S,Ge as a,Ye as b,Me as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js b/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js new file mode 100644 index 0000000000..a835156afd --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js @@ -0,0 +1,231 @@ +import{g as Zt}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as te}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as f,l as _,c as w,r as ee,u as se,a as ie,b as re,g as ae,s as ne,p as oe,q as le,T as ce,k as W,z as he}from"./mermaidParser.worker-Dx4jPi9z.js";var Dt=(function(){var t=f(function(Y,a,c,r){for(c=c||{},r=Y.length;r--;c[Y[r]]=a);return c},"o"),e=[1,2],l=[1,3],s=[1,4],u=[2,4],d=[1,9],S=[1,11],g=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],A=[1,20],k=[1,21],h=[1,22],x=[1,23],D=[1,24],$=[1,26],L=[1,27],P=[1,28],I=[1,29],J=[1,30],st=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],j=[1,34],p=[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],At=[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,c,r,y,E,i,F){var o=i.length-1;switch(E){case 3:return y.setRootDoc(i[o]),i[o];case 4:this.$=[];break;case 5:i[o]!="nl"&&(i[o-1].push(i[o]),this.$=i[o-1]);break;case 6:case 7:this.$=i[o];break;case 8:this.$="nl";break;case 12:this.$=i[o];break;case 13:const q=i[o-1];q.description=y.trimColon(i[o]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[o-2],state2:i[o]};break;case 15:const gt=y.trimColon(i[o]);this.$={stmt:"relation",state1:i[o-3],state2:i[o-1],description:gt};break;case 19:this.$={stmt:"state",id:i[o-3],type:"default",description:"",doc:i[o-1]};break;case 20:var B=i[o],H=i[o-2].trim();if(i[o].match(":")){var ht=i[o].split(":");B=ht[0],H=[H,ht[1]]}this.$={stmt:"state",id:B,type:"default",description:H};break;case 21:this.$={stmt:"state",id:i[o-3],type:"default",description:i[o-5],doc:i[o-1]};break;case 22:this.$={stmt:"state",id:i[o],type:"fork"};break;case 23:this.$={stmt:"state",id:i[o],type:"join"};break;case 24:this.$={stmt:"state",id:i[o],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[o-1].trim(),note:{position:i[o-2].trim(),text:i[o].trim()}};break;case 29:this.$=i[o].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[o].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[o-3],url:i[o-2],tooltip:i[o-1]};break;case 33:this.$={stmt:"click",id:i[o-3],url:i[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[o-1].trim(),classes:i[o].trim()};break;case 36:this.$={stmt:"style",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 37:this.$={stmt:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[o].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:l,6:s},{1:[3]},{3:5,4:e,5:l,6:s},{3:6,4:e,5:l,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],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:N,57:j},{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(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:N,57:j},t(p,[2,17]),t(At,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[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(p,[2,14],{14:[1,71]}),{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,72],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(p,[2,15]),t(p,[2,19]),t(At,u,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,81],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,c){if(c.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=c,r}},"parseError"),parse:f(function(a){var c=this,r=[0],y=[],E=[null],i=[],F=this.table,o="",B=0,H=0,ht=2,q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),M={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(M.yy[Tt]=this.yy[Tt]);b.setInput(a,M.yy),M.yy.lexer=b,M.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var qt=b.options&&b.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(O){r.length=r.length-2*O,E.length=E.length-O,i.length=i.length-O}f(Qt,"popStack");function xt(){var O;return O=y.pop()||b.lex()||q,typeof O!="number"&&(O instanceof Array&&(y=O,O=y.pop()),O=c.symbols_[O]||O),O}f(xt,"lex");for(var C,U,R,_t,z={},ut,G,Lt,dt;;){if(U=r[r.length-1],this.defaultActions[U]?R=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=xt()),R=F[U]&&F[U][C]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in F[U])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(B+1)+`: +`+b.showPosition()+` +Expecting `+dt.join(", ")+", got '"+(this.terminals_[C]||C)+"'":mt="Parse error on line "+(B+1)+": Unexpected "+(C==q?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[C]||C,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(R[0]){case 1:r.push(C),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),C=null,H=b.yyleng,o=b.yytext,B=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],z.$=E[E.length-G],z._$={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&&(z._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(z,[o,H,B,M.yy,R[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_[R[1]][0]),E.push(z.$),i.push(z._$),Lt=F[r[r.length-2]][r[r.length-1]],r.push(Lt);break;case 3:return!0}}return!0},"parse")},Jt=(function(){var Y={EOF:1,parseError:f(function(c,r){if(this.yy.parser)this.yy.parser.parseError(c,r);else throw new Error(c)},"parseError"),setInput:f(function(a,c){return this.yy=c||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 c=a.match(/(?:\r\n?|\n).*/g);return c?(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 c=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;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),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===y.length?this.yylloc.first_column:0)+y[y.length-r.length].length-r[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),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(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:f(function(a,c){var r,y,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),y=a[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,r,y;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=r,y=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,E[y]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var c=this.next();return c||this.lex()},"lex"),begin:f(function(c){this.conditionStack.push(c)},"begin"),popState:f(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:f(function(c){this.begin(c)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(c,r,y,E){function i(){const F=r.yytext.indexOf("%%");if(F===0)return!1;if(F>0){const o=r.yytext.slice(0,F),B=r.yytext.slice(F);B&&c.lexer.unput(B),r.yytext=o}return!0}switch(f(i,"processId"),y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return i()?(this.popState(),"ID"):void 0;case 65:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 67:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return i()?24:void 0;case 73:return r.yytext=r.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return Y})();yt.lexer=Jt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();Dt.parser=Dt;var Ge=Dt,ue="TB",Ft="TB",It="dir",X="state",K="root",vt="relation",de="classDef",fe="style",pe="applyClass",tt="default",Bt="divider",Gt="fill:none",Yt="fill: #333",Vt="c",Mt="markdown",Ut="normal",bt="rect",kt="rectWithTitle",Se="stateStart",ye="stateEnd",Ot="divider",Nt="roundedWithTitle",ge="note",Te="noteGroup",et="statediagram",Ee="state",_e=`${et}-${Ee}`,Wt="transition",me="note",be="note-edge",ke=`${Wt} ${be}`,De=`${et}-${me}`,ve="cluster",Ce=`${et}-${ve}`,Ae="cluster-alt",xe=`${et}-${Ae}`,jt="parent",Ht="note",Le="state",Ct="----",Ie=`${Ct}${Ht}`,Rt=`${Ct}${jt}`,zt=f((t,e=Ft)=>{if(!t.doc)return e;let l=e;for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir"),Oe=f(function(t,e){return e.db.getClasses()},"getClasses"),Ne=f(async function(t,e,l,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:u,state:d,layout:S}=w();s.db.extract(s.db.getRootDocV2());const g=s.db.getData(),n=Zt(e,u);g.type=s.type,g.layoutAlgorithm=S,g.nodeSpacing=d?.nodeSpacing||50,g.rankSpacing=d?.rankSpacing||50,w().look==="neo"?g.markers=["barbNeo"]:g.markers=["barb"],g.diagramId=e,await ee(g,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((A,k)=>{const h=typeof k=="string"?k:typeof k?.id=="string"?k.id:"";if(!h){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const x=n.node()?.querySelectorAll("g");let D;if(x?.forEach(I=>{I.textContent?.trim()===h&&(D=I)}),!D){_.warn("⚠️ Could not find node matching text:",h);return}const $=D.parentNode;if(!$){_.warn("⚠️ Node has no parent, cannot wrap:",h);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),P=A.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),L.setAttribute("target","_blank"),A.tooltip){const I=A.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}$.replaceChild(L,D),L.appendChild(D),_.info("🔗 Wrapped node in tag for:",h,A.url)})}catch(N){_.error("❌ Error injecting clickable links:",N)}se.insertTitle(n,"statediagramTitleText",d?.titleTopMargin??25,s.db.getDiagramTitle()),te(n,m,et,d?.useMaxWidth??!0)},"draw"),Ye={getClasses:Oe,draw:Ne,getDir:zt},pt=new Map,V=0;function St(t="",e=0,l="",s=Ct){const u=l!==null&&l.length>0?`${s}${l}`:"";return`${Le}-${t}${u}-${e}`}f(St,"stateDomId");var Re=f((t,e,l,s,u,d,S,g)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case X:Z(t,n,l,s,u,d,S,g);break;case tt:Z(t,n,l,s,u,d,S,g);break;case vt:{Z(t,n.state1,l,s,u,d,S,g),Z(t,n.state2,l,s,u,d,S,g);const T=S==="neo",m={id:"edge"+V,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:W.sanitizeText(n.description??"",w()),arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,classes:Wt,look:S};u.push(m),V++}break}})},"setupDoc"),wt=f((t,e=Ft)=>{let l=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir");function Q(t,e,l){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(u=>{const d=l.get(u);d&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...d.styles])}));const s=t.find(u=>u.id===e.id);s?Object.assign(s,e):t.push(e)}f(Q,"insertOrUpdateNode");function Kt(t){return t?.classes?.join(" ")??""}f(Kt,"getClassesFromDbInfo");function Xt(t){return t?.styles??[]}f(Xt,"getStylesFromDbInfo");var Z=f((t,e,l,s,u,d,S,g)=>{const n=e.id,T=l.get(n),m=Kt(T),N=Xt(T),A=w();if(_.info("dataFetcher parsedItem",e,T,N),n!=="root"){let k=bt;e.start===!0?k=Se:e.start===!1&&(k=ye),e.type!==tt&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:W.sanitizeText(n,A),cssClasses:`${m} ${_e}`,cssStyles:N});const h=pt.get(n);e.description&&(Array.isArray(h.description)?(h.shape=kt,h.description.push(e.description)):h.description?.length&&h.description.length>0?(h.shape=kt,h.description===n?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=bt,h.description=e.description),h.description=W.sanitizeTextOrArray(h.description,A)),h.description?.length===1&&h.shape===kt&&(h.type==="group"?h.shape=Nt:h.shape=bt),!h.type&&e.doc&&(_.info("Setting cluster for XCX",n,wt(e)),h.type="group",h.isGroup=!0,h.dir=wt(e),h.shape=e.type===Bt?Ot:Nt,h.cssClasses=`${h.cssClasses} ${Ce} ${d?xe:""}`);const x={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:n,dir:h.dir,domId:St(n,V),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:S,labelType:"markdown"};if(x.shape===Ot&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const D={labelStyle:"",shape:ge,label:e.note.text,labelType:"markdown",cssClasses:De,cssStyles:[],cssCompiledStyles:[],id:n+Ie+"-"+V,domId:St(n,V,Ht),type:h.type,isGroup:h.type==="group",padding:A.flowchart?.padding,look:S,position:e.note.position},$=n+Rt,L={labelStyle:"",shape:Te,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,V,jt),type:"group",isGroup:!0,padding:16,look:S,position:e.note.position};V++,L.id=$,D.parentId=$,Q(s,L,g),Q(s,D,g),Q(s,x,g);let P=n,I=D.id;e.note.position==="left of"&&(P=D.id,I=n),u.push({id:P+"-"+I,start:P,end:I,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:ke,arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,look:S})}else Q(s,x,g)}e.doc&&(_.trace("Adding nodes children "),Re(e,e.doc,l,s,u,!d,S,g))},"dataFetcher"),we=f(()=>{pt.clear(),V=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$t=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),Ve=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$t(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case X:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case de:this.addStyleClass(s.id.trim(),s.classes);break;case fe:this.handleStyleDef(s);break;case pe:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),l=w();we(),Z(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,l.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),l=t.styleClass.split(",");for(const s of e){let u=this.getState(s);if(!u){const d=s.trim();this.addState(d),u=this.getState(d)}u&&(u.styles=l.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,l){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===X&&(e.id===v.START_NODE?(e.id=t.id+(l?"_start":"_end"),e.start=l):e.id=e.id.trim()),e.stmt!==K&&e.stmt!==X||!e.doc)return;const s=[];let u=[];for(const d of e.doc)if(d.type===Bt){const S=ft(d);S.doc=ft(u),s.push(S),u=[]}else u.push(d);if(s.length>0&&u.length>0){const d={stmt:X,id:ce(),type:"divider",doc:ft(u)};s.push(ft(d)),e.doc=s}e.doc.forEach(d=>this.docTranslator(e,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(t,e=tt,l=void 0,s=void 0,u=void 0,d=void 0,S=void 0,g=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:X,id:n,descriptions:[],type:e,doc:l,note:u,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=l),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),u){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=u,T.note.text=W.sanitizeText(T.note.text,w())}d&&(_.info("Setting state classes",n,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(n,m.trim()))),S&&(_.info("Setting state styles",n,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(n,m.trim()))),g&&(_.info("Setting state styles",n,S),(Array.isArray(g)?g:[g]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$t(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,l){this.links.set(t,{url:e,tooltip:l}),_.warn("Adding link",t,e,l)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=tt){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=tt){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,l=""){const s=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),d=this.startIdIfNeeded(e.id.trim()),S=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(d,S,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:W.sanitizeText(l,w())})}addRelation(t,e,l){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,l);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),d=this.endIdIfNeeded(e.trim()),S=this.endTypeIfNeeded(e);this.addState(s,u),this.addState(d,S),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:l?W.sanitizeText(l,w()):void 0})}}addDescription(t,e){const l=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;l?.descriptions?.push(W.sanitizeText(s,w()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const l=this.classes.get(t);e&&l&&e.split(v.STYLECLASS_SEP).forEach(s=>{const u=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){const S=u.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);l.textStyles.push(S)}l.styles.push(u)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(l=>{let s=this.getState(l);if(!s){const u=l.trim();this.addState(u),s=this.getState(u)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===It)}getDirection(){return this.getDirectionStatement()?.value??ue}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:It,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=w();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:zt(this.getRootDocV2())}}getConfig(){return w().state}},$e=f(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),Me=$e;export{Ve as S,Ge as a,Ye as b,Me as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js b/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js new file mode 100644 index 0000000000..9822d0ba97 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js @@ -0,0 +1,15 @@ +import{_ as e}from"./mermaidParser.worker-Dx4jPi9z.js";var l=e(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles");export{l as g}; diff --git a/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-_3v8zWlF.js b/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-_3v8zWlF.js new file mode 100644 index 0000000000..1acad63c1c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-FMBD7UC4-_3v8zWlF.js @@ -0,0 +1,15 @@ +import{_ as e}from"./mermaid.core-zKrc8Ye9.js";var l=e(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles");export{l as g}; diff --git a/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js b/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js new file mode 100644 index 0000000000..bc630d08b3 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js @@ -0,0 +1 @@ +import{_ as i,d as l,U as d,j as o}from"./mermaidParser.worker-Dx4jPi9z.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,f as b,w as c,x as d,g as e,m as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-D-Pih1kA.js b/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-D-Pih1kA.js new file mode 100644 index 0000000000..8541e03503 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-ND2GUHAM-D-Pih1kA.js @@ -0,0 +1 @@ +import{_ as i,d as l,R as d,j as o}from"./mermaid.core-zKrc8Ye9.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,f as b,w as c,x as d,g as e,m as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-QZHKN3VN-Dyzf1Pwd.js b/apps/kimi-code/dist-web/assets/chunk-QZHKN3VN-Dyzf1Pwd.js new file mode 100644 index 0000000000..4a83e77265 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-QZHKN3VN-Dyzf1Pwd.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaid.core-zKrc8Ye9.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/kimi-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js b/apps/kimi-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js new file mode 100644 index 0000000000..357d76431a --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.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/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js b/apps/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js new file mode 100644 index 0000000000..0551a8e8df --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Dn5wkDO_.js";import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";import"./chunk-FMBD7UC4-B2zs_Y-d.js";import"./chunk-ND2GUHAM-C4-rwdcv.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.js";var u={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{u as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-DpkPh8gn.js b/apps/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-DpkPh8gn.js new file mode 100644 index 0000000000..76dcfff31b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-4FO5ZUOK-DpkPh8gn.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-hp-BfASB.js";import{_ as i}from"./mermaid.core-zKrc8Ye9.js";import"./chunk-FMBD7UC4-_3v8zWlF.js";import"./chunk-ND2GUHAM-D-Pih1kA.js";import"./chunk-55IACEB6-mUr9lxTD.js";import"./chunk-2J33WTMH-BlbqWzB_.js";import"./index-DtRfJ0vw.js";var n={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{n as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js new file mode 100644 index 0000000000..0551a8e8df --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Dn5wkDO_.js";import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";import"./chunk-FMBD7UC4-B2zs_Y-d.js";import"./chunk-ND2GUHAM-C4-rwdcv.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.js";var u={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{u as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-DpkPh8gn.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-DpkPh8gn.js new file mode 100644 index 0000000000..76dcfff31b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-DpkPh8gn.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-hp-BfASB.js";import{_ as i}from"./mermaid.core-zKrc8Ye9.js";import"./chunk-FMBD7UC4-_3v8zWlF.js";import"./chunk-ND2GUHAM-D-Pih1kA.js";import"./chunk-55IACEB6-mUr9lxTD.js";import"./chunk-2J33WTMH-BlbqWzB_.js";import"./index-DtRfJ0vw.js";var n={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{n as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js b/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js new file mode 100644 index 0000000000..be5a935b36 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js @@ -0,0 +1 @@ +import{b4 as lt,_ as V,l as $,d as gt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as tt}from"./cytoscape.esm-nFXppDBa.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=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 q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,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(),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"),At=Lt;export{At as render}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-FADnp6Lk.js b/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-FADnp6Lk.js new file mode 100644 index 0000000000..18553c61c9 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-S5V4N54A-FADnp6Lk.js @@ -0,0 +1 @@ +import{b4 as lt,_ as V,l as $,d as gt}from"./mermaid.core-zKrc8Ye9.js";import{c as tt}from"./cytoscape.esm-nFXppDBa.js";import"./index-DtRfJ0vw.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=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 q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,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"),Nt=Lt;export{Nt as render}; diff --git a/apps/kimi-code/dist-web/assets/cytoscape.esm-nFXppDBa.js b/apps/kimi-code/dist-web/assets/cytoscape.esm-nFXppDBa.js new file mode 100644 index 0000000000..56e0f5c40d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cytoscape.esm-nFXppDBa.js @@ -0,0 +1,331 @@ +function ks(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Zl(r,e,t){return(e=Ql(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tc(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function ac(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function nc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ic(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(r,e){return jf(r)||ac(r,e)||Us(r,e)||nc()}function pn(r){return ec(r)||tc(r)||Us(r)||ic()}function sc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Ql(r){var e=sc(r,"string");return typeof e=="symbol"?e:e+""}function rr(r){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(r)}function Us(r,e){if(r){if(typeof r=="string")return ks(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ks(r,e):void 0}}var je=typeof window>"u"?null:window,Eo=je?je.navigator:null;je&&je.document;var oc=rr(""),Jl=rr({}),uc=rr(function(){}),lc=typeof HTMLElement>"u"?"undefined":rr(HTMLElement),Ra=function(e){return e&&e.instanceString&&$e(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&rr(e)==oc},$e=function(e){return e!=null&&rr(e)===uc},Ve=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&rr(e)===Jl&&!Ve(e)&&e.constructor===Object},vc=function(e){return e!=null&&rr(e)===Jl},ae=function(e){return e!=null&&rr(e)===rr(1)&&!isNaN(e)},fc=function(e){return ae(e)&&Math.floor(e)===e},yn=function(e){if(lc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ma(e)||jl(e)},Ma=function(e){return Ra(e)==="collection"&&e._private.single},jl=function(e){return Ra(e)==="collection"&&!e._private.single},Ks=function(e){return Ra(e)==="core"},ev=function(e){return Ra(e)==="stylesheet"},cc=function(e){return Ra(e)==="event"},ot=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},dc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},hc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},gc=function(e){return vc(e)&&$e(e.then)},pc=function(){return Eo&&Eo.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Cc=function(e,t){return-1*tv(e,t)},ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+bc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},kc=function(e){var t,a=new RegExp("^"+yc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Dc=function(e){return Bc[e.toLowerCase()]},av=function(e){return(Ve(e)?e:null)||Dc(e)||Tc(e)||kc(e)||Sc(e)},Bc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},nv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=u||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function D(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function B(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,u),w(y)}return d===void 0&&(d=setTimeout(T,u)),h}return P.cancel=D,P.flush=B,P}return li=s,li}var Fc=zc(),Na=La(Fc),vi=je?je.performance:null,ov=vi&&vi.now?function(){return vi.now()}:function(){return Date.now()},Vc=(function(){if(je){if(je.requestAnimationFrame)return function(r){je.requestAnimationFrame(r)};if(je.mozRequestAnimationFrame)return function(r){je.mozRequestAnimationFrame(r)};if(je.webkitRequestAnimationFrame)return function(r){je.webkitRequestAnimationFrame(r)};if(je.msRequestAnimationFrame)return function(r){je.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(ov())},1e3/60)}})(),mn=function(e){return Vc(e)},Xr=ov,Ct=9261,uv=65599,_t=5381,lv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,a=t,n;n=e.next(),!n.done;)a=a*uv+n.value|0;return a},xa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct;return t*uv+e|0},Ea=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;return(t<<5)+t+e|0},qc=function(e,t){return e*2097152+t},jr=function(e){return e[0]*2097152+e[1]},Ua=function(e,t){return[xa(e[0],t[0]),Ea(e[1],t[1])]},Fo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},Js=function(e){e.splice(0,e.length)},Zc=function(e,t){for(var a=0;a"u"?"undefined":rr(Set))!==Jc?Set:jc,Mn=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ks(e)){He("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){He("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new jt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];Ve(t.classes)?l=t.classes:he(t.classes)&&(l=t.classes.split(/\s+/));for(var v=0,f=l.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bD;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;wB;0<=B?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),D=0;D0)for(O.unshift(M);f[_];){var N=f[_];O.unshift(N.edge),O.unshift(N.node),q=N.node,_=q.id()}return o.spawn(O)}}}},sd={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,u=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var T=[],k=i,D=v,B=p[D];T.unshift(k),B!=null&&T.unshift(B),k=g[D],k!=null;)D=k.id(),B=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AB&&(d[D]=B,m[D]=k,b[D]=E),!i){var P=k*v+T;!i&&d[P]>B&&(d[P]=B,m[P]=T,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,se=b(me),de=[],fe=se;;){if(fe==null)return t.spawn();var xe=m(fe),be=xe.edge,Se=xe.pred;if(de.unshift(fe[0]),fe.same(ge)&&de.length>0)break;be!=null&&de.unshift(be),fe=Se}return u.spawn(de)},C=0;C=0;v--){var f=l[v],c=f[1],h=f[2];(t[c]===o&&t[h]===u||t[c]===u&&t[h]===o)&&l.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=hd(i,e,t),a--}return t},gd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/dd);if(i<2){He("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},xd=function(e){return Math.PI*e/180},Ka=function(e,t){return Math.atan2(t,e)-Math.PI/2},js=Math.log2||function(r){return Math.log(r)/Math.log(2)},eo=function(e){return e>0?1:e<0?-1:0},Dt=function(e,t){return Math.sqrt(xt(e,t))},xt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Ed=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Td=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Sd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},kd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},pv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},sn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},on=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Qe(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Wo=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ro=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},at=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},$o=function(e,t){return at(e,t.x,t.y)},yv=function(e,t){return at(e,t.x1,t.y1)&&at(e,t.x2,t.y2)},Dd=(di=Math.hypot)!==null&&di!==void 0?di:function(r,e){return Math.sqrt(r*r+e*e)};function Bd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Dd(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,D=0;D7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?lt(i,s):u,v=i/2,f=s/2;l=Math.min(l,v,f);var c=l!==v,h=l!==f,d;if(c){var y=a-v+l-o,g=n-f-o,p=a+v-l+o,m=g;if(d=nt(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+l-o,E=b,C=n+f-l+o;if(d=nt(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+l-o,T=n+f+o,k=a+v-l+o,D=T;if(d=nt(e,t,a,n,x,T,k,D,!1),d.length>0)return d}if(h){var B=a-v-o,P=n-f+l-o,A=B,R=n+f-l+o;if(d=nt(e,t,a,n,B,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+l,M=n-f+l;if(L=ga(e,t,a,n,I,M,l+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-l,q=n-f+l;if(L=ga(e,t,a,n,O,q,l+o),L.length>0&&L[0]>=O&&L[1]<=q)return[L[0],L[1]]}{var _=a+v-l,N=n+f-l;if(L=ga(e,t,a,n,_,N,l+o),L.length>0&&L[0]>=_&&L[1]>=N)return[L[0],L[1]]}{var F=a-v+l,U=n+f-l;if(L=ga(e,t,a,n,F,U,l+o),L.length>0&&L[0]<=F&&L[1]>=U)return[L[0],L[1]]}return[]},Ad=function(e,t,a,n,i,s,o){var u=o,l=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return l-u<=e&&e<=v+u&&f-u<=t&&t<=c+u},Rd=function(e,t,a,n,i,s,o,u,l){var v={x1:Math.min(a,o,i)-l,x2:Math.max(a,o,i)+l,y1:Math.min(n,u,s)-l,y2:Math.max(n,u,s)+l};return!(ev.x2||tv.y2)},Md=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-t+s)/o,l=(-t-s)/o;return[u,l]},Ld=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,u,l,v,f,c,h,d;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,o=u*u*u+l*l,i[1]=0,h=t/3,o>0){f=l+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=l-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}u=-u,v=u*u*u,v=Math.acos(l/Math.sqrt(v)),d=2*Math.sqrt(u),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Id=function(e,t,a,n,i,s,o,u){var l=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*u-n*t+2*s*s+2*s*t-u*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Ld(l,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wl?(e-i)*(e-i)+(t-s)*(t-s):v-c},Er=function(e,t,a){for(var n,i,s,o,u,l=0,v=0;v=e&&e>=s||n<=e&&e<=s)u=(e-n)/(s-n)*(o-i)+i,u>t&&l++;else continue;return l%2!==0},Yr=function(e,t,a,n,i,s,o,u,l){var v=new Array(a.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=xn(v,-l);y=wn(g)}else y=v;return Er(e,t,y)},Nd=function(e,t,a,n,i,s,o,u){for(var l=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*u[0]+e,w=m[0]*u[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*u[0]+e,C=m[1]*u[1]+t;return[b,w,E,C]}else return[b,w]},hi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},nt=function(e,t,a,n,i,s,o,u,l){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=u-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:l?[e+b*f,t+b*d]:[]}else return g===0||p===0?hi(e,a,o)===o?[o,u]:hi(e,a,i)===i?[i,s]:hi(i,o,a)===a?[a,n]:[]:[]},Fd=function(e,t,a,n,i){var s=[],o=n/2,u=i/2,l=t,v=a;s.push({x:l+o*e[0],y:v+u*e[1]});for(var f=1;f0){var y=xn(f,-u);h=wn(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return l[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[B]+I&&(x[A]=x[B]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[B]+I&&(C[A]=C[A]+C[B],E[A].push(B))}else for(var M=0;M0;){for(var N=w.pop(),F=0;F0&&o.push(a[u]);o.length!==0&&i.push(n.collection(o))}return i},jd=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:th,o=n,u,l,v=0;v=2?ua(e,t,a,0,Zo,ah):ua(e,t,a,0,Yo)},squaredEuclidean:function(e,t,a){return ua(e,t,a,0,Zo)},manhattan:function(e,t,a){return ua(e,t,a,0,Yo)},max:function(e,t,a){return ua(e,t,a,-1/0,nh)}};Zt["squared-euclidean"]=Zt.squaredEuclidean;Zt.squaredeuclidean=Zt.squaredEuclidean;function In(r,e,t,a,n,i){var s;return $e(r)?s=r:s=Zt[r]||Zt.euclidean,e===0&&$e(r)?s(n,i):s(e,t,a,n,i)}var ih=vr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ao=function(e){return ih(e)},En=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},u=function(c){return n[c](t)},l=a,v=t;return In(e,n.length,o,u,l,v)},pi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),u=null,l=0;la)return!1}return!0},uh=function(e,t,a){for(var n=0;no&&(o=t[l][v],u=v);i[u].push(e[l])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="max"?(u=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},tu=function(e,t,a){for(var n=[],i=0;io&&(s=l,o=t[i*e+l])}s>0&&n.push(s)}for(var v=0;vl&&(u=v,l=f)}a[i]=s[u]}return n=tu(e,t,a),n},au=function(e){for(var t=this.cy(),a=this.nodes(),n=wh(e),i={},s=0;s=B?(P=B,B=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+F]=U,N+=U}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var J=0,Z=0;Z1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(T){T.isEdge()&&f[b].push(T.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(u?l?o=!0:l=b:u=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(l&&u)if(i){if(v&&l!=v)return h;v=l}else{if(v&&l!=v&&u!=v)return h;v||(v=l)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,T;f[w].length;)C=f[w].shift(),x=c[C][0],T=c[C][1],w!=T?(f[T]=f[T].filter(function(k){return k!=C}),w=T):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Ya=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},u=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},l=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(l(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,u(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Bh={hopcroftTarjanBiconnected:Ya,htbc:Ya,htb:Ya,hopcroftTarjanBiconnectedComponents:Ya},Za=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var v=e.getElementById(l).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==l&&(g in t||o(g),t[g].explored||(t[l].low=Math.min(t[l].low,t[g].low)))}),t[l].index===t[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||o(l)}}),{cut:s,components:n}},Ph={tarjanStronglyConnected:Za,tsc:Za,tscc:Za,tarjanStronglyConnectedComponents:Za},Sv={};[Ca,id,sd,ud,vd,cd,gd,Gd,Ut,Kt,Ps,rh,hh,mh,Sh,Dh,Bh,Ph].forEach(function(r){ye(Sv,r)});/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/var kv=0,Dv=1,Bv=2,Or=function(e){if(!(this instanceof Or))return new Or(e);this.id="Thenable/1.0.7",this.state=kv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Or.prototype={fulfill:function(e){return nu(this,Dv,"fulfillValue",e)},reject:function(e){return nu(this,Bv,"rejectReason",e)},then:function(e,t){var a=this,n=new Or;return a.onFulfilled.push(su(e,n,"fulfill")),a.onRejected.push(su(t,n,"reject")),Pv(a),n.proxy}};var nu=function(e,t,a,n){return e.state===kv&&(e.state=t,e[a]=n,Pv(e)),e},Pv=function(e){e.state===Dv?iu(e,"onFulfilled",e.fulfillValue):e.state===Bv&&iu(e,"onRejected",e.rejectReason)},iu=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return Fi=e,Fi}var Vi,Pu;function Xh(){if(Pu)return Vi;Pu=1;var r=zn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return Vi=e,Vi}var qi,Au;function Yh(){if(Au)return qi;Au=1;var r=Wh(),e=$h(),t=Uh(),a=Kh(),n=Xh();function i(s){var o=-1,u=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ve(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};un.className=un.classNames=un.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:er,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+";Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+";Re.value=Re.string+"|"+Re.number;Re.id=Re.variable;(function(){var r,e,t;for(r=Re.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)})();var Fe=function(){return{checks:[]}},ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Ls=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Cc(r.selector,e.selector)}),kg=(function(){for(var r={},e,t=0;t0&&v.edgeCount>0)return ze("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return ze("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&ze("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Mg=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return he(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case ue.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case ue.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(h)+"]"}case ue.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case ue.DATA_EXIST:{var b=v.field;return"["+b+"]"}case ue.META_COMPARE:{var w=v.operator,E=v.field;return"[["+E+a(e(w))+t(h)+"]]"}case ue.STATE:return h;case ue.ID:return"#"+h;case ue.CLASS:return"."+h;case ue.PARENT:case ue.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case ue.ANCESTOR:case ue.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case ue.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),T=i(v.right,f);return C+(C.length>0?" ":"")+x+T}case ue.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||o||v)&&(u=!i&&!s?"":""+e,l=""+a),v&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e0;){var v=n.shift();e(v),i.add(v.id()),o&&a(n,i,v)}return r}function zv(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,zv)};function Fv(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Qt.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,Fv)};function qg(r,e,t){Fv(r,e,t),zv(r,e,t)}Qt.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,qg)};Qt.ancestors=Qt.parents;var ka,Vv;ka=Vv={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ne.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ne.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ka.attr=ka.data;ka.removeAttr=ka.removeData;var _g=Vv,Vn={};function hs(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;se}),minIndegree:It("indegree",function(r,e){return re}),minOutdegree:It("outdegree",function(r,e){return re})});ye(Vn,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?l.position(e,t+h[e]):i!==void 0&&l.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),y=o?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:d.x-m.x,y:d.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}};Ir.modelPosition=Ir.point=Ir.position;Ir.modelPositions=Ir.points=Ir.positions;Ir.renderedPoint=Ir.renderedPosition;Ir.relativePoint=Ir.relativePosition;var Gg=qv,Xt,gt;Xt=gt={};gt.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}};gt.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};gt.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=o.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(k,D,B){var P=0,A=0,R=D+B;return k>0&&R>0&&(P=D/R*k,A=B/R*k),{biasDiff:P,biasComplementDiff:A}}function d(k,D,B,P){if(B.units==="%")switch(P){case"width":return k>0?B.pfValue*k:0;case"height":return D>0?B.pfValue*D:0;case"average":return k>0&&D>0?B.pfValue*(k+D)/2:0;case"min":return k>0&&D>0?k>D?B.pfValue*D:B.pfValue*k:0;case"max":return k>0&&D>0?k>D?B.pfValue*k:B.pfValue*D:0;default:return 0}else return B.units==="px"?B.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=h(v.width.val-f.w,y,g),w=b.biasDiff,E=b.biasComplementDiff,C=h(v.height.val-f.h,p,m),x=C.biasDiff,T=C.biasComplementDiff;o.autoPadding=d(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+E)/2,o.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+T)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},rt=function(e,t){return t==null?e:Lr(e,t.x1,t.y1,t.x2,t.y2)},la=function(e,t,a){return xr(e,t,a)},Qa=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,u,l;if(o!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=u-s,f.y1=l-s,f.x2=u+s,f.y2=l+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,sn(f,1),Lr(e,f.x1,f.y1,f.x2,f.y2)}}},gs=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),v=la(s,"labelWidth",a),f=la(s,"labelHeight",a),c=la(s,"labelX",a),h=la(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,E=t.pstyle("text-background-padding").pfValue,C=2,x=f,T=v,k=T/2,D=x/2,B,P,A,R;if(g)B=c-k,P=c+k,A=h-D,R=h+D;else{switch(u.value){case"left":B=c-T,P=c;break;case"center":B=c-k,P=c+k;break;case"right":B=c,P=c+T;break}switch(l.value){case"top":A=h-x,R=h;break;case"center":A=h-D,R=h+D;break;case"bottom":A=h,R=h+x;break}}var L=d-Math.max(m,w)-E-C,I=d+Math.max(m,w)+E+C,M=y-Math.max(m,w)-E-C,O=y+Math.max(m,w)+E+C;B+=L,P+=I,A+=M,R+=O;var q=a||"main",_=i.labelBounds,N=_[q]=_[q]||{};N.x1=B,N.y1=A,N.x2=P,N.y2=R,N.w=P-B,N.h=R-A,N.leftPad=L,N.rightPad=I,N.topPad=M,N.botPad=O;var F=g&&p.strValue==="autorotate",U=p.pfValue!=null&&p.pfValue!==0;if(F||U){var J=F?la(i.rstyle,"labelAngle",a):p.pfValue,Z=Math.cos(J),j=Math.sin(J),re=(B+P)/2,ne=(A+R)/2;if(!g){switch(u.value){case"left":re=P;break;case"right":re=B;break}switch(l.value){case"top":ne=R;break;case"bottom":ne=A;break}}var Q=function(we,me){return we=we-re,me=me-ne,{x:we*Z-me*j+re,y:we*j+me*Z+ne}},V=Q(B,A),H=Q(B,R),W=Q(P,A),Y=Q(P,R);B=Math.min(V.x,H.x,W.x,Y.x),P=Math.max(V.x,H.x,W.x,Y.x),A=Math.min(V.y,H.y,W.y,Y.y),R=Math.max(V.y,H.y,W.y,Y.y)}var te=q+"Rot",ce=_[te]=_[te]||{};ce.x1=B,ce.y1=A,ce.x2=P,ce.y2=R,ce.w=P-B,ce.h=R-A,Lr(e,B,A,P,R),Lr(i.labelBounds.all,B,A,P,R)}return e}},il=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,s=n+i;Gv(e,t,a,s,"outside",s/2)}},Gv=function(e,t,a,n,i,s){if(!(a===0||n<=0||i==="inside")){var o=t.cy(),u=o.renderer(),l=u.nodeShapes[u.getNodeShape(t)];if(l){var v=t.position(),f=v.x,c=v.y,h=t.width(),d=t.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var y=l.miterBounds(f,c,h,d,n);rt(e,y)}else s!=null&&s>0&&on(e,[s,s,s,s])}}},Hg=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Gv(e,t,a,n,i)}},Wg=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=yr(),o=e._private,u=e.isNode(),l=e.isEdge(),v,f,c,h,d,y,g=o.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Be){return Be.pstyle("display").value!=="none"},b=!n||m(e)&&(!l||m(e.source())&&m(e.target()));if(b){var w=0,E=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var T=Math.max(E,x),k=0,D=0;if(n&&(k=e.pstyle("width").pfValue,D=k/2),u&&t.includeNodes){var B=e.position();d=B.x,y=B.y;var P=e.outerWidth(),A=P/2,R=e.outerHeight(),L=R/2;v=d-A,f=d+A,c=y-L,h=y+L,Lr(s,v,c,f,h),n&&il(s,e),n&&t.includeOutlines&&!i&&il(s,e),n&&Hg(s,e)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=D,f+=D,c-=D,h+=D,Lr(s,v,c,f,h),I==="haystack"){var M=g.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var O=v;v=f,f=O}if(c>h){var q=c;c=h,h=q}Lr(s,v-D,c-D,f+D,h+D)}}else if(I==="bezier"||I==="unbundled-bezier"||tt(I,"segments")||tt(I,"taxi")){var _;switch(I){case"bezier":case"unbundled-bezier":_=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=g.linePts;break}if(_!=null)for(var N=0;N<_.length;N++){var F=_[N];v=F.x-D,f=F.x+D,c=F.y-D,h=F.y+D,Lr(s,v,c,f,h)}}}else{var U=e.source(),J=U.position(),Z=e.target(),j=Z.position();if(v=J.x,f=j.x,c=J.y,h=j.y,v>f){var re=v;v=f,f=re}if(c>h){var ne=c;c=h,h=ne}v-=D,f+=D,c-=D,h+=D,Lr(s,v,c,f,h)}if(n&&t.includeEdges&&l&&(Qa(s,e,"mid-source"),Qa(s,e,"mid-target"),Qa(s,e,"source"),Qa(s,e,"target")),n){var Q=e.pstyle("ghost").value==="yes";if(Q){var V=e.pstyle("ghost-offset-x").pfValue,H=e.pstyle("ghost-offset-y").pfValue;Lr(s,s.x1+V,s.y1+H,s.x2+V,s.y2+H)}}var W=o.bodyBounds=o.bodyBounds||{};Wo(W,s),on(W,p),sn(W,1),n&&(v=s.x1,f=s.x2,c=s.y1,h=s.y2,Lr(s,v-T,c-T,f+T,h+T));var Y=o.overlayBounds=o.overlayBounds||{};Wo(Y,s),on(Y,p),sn(Y,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?Sd(te.all):te.all=yr(),n&&t.includeLabels&&(t.includeMainLabels&&gs(s,e,null),l&&(t.includeSourceLabels&&gs(s,e,"source"),t.includeTargetLabels&&gs(s,e,"target")))}return s.x1=Dr(s.x1),s.y1=Dr(s.y1),s.x2=Dr(s.x2),s.y2=Dr(s.y2),s.w=Dr(s.x2-s.x1),s.h=Dr(s.y2-s.y1),s.w>0&&s.h>0&&b&&(on(s,p),sn(s,1)),s},Hv=function(e){var t=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:ip,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};ct.removeAllListeners=function(){return this.removeListener("*")};ct.emit=ct.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ve(e)||(e=[e]),sp(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(){var v=a[u];if(v.type===s.type&&(!v.namespace||v.namespace===s.namespace||v.namespace===np)&&i.eventMatches(i.context,v,s)){var f=[s];e!=null&&Zc(f,e),i.beforeEmit(i.context,v,s),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==v}));var c=i.callbackContext(i.context,v,s),h=v.callback.apply(c,f);i.afterEmit(i.context,v,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&he(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;ia&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":rr(Symbol))!=e&&rr(Symbol.iterator)!=e;t&&(Cn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Zl({next:function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Me(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(he(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(v[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});dr.neighbourhood=dr.neighborhood;dr.closedNeighbourhood=dr.closedNeighborhood;dr.openNeighbourhood=dr.openNeighborhood;ye(dr,{source:Br(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Br(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:pl({attr:"source"}),targets:pl({attr:"target"})});function pl(r){return function(t){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});dr.componentsOf=dr.components;var lr=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){He("A collection must have a reference to the core");return}var i=new Kr,s=!1;if(!t)t=[];else if(t.length>0&&Me(t[0])&&!Ma(t[0])){s=!0;for(var o=[],u=new jt,l=0,v=t.length;l0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,u=0,l=t.length;u0){for(var q=o.length===t.length?t:new lr(a,o),_=0;_0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(R){for(var L=R._private.edges,I=0;I0&&(r?B.emitAndNotify("remove"):e&&B.emit("remove"));for(var P=0;P0?P=R:B=R;while(Math.abs(A)>s&&++L=i?m(D,L):I===0?L:w(D,B,B+l)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var T=function(B){return C||x(),r===e&&t===a?B:B===0?0:B===1?1:g(E(B),e,a)};T.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var k="generateBezier("+[r,e,t,a]+")";return T.toString=function(){return k},T}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var yp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),u=e(a,n,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),v=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+v*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(l=a(n,i),h=l/s*f):h=f;d=t(d||o,h),u.push(1+d.x),l+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(y){return u[y*(u.length-1)|0]}:l}})(),qe=function(e,t,a,n){var i=pp(e,t,a,n);return function(s,o,u){return s+(o-s)*i(u)}},vn={linear:function(e,t,a){return e+(t-e)*a},ease:qe(.25,.1,.25,1),"ease-in":qe(.42,0,1,1),"ease-out":qe(0,0,.58,1),"ease-in-out":qe(.42,0,.58,1),"ease-in-sine":qe(.47,0,.745,.715),"ease-out-sine":qe(.39,.575,.565,1),"ease-in-out-sine":qe(.445,.05,.55,.95),"ease-in-quad":qe(.55,.085,.68,.53),"ease-out-quad":qe(.25,.46,.45,.94),"ease-in-out-quad":qe(.455,.03,.515,.955),"ease-in-cubic":qe(.55,.055,.675,.19),"ease-out-cubic":qe(.215,.61,.355,1),"ease-in-out-cubic":qe(.645,.045,.355,1),"ease-in-quart":qe(.895,.03,.685,.22),"ease-out-quart":qe(.165,.84,.44,1),"ease-in-out-quart":qe(.77,0,.175,1),"ease-in-quint":qe(.755,.05,.855,.06),"ease-out-quint":qe(.23,1,.32,1),"ease-in-out-quint":qe(.86,0,.07,1),"ease-in-expo":qe(.95,.05,.795,.035),"ease-out-expo":qe(.19,1,.22,1),"ease-in-out-expo":qe(1,0,0,1),"ease-in-circ":qe(.6,.04,.98,.335),"ease-out-circ":qe(.075,.82,.165,1),"ease-in-out-circ":qe(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return vn.linear;var n=yp(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":qe};function bl(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function wl(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Ot(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=wl(r,n),o=wl(e,n);if(ae(s)&&ae(o))return bl(i,s,o,t,a);if(Ve(s)&&Ve(o)){for(var u=[],l=0;l0?(h==="spring"&&d.push(s.duration),s.easingImpl=vn[h].apply(null,d)):s.easingImpl=vn[h]}var y=s.easingImpl,g;if(s.duration===0?g=1:g=(t-u)/s.duration,s.applying&&(g=s.progress),g<0?g=0:g>1&&(g=1),s.delay==null){var p=s.startPosition,m=s.position;if(m&&n&&!r.locked()){var b={};fa(p.x,m.x)&&(b.x=Ot(p.x,m.x,g,y)),fa(p.y,m.y)&&(b.y=Ot(p.y,m.y,g,y)),r.position(b)}var w=s.startPan,E=s.pan,C=i.pan,x=E!=null&&a;x&&(fa(w.x,E.x)&&(C.x=Ot(w.x,E.x,g,y)),fa(w.y,E.y)&&(C.y=Ot(w.y,E.y,g,y)),r.emit("pan"));var T=s.startZoom,k=s.zoom,D=k!=null&&a;D&&(fa(T,k)&&(i.zoom=Ta(i.minZoom,Ot(T,k,g,y),i.maxZoom)),r.emit("zoom")),(x||D)&&r.emit("viewport");var B=s.style;if(B&&B.length>0&&n){for(var P=0;P=0;x--){var T=C[x];T()}C.splice(0,C.length)},m=h.length-1;m>=0;m--){var b=h[m],w=b._private;if(w.stopped){h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||bp(v,b,r),mp(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),y}for(var i=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var wp={animate:Ne.animate(),animation:Ne.animation(),animated:Ne.animated(),clearQueue:Ne.clearQueue(),delay:Ne.delay(),delayAnimation:Ne.delayAnimation(),stop:Ne.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&mn(function(i){xl(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){xl(s,e)},a.beforeRenderPriorities.animations):t()}},xp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Ma(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},en=function(e){return he(e)?new vt(e):e},ef={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new qn(xp,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,en(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,en(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,en(t),a),this},once:function(e,t,a){return this.emitter().one(e,en(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Ne.eventAliasesOn(ef);var Os={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Os.jpeg=Os.jpg;var fn={layout:function(e){var t=this;if(e==null){He("Layout options must be specified to make a layout");return}if(e.name==null){He("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){He("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;he(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(ye({},e,{cy:t,eles:i}));return s}};fn.createLayout=fn.makeLayout=fn.layout;var Ep={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Ns.invalidateDimensions=Ns.resize;var cn={collection:function(e,t){return he(e)?this.$(e):Tr(e)?e.collection():Ve(e)?(t||(t={}),new lr(this,e,t.unique,t.removed)):new lr(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};cn.elements=cn.filter=cn.$;var sr={},ma="t",Tp="f";sr.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i0;if(c||f&&h){var d=void 0;c&&h||c?d=l.properties:h&&(d=l.mappedProperties);for(var y=0;y1&&(w=1),o.color){var C=a.valueMin[0],x=a.valueMax[0],T=a.valueMin[1],k=a.valueMax[1],D=a.valueMin[2],B=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(x-C)*w),Math.round(T+(k-T)*w),Math.round(D+(B-D)*w),Math.round(P+(A-P)*w)];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var L=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,L,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),M=f.data,O=0;O0&&i>0){for(var o={},u=!1,l=0;l0?r.delayAnimation(s).play().promise().then(b):b()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};sr.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);r.removed()||o!=null&&o(t,a,r)&&i(s)};sr.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};sr.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};sr.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var Va={};Va.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){ze("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new vt(f);if(c.invalid){ze("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),o();continue}}var h=v[2],d=!1;i=h;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){ze("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}s=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){ze("Skipping property: Invalid property name in: "+s),u();continue}var E=t.parse(m,b);if(!E){ze("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:m,val:b}),u()}if(d){o();break}t.selector(f);for(var C=0;C=7&&e[0]==="d"&&(v=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(o.mapData.regex).exec(e))){if(t||l.multiple)return!1;var h=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(d.pfValue===y.pfValue||d.strValue===y.strValue)return ze("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(l.color){var g=d.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:y.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Ve(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],x="",T=!1,k=0;k0?" ":"")+D.strValue}return l.validate&&!l.validate(w,E)?null:l.singleEnum&&T?w.length===1&&he(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:E}}var B=function(){for(var Q=0;Ql.max||l.strictMax&&e===l.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return l.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:xd(e)),P==="%"&&(I.pfValue=e/100),I}else if(l.propList){var M=[],O=""+e;if(O!=="none"){for(var q=O.split(/\s*,\s*|\s+/),_=0;_0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((s-2*t)/a.w,(o-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Me(e)&&(s=e.level,e.position!=null?i=Ln(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;ae(l.x)&&(t.pan.x=l.x,o=!1),ae(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(he(e)){var a=e;e=this.mutableElements().filter(a)}else Tr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Pt.centre=Pt.center;Pt.autolockNodes=Pt.autolock;Pt.autoungrabifyNodes=Pt.autoungrabify;var Ba={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Ba.attr=Ba.data;Ba.removeAttr=Ba.removeData;var Pa=function(e){var t=this;e=ye({},e);var a=e.container;a&&!yn(a)&&yn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var s=je!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=ye({name:s?"grid":"null"},o.layout),o.renderer=ye({name:s?"canvas":"null"},o.renderer);var u=function(d,y,g){return y!==void 0?y:g!==void 0?g:d},l=this._private={container:a,ready:!1,options:o,elements:new lr(this),listeners:[],aniEles:new lr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Me(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Me(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var v=function(d,y){var g=d.some(gc);if(g)return ea.all(d).then(y);y(d)};l.styleEnabled&&t.setStyle([]);var f=ye({},o,o.renderer);t.initRenderer(f);var c=function(d,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Me(d)||Ve(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=ye({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([o.style,o.elements],function(h){var d=h[0],y=h[1];l.styleEnabled&&t.style().append(d),c(y,function(){t.startAnimationLoop(),l.ready=!0,$e(o.ready)&&t.on("ready",o.ready);for(var g=0;g0,o=!!r.boundingBox,u=yr(o?r.boundingBox:structuredClone(e.extent())),l;if(Tr(r.roots))l=r.roots;else if(Ve(r.roots)){for(var v=[],f=0;f0;){var R=A(),L=k(R,B);if(L)R.outgoers().filter(function(ge){return ge.isNode()&&t.has(ge)}).forEach(P);else if(L===null){ze("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var M=0;M0&&p[0].length<=3?be/2:0),De=2*Math.PI/p[fe].length*xe;return fe===0&&p[0].length===1&&(Se=1),{x:W.x+Se*Math.cos(De),y:W.y+Se*Math.sin(De)}}else{var Oe=p[fe].length,Le=Math.max(Oe===1?0:o?(u.w-r.padding*2-Y.w)/((r.grid?ce:Oe)-1):(u.w-r.padding*2-Y.w)/((r.grid?ce:Oe)+1),I),Ae={x:W.x+(xe+1-(Oe+1)/2)*Le,y:W.y+(fe+1-(Z+1)/2)*te};return Ae}},we={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(we).indexOf(r.direction)===-1&&He("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(we).join(", ")));var me=function(se){return Wc(Be(se),u,we[r.direction])};return t.nodes().layoutPositions(this,r,me),this};var Pp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function tf(r){this.options=ye({},Pp,r)}tf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),v,f=0,c=0;c1&&e.avoidOverlap){f*=1.75;var p=Math.cos(l)-Math.cos(0),m=Math.sin(l)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,x){var T=e.startAngle+x*l*(n?1:-1),k=v*Math.cos(T),D=v*Math.sin(T),B={x:o.x+k,y:o.y+D};return B};return a.nodes().layoutPositions(this,e,w),this};var Ap={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function af(r){this.options=ye({},Ap,r)}af.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,v=0;v0){var E=Math.abs(m[0].value-w.value);E>=g&&(m=[],p.push(m))}m.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=p.length>0&&p[0].length>1,T=Math.min(s.w,s.h)/2-C,k=T/(p.length+x?1:0);C=Math.min(C,k)}for(var D=0,B=0;B1&&e.avoidOverlap){var L=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),M=Math.sqrt(C*C/(L*L+I*I));D=Math.max(M,D)}P.r=D,D+=C}if(e.equidistant){for(var O=0,q=0,_=0;_=r.numIter||(zp(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature=r.animationThreshold&&i(),mn(v)}};v()}else{for(;l;)l=s(u),u++;Tl(a,r),o()}return this};$n.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};$n.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Mp=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=yr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=a.eles.components(),l={},v=0;v0){o.graphSet.push(T);for(var v=0;vn.count?0:n.graph},nf=function(e,t,a,n){var i=n.graphSet[a];if(-10)var f=n.nodeOverlap*v,c=Math.sqrt(o*o+u*u),h=f*o/c,d=f*u/c;else var y=Sn(e,o,u),g=Sn(t,-1*o,-1*u),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*p/c,d=f*m/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},qp=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Sn=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=a/t,l=s/o,v={};return t===0&&0a?(v.x=n,v.y=i+s/2,v):0t&&-1*l<=u&&u<=l?(v.x=n-o/2,v.y=i-o*a/2/t,v):0=l)?(v.x=n+s*t/2/a,v.y=i+s/2,v):(0>a&&(u<=-1*l||u>=l)&&(v.x=n-s*t/2/a,v.y=i-s/2),v)},_p=function(e,t){for(var a=0;aa){var g=t.gravity*h/y,p=t.gravity*d/y;c.offsetX+=g,c.offsetY+=p}}}}},Hp=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},of=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(d+=g+t.componentSpacing,h=0,y=0,g=0)}}},Up={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function uf(r){this.options=ye({},Up,r)}uf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),v=function(J){if(J==null)return Math.min(u,l);var Z=Math.min(u,l);Z==u?u=J:l=J},f=function(J){if(J==null)return Math.max(u,l);var Z=Math.max(u,l);Z==u?u=J:l=J},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)u=c,l=h;else if(c!=null&&h==null)u=c,l=Math.ceil(s/u);else if(c==null&&h!=null)l=h,u=Math.ceil(s/l);else if(l*u>s){var d=v(),y=f();(d-1)*y>=s?v(d-1):(y-1)*d>=s&&f(y-1)}else for(;l*u=s?f(p+1):v(g+1)}var m=i.w/l,b=i.h/u;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w=l&&(L=0,R++)},M={},O=0;O(L=Od(r,e,I[M],I[M+1],I[M+2],I[M+3])))return g(x,L),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var I=k.allpts,M=0;M+5(L=Id(r,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return g(x,L),!0}for(var O=O||T.source,q=q||T.target,_=n.getArrowWidth(D,B),N=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],M=0;M0&&(p(O),p(q))}function b(x,T,k){return xr(x,T,k)}function w(x,T){var k=x._private,D=c,B;T?B=T+"-":B="",x.boundingBox();var P=k.labelBounds[T||"main"],A=x.pstyle(B+"label").value,R=x.pstyle("text-events").strValue==="yes";if(!(!R||!A)){var L=b(k.rscratch,"labelX",T),I=b(k.rscratch,"labelY",T),M=b(k.rscratch,"labelAngle",T),O=x.pstyle(B+"text-margin-x").pfValue,q=x.pstyle(B+"text-margin-y").pfValue,_=P.x1-D-O,N=P.x2+D-O,F=P.y1-D-q,U=P.y2+D-q;if(M){var J=Math.cos(M),Z=Math.sin(M),j=function(Y,te){return Y=Y-L,te=te-I,{x:Y*J-te*Z+L,y:Y*Z+te*J+I}},re=j(_,F),ne=j(_,U),Q=j(N,F),V=j(N,U),H=[re.x+O,re.y+q,Q.x+O,Q.y+q,V.x+O,V.y+q,ne.x+O,ne.y+q];if(Er(r,e,H))return g(x),!0}else if(at(P,r,e))return g(x),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?p(C)||w(C):m(C)||w(C)||w(C,"source")||w(C,"target")}return o};Rt.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],u=Math.min(r,t),l=Math.max(r,t),v=Math.min(e,a),f=Math.max(e,a);r=u,t=l,e=v,a=f;var c=yr({x1:r,y1:e,x2:t,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],d=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function y(Y,te,ce){return xr(Y,te,ce)}function g(Y,te){var ce=Y._private,Be=s,we="";Y.boundingBox();var me=ce.labelBounds.main;if(!me)return null;var ge=y(ce.rscratch,"labelX",te),se=y(ce.rscratch,"labelY",te),de=y(ce.rscratch,"labelAngle",te),fe=Y.pstyle(we+"text-margin-x").pfValue,xe=Y.pstyle(we+"text-margin-y").pfValue,be=me.x1-Be-fe,Se=me.x2+Be-fe,De=me.y1-Be-xe,Oe=me.y2+Be-xe;if(de){var Le=Math.cos(de),Ae=Math.sin(de),X=function(z,G){return z=z-ge,G=G-se,{x:z*Le-G*Ae+ge,y:z*Ae+G*Le+se}};return[X(be,De),X(Se,De),X(Se,Oe),X(be,Oe)]}else return[{x:be,y:De},{x:Se,y:De},{x:Se,y:Oe},{x:be,y:Oe}]}function p(Y,te,ce,Be){function we(me,ge,se){return(se.y-me.y)*(ge.x-me.x)>(ge.y-me.y)*(se.x-me.x)}return we(Y,ce,Be)!==we(te,ce,Be)&&we(Y,te,ce)!==we(Y,te,Be)}for(var m=0;m0?-(Math.PI-e.ang):Math.PI+e.ang},Jp=function(e,t,a,n,i){if(e!==Pl?Al(t,e,Vr):Qp(kr,Vr),Al(t,a,kr),Dl=Vr.nx*kr.ny-Vr.ny*kr.nx,Bl=Vr.nx*kr.nx-Vr.ny*-kr.ny,$r=Math.asin(Math.max(-1,Math.min(1,Dl))),Math.abs($r)<1e-6){zs=t.x,Fs=t.y,Et=zt=0;return}Tt=1,dn=!1,Bl<0?$r<0?$r=Math.PI+$r:($r=Math.PI-$r,Tt=-1,dn=!0):$r>0&&(Tt=-1,dn=!0),t.radius!==void 0?zt=t.radius:zt=n,bt=$r/2,rn=Math.min(Vr.len/2,kr.len/2),i?(zr=Math.abs(Math.cos(bt)*zt/Math.sin(bt)),zr>rn?(zr=rn,Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))):Et=zt):(zr=Math.min(rn,zt),Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))),Vs=t.x+kr.nx*zr,qs=t.y+kr.ny*zr,zs=Vs-kr.ny*Et*Tt,Fs=qs+kr.nx*Et*Tt,cf=t.x+Vr.nx*zr,df=t.y+Vr.ny*zr,Pl=t};function hf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ho(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Jp(r,e,t,a,n),{cx:zs,cy:Fs,radius:Et,startX:cf,startY:df,stopX:Vs,stopY:qs,startAngle:Vr.ang+Math.PI/2*Tt,endAngle:kr.ang-Math.PI/2*Tt,counterClockwise:dn})}var Aa=.01,jp=Math.sqrt(2*Aa),gr={};gr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),u=s.units!=null&&o.units!=null,l=function(E,C,x,T){var k=T-C,D=x-E,B=Math.sqrt(D*D+k*k);return{x:-k/B,y:D/B}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(u){var f=this.manualEndptToPx(r.source()[0],s),c=Qe(f,2),h=c[0],d=c[1],y=this.manualEndptToPx(r.target()[0],o),g=Qe(y,2),p=g[0],m=g[1],b={x1:h,y1:d,x2:p,y2:m};n=l(h,d,p,m),i=b}else ze("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};gr.findHaystackPoints=function(r){for(var e=0;e0?Math.max(G-$,0):Math.min(G+$,0)},A=P(D,T),R=P(B,k),L=!1;m===l?p=Math.abs(A)>Math.abs(R)?n:a:m===u||m===o?(p=a,L=!0):(m===i||m===s)&&(p=n,L=!0);var I=p===a,M=I?R:A,O=I?B:D,q=eo(O),_=!1;!(L&&(w||C))&&(m===o&&O<0||m===u&&O>0||m===i&&O>0||m===s&&O<0)&&(q*=-1,M=q*Math.abs(M),_=!0);var N;if(w){var F=E<0?1+E:E;N=F*M}else{var U=E<0?M:0;N=U+E*q}var J=function(G){return Math.abs(G)=Math.abs(M)},Z=J(N),j=J(Math.abs(M)-Math.abs(N)),re=Z||j;if(re&&!_)if(I){var ne=Math.abs(O)<=c/2,Q=Math.abs(D)<=h/2;if(ne){var V=(v.x1+v.x2)/2,H=v.y1,W=v.y2;t.segpts=[V,H,V,W]}else if(Q){var Y=(v.y1+v.y2)/2,te=v.x1,ce=v.x2;t.segpts=[te,Y,ce,Y]}else t.segpts=[v.x1,v.y2]}else{var Be=Math.abs(O)<=f/2,we=Math.abs(B)<=d/2;if(Be){var me=(v.y1+v.y2)/2,ge=v.x1,se=v.x2;t.segpts=[ge,me,se,me]}else if(we){var de=(v.x1+v.x2)/2,fe=v.y1,xe=v.y2;t.segpts=[de,fe,de,xe]}else t.segpts=[v.x2,v.y1]}else if(I){var be=v.y1+N+(g?c/2*q:0),Se=v.x1,De=v.x2;t.segpts=[Se,be,De,be]}else{var Oe=v.x1+N+(g?f/2*q:0),Le=v.y1,Ae=v.y2;t.segpts=[Oe,Le,Oe,Ae]}if(t.isRound){var X=r.pstyle("taxi-radius").value,S=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(X),t.isArcRadius=new Array(t.segpts.length/2).fill(S)}};gr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,h=e.srcRs,d=e.tgtRs,y=!ae(t.startX)||!ae(t.startY),g=!ae(t.arrowStartX)||!ae(t.arrowStartY),p=!ae(t.endX)||!ae(t.endY),m=!ae(t.arrowEndX)||!ae(t.arrowEndY),b=3,w=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=Dt({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),x=CO.poolIndex()){var q=M;M=O,O=q}var _=A.srcPos=M.position(),N=A.tgtPos=O.position(),F=A.srcW=M.outerWidth(),U=A.srcH=M.outerHeight(),J=A.tgtW=O.outerWidth(),Z=A.tgtH=O.outerHeight(),j=A.srcShape=t.nodeShapes[e.getNodeShape(M)],re=A.tgtShape=t.nodeShapes[e.getNodeShape(O)],ne=A.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,Q=A.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,V=A.tgtRs=O._private.rscratch,H=A.srcRs=M._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W=jp||(De=Math.sqrt(Math.max(Se*Se,Aa)+Math.max(be*be,Aa)));var Oe=A.vector={x:Se,y:be},Le=A.vectorNorm={x:Oe.x/De,y:Oe.y/De},Ae={x:-Le.y,y:Le.x};A.nodesOverlap=!ae(De)||re.checkPoint(me[0],me[1],0,J,Z,N.x,N.y,Q,V)||j.checkPoint(se[0],se[1],0,F,U,_.x,_.y,ne,H),A.vectorNormInverse=Ae,R={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:N,srcRs:V,tgtPos:_,tgtRs:H,srcW:J,srcH:Z,tgtW:F,tgtH:U,srcIntn:de,tgtIntn:ge,srcShape:re,tgtShape:j,posPts:{x1:xe.x2,y1:xe.y2,x2:xe.x1,y2:xe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-Oe.x,y:-Oe.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-Ae.x,y:-Ae.y}}}var X=we?R:A;te.nodesOverlap=X.nodesOverlap,te.srcIntn=X.srcIntn,te.tgtIntn=X.tgtIntn,te.isRound=ce.startsWith("round"),n&&(M.isParent()||M.isChild()||O.isParent()||O.isChild())&&(M.parents().anySame(O)||O.parents().anySame(M)||M.same(O)&&M.isParent())?e.findCompoundLoopPoints(Y,X,W,Be):M===O?e.findLoopPoints(Y,X,W,Be):ce.endsWith("segments")?e.findSegmentsPoints(Y,X):ce.endsWith("taxi")?e.findTaxiPoints(Y,X):ce==="straight"||!Be&&A.eles.length%2===1&&W===Math.floor(A.eles.length/2)?e.findStraightEdgePoints(Y):e.findBezierPoints(Y,X,W,Be,we),e.findEndpoints(Y),e.tryToCorrectInvalidPoints(Y,X),e.checkForInvalidEdgeWarning(Y),e.storeAllpts(Y),e.storeEdgeProjections(Y),e.calculateArrowAngles(Y),e.recalculateEdgeLabelProjections(Y),e.calculateLabelAngles(Y)}},x=0;x0){var me=l,ge=xt(me,Gt(s)),se=xt(me,Gt(we)),de=ge;if(se2){var fe=xt(me,{x:we[2],y:we[3]});fe0){var K=v,le=xt(K,Gt(s)),ee=xt(K,Gt($)),ie=le;if(ee2){var oe=xt(K,{x:$[2],y:$[3]});oe=d||x){g={cp:w,segment:C};break}}if(g)break}var T=g.cp,k=g.segment,D=(d-p)/k.length,B=k.t1-k.t0,P=h?k.t0+B*D:k.t1-B*D;P=Ta(0,P,1),e=$t(T.p0,T.p1,T.p2,P),c=ry(T.p0,T.p1,T.p2,P);break}case"straight":case"segments":case"haystack":{for(var A=0,R,L,I,M,O=a.allpts.length,q=0;q+3=d));q+=2);var _=d-L,N=_/R;N=Ta(0,N,1),e=Cd(I,M,N),c=yf(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Gr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Gr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=kt(a,r._private.labelDimsKey);if(xr(t.rscratch,"prefixedLabelDimsKey",e)!==n){Ur(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),s=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,u=xr(t.rscratch,"labelWrapCachedLines",e)||[],l=o!=="wrap"?1:Math.max(u.length,1),v=i.height/l,f=v*s,c=i.width,h=i.height+(l-1)*(s-1)*v;Ur(t.rstyle,"labelWidth",e,c),Ur(t.rscratch,"labelWidth",e,c),Ur(t.rstyle,"labelHeight",e,h),Ur(t.rscratch,"labelHeight",e,h),Ur(t.rscratch,"labelLineHeight",e,f)}};Gr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(U,J){return J?(Ur(t.rscratch,U,e,J),J):xr(t.rscratch,U,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="​",v=n.split(` +`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;gf){var E=p.matchAll(y),C="",x=0,T=Cr(E),k;try{for(T.s();!(k=T.n()).done;){var D=k.value,B=D[0],P=p.substring(x,D.index);x=D.index+B.length;var A=C.length===0?P:C+P+B,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+B:(C&&d.push(C),C=P+B)}}catch(F){T.e(F)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(` +`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",O="…",q=!1;if(this.calculateLabelDimensions(r,n).widthI)break;M+=n[_],_===n.length-1&&(q=!0)}return q||(M+=O),M}return n};Gr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Gr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),f=this.labelCalcCanvasContext=v.getContext("2d");var c=v.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}f.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var h=0,d=0,y=e.split(` +`),g=0;g1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u=r.desktopTapThreshold2}var or=i(S);ar&&(r.hoverData.tapholdCancelled=!0);var Nr=function(){var Sr=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Sr.length===0?(Sr.push(ke[0]),Sr.push(ke[1])):(Sr[0]+=ke[0],Sr[1]+=ke[1])};G=!0,n(Ee,["mousemove","vmousemove","tapdrag"],S,{x:ee[0],y:ee[1]});var We=function(Sr){return{originalEvent:S,type:Sr,position:{x:ee[0],y:ee[1]}}},Wr=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||$.emit(We("boxstart")),pe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(ar){var Ar=We("cxtdrag");ve?ve.emit(Ar):$.emit(Ar),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ee!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(We("cxtdragout")),r.hoverData.cxtOver=Ee,Ee&&Ee.emit(We("cxtdragover")))}}else if(r.hoverData.dragging){if(G=!0,$.panningEnabled()&&$.userPanningEnabled()){var Jr;if(r.hoverData.justStartedPan){var Ha=r.hoverData.mdownPos;Jr={x:(ee[0]-Ha[0])*K,y:(ee[1]-Ha[1])*K},r.hoverData.justStartedPan=!1}else Jr={x:ke[0]*K,y:ke[1]*K};$.panBy(Jr),$.emit(We("dragpan")),r.hoverData.dragged=!0}ee=r.projectIntoViewport(S.clientX,S.clientY)}else if(pe[4]==1&&(ve==null||ve.pannable())){if(ar){if(!r.hoverData.dragging&&$.boxSelectionEnabled()&&(or||!$.panningEnabled()||!$.userPanningEnabled()))Wr();else if(!r.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()){var mt=s(ve,r.hoverData.downs);mt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,pe[4]=0,r.data.bgActivePosistion=Gt(ie),r.redrawHint("select",!0),r.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&Ee!=Ce&&(Ce&&n(Ce,["mouseout","tapdragout"],S,{x:ee[0],y:ee[1]}),Ee&&n(Ee,["mouseover","tapdragover"],S,{x:ee[0],y:ee[1]}),r.hoverData.last=Ee),ve)if(ar){if($.boxSelectionEnabled()&&or)ve&&ve.grabbed()&&(y(Pe),ve.emit(We("freeon")),Pe.emit(We("free")),r.dragData.didDrag&&(ve.emit(We("dragfreeon")),Pe.emit(We("dragfree")))),Wr();else if(ve&&ve.grabbed()&&r.nodeIsDraggable(ve)){var br=!r.dragData.didDrag;br&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Pe,{inDragLayer:!0});var cr={x:0,y:0};if(ae(ke[0])&&ae(ke[1])&&(cr.x+=ke[0],cr.y+=ke[1],br)){var wr=r.hoverData.dragDelta;wr&&ae(wr[0])&&ae(wr[1])&&(cr.x+=wr[0],cr.y+=wr[1])}r.hoverData.draggingEles=!0,Pe.silentShift(cr).emit(We("position")).emit(We("drag")),r.redrawHint("drag",!0),r.redraw()}}else Nr();G=!0}if(pe[2]=ee[0],pe[3]=ee[1],G)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var D,B,P;r.registerBinding(e,"mouseup",function(S){if(!(r.hoverData.which===1&&S.which!==1&&r.hoverData.capture)){var z=r.hoverData.capture;if(z){r.hoverData.capture=!1;var G=r.cy,$=r.projectIntoViewport(S.clientX,S.clientY),K=r.selection,le=r.findNearestElement($[0],$[1],!0,!1),ee=r.dragData.possibleDragElements,ie=r.hoverData.down,oe=i(S);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,ie&&ie.unactivate();var pe=function(Ue){return{originalEvent:S,type:Ue,position:{x:$[0],y:$[1]}}};if(r.hoverData.which===3){var Ee=pe("cxttapend");if(ie?ie.emit(Ee):G.emit(Ee),!r.hoverData.cxtDragged){var Ce=pe("cxttap");ie?ie.emit(Ce):G.emit(Ce)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],S,{x:$[0],y:$[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],S,{x:$[0],y:$[1]}),B=!1,S.timeStamp-P<=G.multiClickDebounceTime()?(D&&clearTimeout(D),B=!0,P=null,n(ie,["dblclick","dbltap","vdblclick"],S,{x:$[0],y:$[1]})):(D=setTimeout(function(){B||n(ie,["oneclick","onetap","voneclick"],S,{x:$[0],y:$[1]})},G.multiClickDebounceTime()),P=S.timeStamp)),ie==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(S)&&(G.$(t).unselect(["tapunselect"]),ee.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=ee=G.collection()),le==ie&&!r.dragData.didDrag&&!r.hoverData.selecting&&le!=null&&le._private.selectable&&(r.hoverData.dragging||(G.selectionType()==="additive"||oe?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):oe||(G.$(t).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var ve=G.collection(r.getAllInBox(K[0],K[1],K[2],K[3]));r.redrawHint("select",!0),ve.length>0&&r.redrawHint("eles",!0),G.emit(pe("boxend"));var ke=function(Ue){return Ue.selectable()&&!Ue.selected()};G.selectionType()==="additive"||oe||G.$(t).unmerge(ve).unselect(),ve.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!K[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Pe=ie&&ie.grabbed();y(ee),Pe&&(ie.emit(pe("freeon")),ee.emit(pe("free")),r.dragData.didDrag&&(ie.emit(pe("dragfreeon")),ee.emit(pe("dragfree"))))}}K[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var A=[],R=4,L,I=1e5,M=function(S,z){for(var G=0;G=R){var $=A;if(L=M($,5),!L){var K=Math.abs($[0]);L=O($)&&K>5}if(L)for(var le=0;le<$.length;le++)I=Math.min(Math.abs($[le]),I)}else A.push(G),z=!0;else L&&(I=Math.min(Math.abs(G),I));if(!r.scrollingPage){var ee=r.cy,ie=ee.zoom(),oe=ee.pan(),pe=r.projectIntoViewport(S.clientX,S.clientY),Ee=[pe[0]*ie+oe.x,pe[1]*ie+oe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||x()){S.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Ce;z&&Math.abs(G)>5&&(G=eo(G)*5),Ce=G/-250,L&&(Ce/=I,Ce*=3),Ce=Ce*r.wheelSensitivity;var ve=S.deltaMode===1;ve&&(Ce*=33);var ke=ee.zoom()*Math.pow(10,Ce);S.type==="gesturechange"&&(ke=r.gestureStartZoom*S.scale),ee.zoom({level:ke,renderedPosition:{x:Ee[0],y:Ee[1]}}),ee.emit({type:S.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:S,position:{x:pe[0],y:pe[1]}})}}}};r.registerBinding(r.container,"wheel",q,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(X){r.hasTouchStarted||q(X)},!0),r.registerBinding(r.container,"mouseout",function(S){var z=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:z[0],y:z[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var z=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:z[0],y:z[1]}})},!1);var _,N,F,U,J,Z,j,re,ne,Q,V,H,W,Y=function(S,z,G,$){return Math.sqrt((G-S)*(G-S)+($-z)*($-z))},te=function(S,z,G,$){return(G-S)*(G-S)+($-z)*($-z)},ce;r.registerBinding(r.container,"touchstart",ce=function(S){if(r.hasTouchStarted=!0,!!T(S)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var z=r.cy,G=r.touchData.now,$=r.touchData.earlier;if(S.touches[0]){var K=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);G[0]=K[0],G[1]=K[1]}if(S.touches[1]){var K=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);G[2]=K[0],G[3]=K[1]}if(S.touches[2]){var K=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);G[4]=K[0],G[5]=K[1]}var le=function(or){return{originalEvent:S,type:or,position:{x:G[0],y:G[1]}}};if(S.touches[1]){r.touchData.singleTouchMoved=!0,y(r.dragData.touchDragEles);var ee=r.findContainerClientCoords();ne=ee[0],Q=ee[1],V=ee[2],H=ee[3],_=S.touches[0].clientX-ne,N=S.touches[0].clientY-Q,F=S.touches[1].clientX-ne,U=S.touches[1].clientY-Q,W=0<=_&&_<=V&&0<=F&&F<=V&&0<=N&&N<=H&&0<=U&&U<=H;var ie=z.pan(),oe=z.zoom();J=Y(_,N,F,U),Z=te(_,N,F,U),j=[(_+F)/2,(N+U)/2],re=[(j[0]-ie.x)/oe,(j[1]-ie.y)/oe];var pe=200,Ee=pe*pe;if(Z=1){for(var Pr=r.touchData.startPosition=[null,null,null,null,null,null],Ke=0;Ke=r.touchTapThreshold2}if(z&&r.touchData.cxt){S.preventDefault();var Ke=S.touches[0].clientX-ne,Ye=S.touches[0].clientY-Q,Je=S.touches[1].clientX-ne,or=S.touches[1].clientY-Q,Nr=te(Ke,Ye,Je,or),We=Nr/Z,Wr=150,Ar=Wr*Wr,Jr=1.5,Ha=Jr*Jr;if(We>=Ha||Nr>=Ar){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var mt=oe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(mt),r.touchData.start=null):$.emit(mt)}}if(z&&r.touchData.cxt){var mt=oe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(mt):$.emit(mt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var br=r.findNearestElement(K[0],K[1],!0,!0);(!r.touchData.cxtOver||br!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(oe("cxtdragout")),r.touchData.cxtOver=br,br&&br.emit(oe("cxtdragover")))}else if(z&&S.touches[2]&&$.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||$.emit(oe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,G[4]=1,!G||G.length===0||G[0]===void 0?(G[0]=(K[0]+K[2]+K[4])/3,G[1]=(K[1]+K[3]+K[5])/3,G[2]=(K[0]+K[2]+K[4])/3+1,G[3]=(K[1]+K[3]+K[5])/3+1):(G[2]=(K[0]+K[2]+K[4])/3,G[3]=(K[1]+K[3]+K[5])/3),r.redrawHint("select",!0),r.redraw();else if(z&&S.touches[1]&&!r.touchData.didSelect&&$.zoomingEnabled()&&$.panningEnabled()&&$.userZoomingEnabled()&&$.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var cr=r.dragData.touchDragEles;if(cr){r.redrawHint("drag",!0);for(var wr=0;wr0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var we;r.registerBinding(e,"touchcancel",we=function(S){var z=r.touchData.start;r.touchData.capture=!1,z&&z.unactivate()});var me,ge,se,de;if(r.registerBinding(e,"touchend",me=function(S){var z=r.touchData.start,G=r.touchData.capture;if(G)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var $=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var K=r.cy,le=K.zoom(),ee=r.touchData.now,ie=r.touchData.earlier;if(S.touches[0]){var oe=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);ee[0]=oe[0],ee[1]=oe[1]}if(S.touches[1]){var oe=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);ee[2]=oe[0],ee[3]=oe[1]}if(S.touches[2]){var oe=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);ee[4]=oe[0],ee[5]=oe[1]}var pe=function(Ar){return{originalEvent:S,type:Ar,position:{x:ee[0],y:ee[1]}}};z&&z.unactivate();var Ee;if(r.touchData.cxt){if(Ee=pe("cxttapend"),z?z.emit(Ee):K.emit(Ee),!r.touchData.cxtDragged){var Ce=pe("cxttap");z?z.emit(Ce):K.emit(Ce)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&K.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var ve=K.collection(r.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,r.redrawHint("select",!0),K.emit(pe("boxend"));var ke=function(Ar){return Ar.selectable()&&!Ar.selected()};ve.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),ve.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(z?.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Pe=r.dragData.touchDragEles;if(z!=null){var ar=z._private.grabbed;y(Pe),r.redrawHint("drag",!0),r.redrawHint("eles",!0),ar&&(z.emit(pe("freeon")),Pe.emit(pe("free")),r.dragData.didDrag&&(z.emit(pe("dragfreeon")),Pe.emit(pe("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]}),z.unactivate(),r.touchData.start=null}else{var Ue=r.findNearestElement(ee[0],ee[1],!0,!0);n(Ue,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]})}var Pr=r.touchData.startPosition[0]-ee[0],Ke=Pr*Pr,Ye=r.touchData.startPosition[1]-ee[1],Je=Ye*Ye,or=Ke+Je,Nr=or*le*le;r.touchData.singleTouchMoved||(z||K.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],S,{x:ee[0],y:ee[1]}),ge=!1,S.timeStamp-de<=K.multiClickDebounceTime()?(se&&clearTimeout(se),ge=!0,de=null,n(z,["dbltap","vdblclick"],S,{x:ee[0],y:ee[1]})):(se=setTimeout(function(){ge||n(z,["onetap","voneclick"],S,{x:ee[0],y:ee[1]})},K.multiClickDebounceTime()),de=S.timeStamp)),z!=null&&!r.dragData.didDrag&&z._private.selectable&&Nr"u"){var fe=[],xe=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},be=function(S){return{event:S,touch:xe(S)}},Se=function(S){fe.push(be(S))},De=function(S){for(var z=0;z0)return F[0]}return null},d=Object.keys(c),y=0;y0?h:mv(i,s,e,t,a,n,o,u)},checkPoint:function(e,t,a,n,i,s,o,u){u=u==="auto"?lt(n,i):u;var l=2*u;if(Yr(e,t,this.points,s,o,n,i-l,[0,-1],a)||Yr(e,t,this.points,s,o,n-l,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[s-v,o-f,s-v,o,s+v,o,s+v,o-f];return!!(Er(e,t,c)||St(e,t,l,l,s+n/2-u,o+i/2-u,a)||St(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};Zr.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var a=new Array(20);{var n=Ds(5,0),i=Ds(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(l){if(m>=e.deqCost*h||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ms)break;var E=e.deq(a,g,y);if(E.length>0)for(var C=0;C0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,g,y)&&i())},o=e.priority||Qs;n.beforeRender(s,o(a))}}}},iy=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bn;dt(this,r),this.idsByKey=new Kr,this.keyForId=new Kr,this.cachesByLvl=new Kr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return ht(r,[{key:"getIdsFor",value:function(t){t==null&&He("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new jt,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Kr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Il=25,tn=50,hn=-4,_s=3,Tf=7.99,sy=8,oy=1024,uy=1024,ly=1024,vy=.2,fy=.8,cy=10,dy=.15,hy=.1,gy=.9,py=.9,yy=100,my=1,Wt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},by=vr({getKey:null,doesEleInvalidateKey:bn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:fv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ya=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=by(t);ye(a,n),a.lookup=new iy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},tr=ya.prototype;tr.reasons=Wt;tr.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};tr.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};tr.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new za(function(t,a){return a.reqs-t.reqs});return e};tr.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};tr.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(js(o*t))),a=Tf||a>_s)return null;var l=Math.pow(2,a),v=e.h*l,f=e.w*l,c=s.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var h=u.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=Il?d=Il:v<=tn?d=tn:d=Math.ceil(v/tn)*tn,v>ly||f>uy)return null;var y=i.getTextureQueue(d),g=y[y.length-2],p=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidtha;B--)k=i.getElement(r,e,t,B,Wt.downscale);D()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!E)for(var A=a-1;A>=hn;A--){var R=u.get(r,A);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:l,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+sy),g.eleCaches.push(h),u.set(r,a,h),i.checkTextureFullness(g),h};tr.invalidateElements=function(r){for(var e=0;e=vy*r.width&&this.retireTexture(r)};tr.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>fy&&r.fullnessChecks>=cy?ut(t,r):r.fullnessChecks++};tr.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;ut(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Js(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),ut(n,s),a.push(s),s}};tr.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};tr.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=t.pop(),u=o.key,l=o.eles[0],v=i.hasCache(l,o.level);if(a[u]=null,v)continue;n.push(o);var f=e.getBoundingBox(l);e.getElement(l,f,r,o.level,Wt.dequeue)}return n};tr.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Zs,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};tr.onDequeue=function(r){this.onDequeues.push(r)};tr.offDequeue=function(r){ut(this.onDequeues,r)};tr.setupDequeueing=Cf.setupDequeueing({deqRedrawThreshold:yy,deqCost:dy,deqAvgCost:hy,deqNoDrawCost:gy,deqFastCost:py,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a=xy||t>Dn)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),v=u[t]=u[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var D=function(L){if(a.validateLayersElesOrdering(L,r),a.levelIsComplete(L,r))return h=u[L],!0},B=function(L){if(!h)for(var I=t+L;ba<=I&&I<=Dn&&!D(I);I+=L);};B(1),B(-1);for(var P=v.length-1;P>=0;P--){var A=v[P];A.invalid&&ut(v,A)}};if(!c)d();else return v;var y=function(){if(!f){f=yr();for(var D=0;DNl||A>Nl)return null;var R=P*A;if(R>Py)return null;var L=a.makeLayer(f,t);if(B!=null){var I=v.indexOf(B)+1;v.splice(I,0,L)}else(D.insert===void 0||D.insert)&&v.unshift(L);return L};if(a.skipping&&!o)return null;for(var p=null,m=r.length/wy,b=!o,w=0;w=m||!yv(p.bb,E.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;h||b?a.queueLayer(p,E):a.drawEleInLayer(p,E,t,e),p.eles.push(E),x[t]=p}return h||(b?null:v)};fr.getEleLevelForLayerLevel=function(r,e){return r};fr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Ay),i.setImgSmoothing(s,!0))};fr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};fr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a0){e=!0;break}}return e};fr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Xr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};fr.invalidateLayer=function(r){if(this.lastInvalidationTime=Xr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];ut(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=l*v,m=l*v,b=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(s.eleStrokeStyle(r,e,L),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=d,s.eleStrokeStyle(r,e,L),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=h+y,r.lineCap=d,y>0)s.colorStrokeStyle(r,g[0],g[1],g[2],L);else{r.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(r,e)},C=function(){n&&s.drawEdgeUnderlay(r,e)},x=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(r,e,L)},T=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var D=e.pstyle("ghost-offset-x").pfValue,B=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,A=p*P;r.translate(D,B),b(A),x(A),r.translate(-D,-B)}else w();C(),b(),x(),E(),T(),t&&r.translate(u.x1,u.y1)}};var Df=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=l,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Qr.drawEdgeOverlay=Df("overlay");Qr.drawEdgeUnderlay=Df("underlay");Qr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(u){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e);r.textAlign=u,r.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,v=e.pstyle("label"),f=e.pstyle("source-label"),c=e.pstyle("target-label");if(l||(!v||!v.value)&&(!f||!f.value)&&(!c||!c.value))return;r.textAlign="center",r.textBaseline="bottom"}var h=!t,d;t&&(d=t,r.translate(-d.x1,-d.y1)),n==null?(s.drawText(r,e,null,h,i),e.isEdge()&&(s.drawText(r,e,"source",h,i),s.drawText(r,e,"target",h,i))):s.drawText(r,e,n,h,i),t&&r.translate(d.x1,d.y1)};Mt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],o),this.colorStrokeStyle(r,v[0],v[1],v[2],u)};function _y(r,e,t,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,u=t+n/2;r.beginPath(),r.arc(o,u,s,0,Math.PI*2),r.closePath()}function ql(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+a-s,t),r.quadraticCurveTo(e+a,t,e+a,t+s),r.lineTo(e+a,t+n-s),r.quadraticCurveTo(e+a,t+n,e+a-s,t+n),r.lineTo(e+s,t+n),r.quadraticCurveTo(e,t+n,e,t+n-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Mt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=xr(n,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};Mt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=xr(s,"labelX",t),l=xr(s,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=xr(s,"labelWidth",t),y=xr(s,"labelHeight",t),g=e.pstyle(h+"text-margin-x").pfValue,p=e.pstyle(h+"text-margin-y").pfValue,m=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;m&&(b="center",w="center"),u+=g,l+=p;var E;switch(a?E=this.getTextAngle(e,t):E=0,E!==0&&(v=u,f=l,r.translate(v,f),r.rotate(E),u=0,l=0),w){case"top":break;case"center":l+=y/2;break;case"bottom":l+=y;break}var C=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,k=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,B=D==="round-rectangle"||D==="roundrectangle",P=D==="circle",A=2;if(C>0||T>0&&x>0){var R=r.fillStyle,L=r.strokeStyle,I=r.lineWidth,M=e.pstyle("text-background-color").value,O=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value,_=C>0,N=T>0&&x>0,F=u-k;switch(b){case"left":F-=d;break;case"center":F-=d/2;break}var U=l-y-k,J=d+2*k,Z=y+2*k;if(_&&(r.fillStyle="rgba(".concat(M[0],",").concat(M[1],",").concat(M[2],",").concat(C*o,")")),N&&(r.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(x*o,")"),r.lineWidth=T,r.setLineDash))switch(q){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=T/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(B?(r.beginPath(),ql(r,F,U,J,Z,A)):P?(r.beginPath(),_y(r,F,U,J,Z)):(r.beginPath(),r.rect(F,U,J,Z)),_&&r.fill(),N&&r.stroke(),N&&q==="double"){var j=T/2;r.beginPath(),B?ql(r,F+j,U+j,J-2*j,Z-2*j,A):r.rect(F+j,U+j,J-2*j,Z-2*j),r.stroke()}r.fillStyle=R,r.strokeStyle=L,r.lineWidth=I,r.setLineDash&&r.setLineDash([])}var re=2*e.pstyle("text-outline-width").pfValue;if(re>0&&(r.lineWidth=re),e.pstyle("text-wrap").value==="wrap"){var ne=xr(s,"labelWrapCachedLines",t),Q=xr(s,"labelLineHeight",t),V=d/2,H=this.getLabelJustification(e);switch(H==="auto"||(b==="left"?H==="left"?u+=-d:H==="center"&&(u+=-V):b==="center"?H==="left"?u+=-V:H==="right"&&(u+=V):b==="right"&&(H==="center"?u+=V:H==="right"&&(u+=d))),w){case"top":l-=(ne.length-1)*Q;break;case"center":case"bottom":l-=(ne.length-1)*Q;break}for(var W=0;W0&&r.strokeText(ne[W],u,l),r.fillText(ne[W],u,l),l+=Q}else re>0&&r.strokeText(c,u,l),r.fillText(c,u,l);E!==0&&(r.rotate(-E),r.translate(-v,-f))}}};var pt={};pt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,u,l=e._private,v=l.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=s.usePaths(),d,y=!1,g=e.padding();o=e.width()+2*g,u=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),E=new Array(b.length),C=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(r,e,S)},Q=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;s.colorStrokeStyle(r,R[0],R[1],R[2],S)},V=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;s.colorStrokeStyle(r,U[0],U[1],U[2],S)},H=function(S,z,G,$){var K=s.nodePathCache=s.nodePathCache||[],le=vv(G==="polygon"?G+","+$.join(","):G,""+z,""+S,""+re),ee=K[le],ie,oe=!1;return ee!=null?(ie=ee,oe=!0,v.pathCache=ie):(ie=new Path2D,K[le]=v.pathCache=ie),{path:ie,cacheHit:oe}},W=e.pstyle("shape").strValue,Y=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var te=H(o,u,W,Y);d=te.path,y=te.cacheHit}var ce=function(){if(!y){var S=f;h&&(S={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,S.x,S.y,o,u,re,v)}h?r.fill(d):r.fill()},Be=function(){for(var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,$=0,K=0;K0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,z),S&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},me=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasStripe(e)&&(r.save(),h?r.clip(v.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v),r.clip()),s.drawStripe(r,e,z),r.restore(),S&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},ge=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=(B>0?B:-B)*S,G=B>0?0:255;B!==0&&(s.colorFillStyle(r,G,G,G,z),h?r.fill(d):r.fill())},se=function(){if(P>0){if(r.lineWidth=P,r.lineCap=M,r.lineJoin=I,r.setLineDash)switch(L){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(q),r.lineDashOffset=_;break;case"solid":case"double":r.setLineDash([]);break}if(O!=="center"){if(r.save(),r.lineWidth*=2,O==="inside")h?r.clip(d):r.clip();else{var S=new Path2D;S.rect(-o/2-P,-u/2-P,o+2*P,u+2*P),S.addPath(d),r.clip(S,"evenodd")}h?r.stroke(d):r.stroke(),r.restore()}else h?r.stroke(d):r.stroke();if(L==="double"){r.lineWidth=P/3;var z=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=z}r.setLineDash&&r.setLineDash([])}},de=function(){if(F>0){if(r.lineWidth=F,r.lineCap="butt",r.setLineDash)switch(J){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var S=f;h&&(S={x:0,y:0});var z=s.getNodeShape(e),G=P;O==="inside"&&(G=0),O==="outside"&&(G*=2);var $=(o+G+(F+j))/o,K=(u+G+(F+j))/u,le=o*$,ee=u*K,ie=s.nodeShapes[z].points,oe;if(h){var pe=H(le,ee,z,ie);oe=pe.path}if(z==="ellipse")s.drawEllipsePath(oe||r,S.x,S.y,le,ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(z)){var Ee=0,Ce=0,ve=0;z==="round-diamond"?Ee=(G+j+F)*1.4:z==="round-heptagon"?(Ee=(G+j+F)*1.075,ve=-(G/2+j+F)/35):z==="round-hexagon"?Ee=(G+j+F)*1.12:z==="round-pentagon"?(Ee=(G+j+F)*1.13,ve=-(G/2+j+F)/15):z==="round-tag"?(Ee=(G+j+F)*1.12,Ce=(G/2+F+j)*.07):z==="round-triangle"&&(Ee=(G+j+F)*(Math.PI/2),ve=-(G+j/2+F)/Math.PI),Ee!==0&&($=(o+Ee)/o,le=o*$,["round-hexagon","round-tag"].includes(z)||(K=(u+Ee)/u,ee=u*K)),re=re==="auto"?wv(le,ee):re;for(var ke=le/2,Pe=ee/2,ar=re+(G+F+j)/2,Ue=new Array(ie.length/2),Pr=new Array(ie.length/2),Ke=0;Ke0){if(n=n||a.position(),i==null||s==null){var h=a.padding();i=a.width()+2*h,s=a.height()+2*h}o.colorFillStyle(t,v[0],v[1],v[2],l),o.nodeShapes[f].draw(t,n.x,n.y,i+u*2,s+u*2,c),t.fill()}}}};pt.drawNodeOverlay=Bf("overlay");pt.drawNodeUnderlay=Bf("underlay");pt.hasPie=function(r){return r=r[0],r._private.hasPie};pt.hasStripe=function(r){return r=r[0],r._private.hasStripe};pt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,h,d=0,y=this.usePaths();if(y&&(u=0,l=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),s.units==="%"?h=c*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d;E+=o;var C=2*Math.PI*w,x=E+C;p===0||d>=1||d+w>1||(h===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,c,E,x),r.closePath()):(r.beginPath(),r.arc(u,l,c,E,x),r.arc(u,l,h,x,E,!0),r.closePath()),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),d+=w)}};pt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),u=e.height(),l=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var h=o,d=u;c.units==="%"?(h=h*c.pfValue,d=d*c.pfValue):c.pfValue!==void 0&&(h=c.pfValue,d=c.pfValue),v&&(i=0,s=0),s-=h/2,i-=d/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+l>1&&(b=1-l),!(g===0||l>=1||l+b>1)&&(r.beginPath(),r.rect(i,s+d*l,h,d*b),r.closePath(),this.colorFillStyle(r,p[0],p[1],p[2],m),r.fill(),l+=b)}r.restore()};var mr={},Gy=100;mr.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};mr.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;ne.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=s!==void 0?s:b,E=t.pan(),C={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},T=e.prevViewport,k=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!k&&!(y&&!d)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=u,C.x*=u,C.y*=u;var D=e.getCachedZSortedEles();function B(Q,V,H,W,Y){var te=Q.globalCompositeOperation;Q.globalCompositeOperation="destination-out",e.colorFillStyle(Q,255,255,255,e.motionBlurTransparency),Q.fillRect(V,H,W,Y),Q.globalCompositeOperation=te}function P(Q,V){var H,W,Y,te;!e.clearingMotionBlur&&(Q===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Q===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(H={x:E.x*h,y:E.y*h},W=b*h,Y=e.canvasWidth*h,te=e.canvasHeight*h):(H=C,W=w,Y=e.canvasWidth,te=e.canvasHeight),Q.setTransform(1,0,0,1,0,0),V==="motionBlur"?B(Q,0,0,Y,te):!a&&(V===void 0||V)&&Q.clearRect(0,0,Y,te),n||(Q.translate(H.x,H.y),Q.scale(W,W)),o&&Q.translate(o.x,o.y),s&&Q.scale(s,s)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var A=e.data.bufferContexts[e.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=l.contexts[e.NODE],L=e.textureCache.texture,x=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?B(R,0,0,x.width,x.height):R.clearRect(0,0,x.width,x.height);var I=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I[0],I[1],I[2],M),R.fillRect(0,0,x.width,x.height);var b=t.zoom();P(R,!1),R.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),R.drawImage(L,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=t.extent(),q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&q,N=[];if(N[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||N[e.NODE]){var F=c&&!N[e.NODE]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),U=c&&!F?"motionBlur":void 0;P(R,U),_?e.drawCachedNodes(R,D.nondrag,u,O):e.drawLayeredElements(R,D.nondrag,u,O),e.debug&&e.drawDebugPoints(R,D.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||N[e.DRAG])){var F=c&&!N[e.DRAG]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(R,c&&!F?"motionBlur":void 0),_?e.drawCachedNodes(R,D.drag,u,O):e.drawCachedElements(R,D.drag,u,O),e.debug&&e.drawDebugPoints(R,D.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&h!==1){var J=l.contexts[e.NODE],Z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=l.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(V,H,W){V.setTransform(1,0,0,1,0,0),W||!p?V.clearRect(0,0,e.canvasWidth,e.canvasHeight):B(V,0,0,e.canvasWidth,e.canvasHeight);var Y=h;V.drawImage(H,0,0,e.canvasWidth*Y,e.canvasHeight*Y,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||N[e.NODE])&&(ne(J,Z,N[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||N[e.DRAG])&&(ne(j,re,N[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},Gy)),a||t.emit("render")};var ca;mr.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,u=n.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!s&&u[t.SELECT_BOX]&&!o){var v=l||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),h=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(h.x,h.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var d=t.lastRedrawTime;if(t.showFps&&d){d=Math.round(d);var y=Math.round(1e3/d),g="1 frame = "+d+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ca){var p=v.measureText(g);ca=p.actualBoundingBoxAscent}v.fillText(g,0,ca);var m=60;v.strokeRect(0,ca+10,250,20),v.fillRect(0,ca+10,250*Math.min(y/m,1),20)}o||(u[t.SELECT_BOX]=!1)}};function _l(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function Hy(r,e,t){var a=_l(r,r.VERTEX_SHADER,e),n=_l(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Wy(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function yo(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function $y(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function Uy(r,e,t,a,n){var i=a*t+e.x,s=n*t+e.y;return s=Math.round(r.canvasHeight-s),[i,s]}function Ky(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function Xy(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Yy(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function Zy(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Pf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Af(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function Qy(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function Jy(r,e,t,a){var n=Pf(r,e),i=Qe(n,2),s=i[0],o=i[1],u=Af(r,o,a),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Fr(r,e,t,a){var n=Pf(r,t),i=Qe(n,3),s=i[0],o=i[1],u=i[2],l=Af(r,o,e*s),v=s*u,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),o===r.FLOAT?r.vertexAttribPointer(a,s,o,!1,v,0):o===r.INT&&r.vertexAttribIPointer(a,s,o,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;hs&&(o=s/a,u=a*o,l=n*o),{scale:o,texW:u,texH:l}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,u=this.texHeight,l=this.getScale(a),v=l.scale,f=l.texW,c=l.texH,h=function(b,w){if(n&&w){var E=w.context,C=b.x,x=b.row,T=C,k=u*x;E.save(),E.translate(T,k),E.scale(v,v),n(E,a),E.restore()}},d=[null,null],y=function(){h(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:f,h:c},d[1]={x:i.freePointer.x+f,y:i.freePointer.row*u,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),h({x:0,row:0},b);var E=s-i.freePointer.x,C=f-E,x=u;{var T=i.freePointer.x,k=i.freePointer.row*u,D=E;w.context.drawImage(b,0,0,D,x,T,k,D,x),d[0]={x:T,y:k,w:D,h:c}}{var B=E,P=(i.freePointer.row+1)*u,A=C;w&&w.context.drawImage(b,B,0,A,x,0,P,A,x),d[1]={x:0,y:P,w:A,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),s=i.texW;return this.freePointer.x+s>a?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,u=o===void 0?function(){return!0}:o,l=n.filterType,v=l===void 0?function(){return!0}:l,f=!1,c=!1,h=Cr(t),d;try{for(h.s();!(d=h.n()).done;){var y=d.value;if(u(y)){var g=Cr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,E=w.type;if(v(E)){var C=a.collections.get(w.collection),x=w.getKey(y),T=Array.isArray(x)?x:[x];if(s)T.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),D=a._key(E,k),B=a.typeAndIdToKey.get(D);B!==void 0&&!Xy(T,B)&&(f=!0,a.typeAndIdToKey.delete(D),B.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){h.e(b)}finally{h.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=Cr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),u=!1,l=o.draw(i,n,function(c){s.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),s.drawElement(c,t,n,!0,!0),c.restore()):s.drawElement(c,t,n,!0,!0),u=!0});if(u){var v=s.getID?s.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return l}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(u){var l=i.getBoundingBox(t,u),v=n.getOrCreateAtlas(t,a,l,u),f=v.getOffsets(u),c=Qe(f,2),h=c[0],d=c[1];return{atlas:v,tex:h,tex1:h,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],a=Cr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Qe(n.value,2),s=i[0],o=i[1],u=o.getCounts(),l=u.keyCount,v=u.atlasCount;t.push({type:s,keyCount:l,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),om=(function(){function r(e){dt(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ht(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),um=` + float circleSD(vec2 p, float r) { + return distance(vec2(0), p) - r; // signed distance + } +`,lm=` + float rectangleSD(vec2 p, vec2 b) { + vec2 d = abs(p)-b; + return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); + } +`,vm=` + float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { + cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; + cr.x = (p.y > 0.0) ? cr.x : cr.y; + vec2 q = abs(p) - b + cr.x; + return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; + } +`,fm=` + float ellipseSD(vec2 p, vec2 ab) { + p = abs( p ); // symmetry + + // find root with Newton solver + vec2 q = ab*(p-ab); + float w = (q.x1.0) ? d : -d; + } +`,wa={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Bn={IGNORE:1,USE_BB:2},xs=0,$l=1,Ul=2,Es=3,Vt=4,an=5,da=6,ha=7,cm=(function(){function r(e,t,a){dt(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Wy,this.atlasManager=new sm(e,a),this.batchManager=new om(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(wa.SCREEN),this.pickingProgram=this._createShaderProgram(wa.PICKING),this.vao=this._createVAO()}return ht(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es + precision highp float; + + uniform mat3 uPanZoomMatrix; + uniform int uAtlasSize; + + // instanced + in vec2 aPosition; // a vertex from the unit square + + in mat3 aTransform; // used to transform verticies, eg into a bounding box + in int aVertType; // the type of thing we are rendering + + // the z-index that is output when using picking mode + in vec4 aIndex; + + // For textures + in int aAtlasId; // which shader unit/atlas to use + in vec4 aTex; // x/y/w/h of texture in atlas + + // for edges + in vec4 aPointAPointB; + in vec4 aPointCPointD; + in vec2 aLineWidth; // also used for node border width + + // simple shapes + in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] + in vec4 aColor; // also used for edges + in vec4 aBorderColor; // aLineWidth is used for border width + + // output values passed to the fragment shader + out vec2 vTexCoord; + out vec4 vColor; + out vec2 vPosition; + // flat values are not interpolated + flat out int vAtlasId; + flat out int vVertType; + flat out vec2 vTopRight; + flat out vec2 vBotLeft; + flat out vec4 vCornerRadius; + flat out vec4 vBorderColor; + flat out vec2 vBorderWidth; + flat out vec4 vIndex; + + void main(void) { + int vid = gl_VertexID; + vec2 position = aPosition; // TODO make this a vec3, simplifies some code below + + if(aVertType == `.concat(xs,`) { + float texX = aTex.x; // texture coordinates + float texY = aTex.y; + float texW = aTex.z; + float texH = aTex.w; + + if(vid == 1 || vid == 2 || vid == 4) { + texX += texW; + } + if(vid == 2 || vid == 4 || vid == 5) { + texY += texH; + } + + float d = float(uAtlasSize); + vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Vt," || aVertType == ").concat(ha,` + || aVertType == `).concat(an," || aVertType == ").concat(da,`) { // simple shapes + + // the bounding box is needed by the fragment shader + vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat + vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat + vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated + + // calculations are done in the fragment shader, just pass these along + vColor = aColor; + vCornerRadius = aCornerRadius; + vBorderColor = aBorderColor; + vBorderWidth = aLineWidth; + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat($l,`) { + vec2 source = aPointAPointB.xy; + vec2 target = aPointAPointB.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + // stretch the unit square into a long skinny rectangle + vec2 xBasis = target - source; + vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); + vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; + + gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); + vColor = aColor; + } + else if(aVertType == `).concat(Ul,`) { + vec2 pointA = aPointAPointB.xy; + vec2 pointB = aPointAPointB.zw; + vec2 pointC = aPointCPointD.xy; + vec2 pointD = aPointCPointD.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + vec2 p0, p1, p2, pos; + if(position.x == 0.0) { // The left side of the unit square + p0 = pointA; + p1 = pointB; + p2 = pointC; + pos = position; + } else { // The right side of the unit square, use same approach but flip the geometry upside down + p0 = pointD; + p1 = pointC; + p2 = pointB; + pos = vec2(0.0, -position.y); + } + + vec2 p01 = p1 - p0; + vec2 p12 = p2 - p1; + vec2 p21 = p1 - p2; + + // Find the normal vector. + vec2 tangent = normalize(normalize(p12) + normalize(p01)); + vec2 normal = vec2(-tangent.y, tangent.x); + + // Find the vector perpendicular to p0 -> p1. + vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); + + // Determine the bend direction. + float sigma = sign(dot(p01 + p21, normal)); + float width = aLineWidth[0]; + + if(sign(pos.y) == -sigma) { + // This is an intersecting vertex. Adjust the position so that there's no overlap. + vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } else { + // This is a non-intersecting vertex. Treat it like a mitre join. + vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } + + vColor = aColor; + } + else if(aVertType == `).concat(Es,` && vid < 3) { + // massage the first triangle into an edge arrow + if(vid == 0) + position = vec2(-0.15, -0.3); + if(vid == 1) + position = vec2( 0.0, 0.0); + if(vid == 2) + position = vec2( 0.15, -0.3); + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + vColor = aColor; + } + else { + gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space + } + + vAtlasId = aAtlasId; + vVertType = aVertType; + vIndex = aIndex; + } + `),i=this.batchManager.getIndexArray(),s=`#version 300 es + precision highp float; + + // declare texture unit for each texture atlas in the batch + `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(` + `),` + + uniform vec4 uBGColor; + uniform float uZoom; + + in vec2 vTexCoord; + in vec4 vColor; + in vec2 vPosition; // model coordinates + + flat in int vAtlasId; + flat in vec4 vIndex; + flat in int vVertType; + flat in vec2 vTopRight; + flat in vec2 vBotLeft; + flat in vec4 vCornerRadius; + flat in vec4 vBorderColor; + flat in vec2 vBorderWidth; + + out vec4 outColor; + + `).concat(um,` + `).concat(lm,` + `).concat(vm,` + `).concat(fm,` + + vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha + return vec4( + top.rgb + (bot.rgb * (1.0 - top.a)), + top.a + (bot.a * (1.0 - top.a)) + ); + } + + vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance + // scale to the zoom level so that borders don't look blurry when zoomed in + // note 1.5 is an aribitrary value chosen because it looks good + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + } + + void main(void) { + if(vVertType == `).concat(xs,`) { + // look up the texel from the texture unit + `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(` + else `),` + } + else if(vVertType == `).concat(Es,`) { + // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; + outColor = blend(vColor, uBGColor); + outColor.a = 1.0; // make opaque, masks out line under arrow + } + else if(vVertType == `).concat(Vt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done + } + else if(vVertType == `).concat(Vt," || vVertType == ").concat(ha,` + || vVertType == `).concat(an," || vVertType == ").concat(da,`) { // use SDF + + float outerBorder = vBorderWidth[0]; + float innerBorder = vBorderWidth[1]; + float borderPadding = outerBorder * 2.0; + float w = vTopRight.x - vBotLeft.x - borderPadding; + float h = vTopRight.y - vBotLeft.y - borderPadding; + vec2 b = vec2(w/2.0, h/2.0); // half width, half height + vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center + + float d; // signed distance + if(vVertType == `).concat(Vt,`) { + d = rectangleSD(p, b); + } else if(vVertType == `).concat(ha,` && w == h) { + d = circleSD(p, b.x); // faster than ellipse + } else if(vVertType == `).concat(ha,`) { + d = ellipseSD(p, b); + } else { + d = roundRectangleSD(p, b, vCornerRadius.wzyx); + } + + // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling + // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box + if(d > 0.0) { + if(d > outerBorder) { + discard; + } else { + outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); + } + } else { + if(d > innerBorder) { + vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; + vec4 innerBorderColor = blend(vBorderColor, vColor); + outColor = distInterp(innerBorderColor, outerColor, d); + } + else { + vec4 outerColor; + if(innerBorder == 0.0 && outerBorder == 0.0) { + outerColor = vec4(0); + } else if(innerBorder == 0.0) { + outerColor = vBorderColor; + } else { + outerColor = blend(vBorderColor, vColor); + } + outColor = distInterp(vColor, outerColor, d - innerBorder); + } + } + } + else { + outColor = vColor; + } + + `).concat(t.picking?`if(outColor.a == 0.0) discard; + else outColor = vIndex;`:"",` + } + `),o=Hy(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:wa.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===Bn.IGNORE)return;if(u==Bn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p=this.maxInstances&&this.endBatch()}}}}catch(B){v.e(B)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;Hl(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;gn(t,t,[v,f]),Wl(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;gn(t,t,[s,o]),Gs(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);wt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=o,o===an||o===da){var l=i.getBoundingBox(t),v=this._getCornerRadius(t,s.radius,l),f=this.cornerRadiusBuffer.getView(u);f[0]=v,f[1]=v,f[2]=v,f[3]=v,o===da&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(u);Ft(a,c);var h=this.renderTarget.picking?1:n==="node-body"?t.effectiveOpacity():1,d=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h,y=t.pstyle(s.color).value,g=this.colorBuffer.getView(u);wt(y,d,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,s.border){var m=t.pstyle("border-width").value;if(m>0){var b=t.pstyle("border-color").value,w=h*t.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(u);wt(b,w,E);var C=t.pstyle("border-position").value;if(C==="inside")p[0]=0,p[1]=-m;else if(C==="outside")p[0]=m,p[1]=0;else{var x=m/2;p[0]=x,p[1]=-x}}}var T=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,T,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return Vt;case"ellipse":return ha;case"roundrectangle":case"round-rectangle":return an;case"bottom-round-rectangle":return da;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,s=n.h;if(t.pstyle(a).value==="auto")return lt(i,s);var o=t.pstyle(a).pfValue,u=i/2,l=s/2;return Math.min(o,l,u)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,s,o,u;if(n==="source"?(s=i.arrowStartX,o=i.arrowStartY,u=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(u)||u==null)){var l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,h=f*c,d=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,g=this.r.getArrowWidth(d,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);Hl(m),gn(m,m,[s,o]),Gs(m,m,[g,g]),Wl(m,m,u),this.vertTypeBuffer.getView(p)[0]=Es;var b=this.indexBuffer.getView(p);Ft(a,b);var w=this.colorBuffer.getView(p);wt(v,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*s;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=$l;var f=this.indexBuffer.getView(v);Ft(a,f);var c=this.colorBuffer.getView(v);wt(u,l,c);var h=this.lineWidthBuffer.getView(v);h[0]=o;var d=this.pointAPointBBuffer.getView(v);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var s=i/a;this._setCurvePoint(t,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?Bn.USE_BB:Bn.IGNORE},u=function(f){var c=f.position(),h=c.x,d=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:h-y/2,y1:d-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:Ky,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getLabelKey,null),getBoundingBox:Ts(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getSourceLabelKey,"source"),getBoundingBox:Ts(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getTargetLabelKey,"target"),getBoundingBox:Ts(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Na(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&l()}),hm(t)};function dm(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return av(t)}function Mf(r,e){var t=r._private.rscratch;return xr(t,"labelWrapCachedLines",e)||[]}var Cs=function(e,t){return function(a){var n=e(a),i=Mf(a,t);return i.length>1?i.map(function(s,o){return"".concat(n,"_").concat(o)}):n}},Ts=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),u=Mf(a,t),l=i.h/u.length,v=l*o,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:l,yOffset:v}}}return i}};function hm(r){{var e=r.render;r.render=function(i){i=i||{};var s=r.cy;r.webgl&&(s.zoom()>Tf?(gm(r),e.call(r,i)):(pm(r),If(r,i,wa.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,s,o,u){return Em(r,i,s)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,s){n.call(r,i,s),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function gm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function pm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function ym(r){var e=r.canvasWidth,t=r.canvasHeight,a=yo(r),n=a.pan,i=a.zoom,s=ws();gn(s,s,[n.x,n.y]),Gs(s,s,[i,i]);var o=ws();tm(o,e,t);var u=ws();return rm(u,o,s),u}function Lf(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=yo(r),i=n.pan,s=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(s,s)}function mm(r,e){r.drawSelectionRectangle(e,function(t){return Lf(r,t)})}function bm(r){var e=r.data.contexts[r.NODE];e.save(),Lf(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function wm(r){var e=function(n,i,s){for(var o=n.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=o.atlases,v=0;v=0&&w.add(x)}return w}function Em(r,e,t){var a=xm(r,e,t),n=r.getCachedZSortedEles(),i,s,o=Cr(a),u;try{for(o.s();!(u=o.n()).done;){var l=u.value,v=n[l];if(!i&&v.isNode()&&(i=v),!s&&v.isEdge()&&(s=v),i&&s)break}}catch(f){o.e(f)}finally{o.f()}return[i,s].filter(Boolean)}function Ss(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function If(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&mm(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=ym(r),u=r.getCachedZSortedEles();if(i=u.length,n.startFrame(o,t),t.screen){for(var l=0;l0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*l,-a.y1*l),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(a.x1*l,a.y1*l);else{var y=e.pan(),g={x:y.x*l,y:y.y*l};l*=e.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return c};function Cm(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i"u"?"undefined":rr(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[kf,Hr,Qr,po,Mt,pt,mr,Rf,yt,Ga,zf].forEach(function(r){ye(Te,r)});var km=[{name:"null",impl:ff},{name:"base",impl:Ef},{name:"canvas",impl:Tm}],Dm=[{type:"layout",extensions:Zp},{type:"renderer",extensions:km}],Vf={},qf={};function _f(r,e,t){var a=t,n=function(T){ze("Can not register `"+e+"` for `"+r+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(Pa.prototype[e])return n(e);Pa.prototype[e]=t}else if(r==="collection"){if(lr.prototype[e])return n(e);lr.prototype[e]=t}else if(r==="layout"){for(var i=function(T){this.options=T,t.call(this,T),Me(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],u=0;u{y.clear(),A.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return r.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),ie=w((e,t)=>{const n=y.get(t)||[];return r.info("Descendants of ",t," is ",n),r.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(r.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{r.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const i=t.children(e)||[];e!==a&&i.push(e),r.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);r.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(r.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(r.debug("Setting parent",o,e),n.setParent(o,e)):(r.info("In copy ",e,"root",a,"data",t.node(e),a),r.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);r.debug("Copying Edges",u),u.forEach(c=>{r.info("Edge",c);const m=t.edge(c.v,c.w,c.name);r.info("Edge data",m,a);try{ie(c,a)?(r.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),r.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):r.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(h){r.error(h)}})}r.debug("Removing node",o),t.removeNode(o)})},"copy"),J=w((e,t)=>{const n=t.children(e);let a=[...n];for(const i of n)A.set(i,e),a=[...a,...J(i,t)];return a},"extractDescendants"),oe=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),i=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=i.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(r.trace("Searching children of id ",e,a),a.length<1)return e;let i;for(const o of a){const l=C(o,t,n),u=oe(t,n,l);if(l)if(u.length>0)i=l;else return l}return i},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),ae=w((e,t)=>{if(!e||t>10){r.debug("Opting out, no graph ");return}else r.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(r.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,J(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),i=e.edges();a.length>0?(r.debug("Cluster identified",n,y),i.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(r.warn("Edge: ",o," leaves cluster ",n),r.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):r.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,i=e.parent(a);i!==n&&d.has(i)&&!d.get(i).externalConnections&&(d.get(n).id=i)}e.edges().forEach(function(n){const a=e.edge(n);r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,o=n.w;if(r.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(r.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),i=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const l=e.parent(i);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}r.warn("Fix Replacing with XXX",i,o,n.name),e.setEdge(i,o,a,n.name)}}),r.warn("Adjusted Graph",b(e)),T(e,0),r.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(r.warn("extractor - ",t,b(e),e.children("D")),t>10){r.error("Bailing out");return}let n=e.nodes(),a=!1;for(const i of n){const o=e.children(i);a=a||o.length>0}if(!a){r.debug("Done, no node has children",e.nodes());return}r.debug("Nodes = ",n,t);for(const i of n)if(r.debug("Extracting node",i,d,d.has(i)&&!d.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!d.has(i))r.debug("Not a cluster",i,t);else if(!d.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){r.warn("Cluster without external connections, without a parent and with children",i,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(i)?.clusterData?.dir&&(l=d.get(i).clusterData.dir,r.warn("Fixing dir",d.get(i).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});r.warn("Old graph before copy",b(e)),G(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:d.get(i).clusterData,label:d.get(i).label,graph:u}),r.warn("New graph after copy node: (",i,")",b(u)),r.debug("Old graph after copy",b(e))}else r.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!d.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),r.debug(d);n=e.nodes(),r.warn("New list of nodes",n);for(const i of n){const o=e.node(i);r.warn(" Now next level",i,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),L=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const i=e.children(a),o=L(e,i);n=[...n,...o]}),n},"sorter"),ce=w(e=>L(e,e.children()),"sortNodesByHierarchy"),M=w(async(e,t,n,a,i,o)=>{r.warn("Graph in recursive render:XAX",b(t),i);const l=t.graph().rankdir;r.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?r.info("Recursive render XXX",t.nodes()):r.info("No nodes found for",t),t.edges().length>0&&r.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),h=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(i!==void 0){const g=JSON.parse(JSON.stringify(i.clusterData));r.trace(`Setting data for parent cluster XXX + Node.id = `,f,` + data=`,g.height,` +Parent cluster`,i.height),t.setNode(i.id,g),t.parent(f)||(r.trace("Setting parent",f,i.id),t.setParent(f,i.id,g))}if(r.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){r.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const p=await M(v,s.graph,n,a,t.node(f),o),x=p.elem;V(s,x),s.diff=p.diff||0,r.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),$(x,s)}else t.children(f).length>0?(r.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),r.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(r.trace("Node - the non recursive path XAX",f,v,t.node(f),l),await Q(v,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);r.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),r.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),r.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await z(h,g)});await Promise.all(f)},"processEdges")(),r.info("Graph before layout:",JSON.stringify(b(t))),r.info("############################################# XXX"),r.info("### Layout ### XXX"),r.info("############################################# XXX"),I(t),r.info("Graph after layout:",JSON.stringify(b(t)));let O=0,{subGraphTitleTotalMargin:S}=U(o);return await Promise.all(ce(t).map(async function(f){const s=t.node(f);if(r.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,r.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){r.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,p=E-g||0;r.debug("OffsetY",p,"labelHeight",E,"halfPadding",g),await W(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,r.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);r.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const p=Z(m,s,d,n,g,E,a);q(s,p)}),t.nodes().forEach(function(f){const s=t.node(f);r.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),r.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ge=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");_(a,e.markers,e.type,e.diagramId),Y(),j(),F(),re(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),r.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const h=structuredClone(o),v=structuredClone(o),X=structuredClone(o);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=l+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-mid",X.label="",X.startLabelRight="",X.startLabelLeft="",X.arrowTypeStart="none",m.isGroup&&(h.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,h,l+"-cyclic-special-0"),n.setEdge(u,c,v,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cyc{y.clear(),A.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return r.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),ie=w((e,t)=>{const n=y.get(t)||[];return r.info("Descendants of ",t," is ",n),r.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(r.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{r.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const i=t.children(e)||[];e!==a&&i.push(e),r.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);r.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(r.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(r.debug("Setting parent",o,e),n.setParent(o,e)):(r.info("In copy ",e,"root",a,"data",t.node(e),a),r.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);r.debug("Copying Edges",u),u.forEach(c=>{r.info("Edge",c);const m=t.edge(c.v,c.w,c.name);r.info("Edge data",m,a);try{ie(c,a)?(r.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),r.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):r.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(h){r.error(h)}})}r.debug("Removing node",o),t.removeNode(o)})},"copy"),J=w((e,t)=>{const n=t.children(e);let a=[...n];for(const i of n)A.set(i,e),a=[...a,...J(i,t)];return a},"extractDescendants"),oe=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),i=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=i.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(r.trace("Searching children of id ",e,a),a.length<1)return e;let i;for(const o of a){const l=C(o,t,n),u=oe(t,n,l);if(l)if(u.length>0)i=l;else return l}return i},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),ae=w((e,t)=>{if(!e||t>10){r.debug("Opting out, no graph ");return}else r.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(r.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,J(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),i=e.edges();a.length>0?(r.debug("Cluster identified",n,y),i.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(r.warn("Edge: ",o," leaves cluster ",n),r.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):r.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,i=e.parent(a);i!==n&&d.has(i)&&!d.get(i).externalConnections&&(d.get(n).id=i)}e.edges().forEach(function(n){const a=e.edge(n);r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,o=n.w;if(r.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(r.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),i=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const l=e.parent(i);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}r.warn("Fix Replacing with XXX",i,o,n.name),e.setEdge(i,o,a,n.name)}}),r.warn("Adjusted Graph",b(e)),T(e,0),r.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(r.warn("extractor - ",t,b(e),e.children("D")),t>10){r.error("Bailing out");return}let n=e.nodes(),a=!1;for(const i of n){const o=e.children(i);a=a||o.length>0}if(!a){r.debug("Done, no node has children",e.nodes());return}r.debug("Nodes = ",n,t);for(const i of n)if(r.debug("Extracting node",i,d,d.has(i)&&!d.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!d.has(i))r.debug("Not a cluster",i,t);else if(!d.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){r.warn("Cluster without external connections, without a parent and with children",i,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(i)?.clusterData?.dir&&(l=d.get(i).clusterData.dir,r.warn("Fixing dir",d.get(i).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});r.warn("Old graph before copy",b(e)),G(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:d.get(i).clusterData,label:d.get(i).label,graph:u}),r.warn("New graph after copy node: (",i,")",b(u)),r.debug("Old graph after copy",b(e))}else r.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!d.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),r.debug(d);n=e.nodes(),r.warn("New list of nodes",n);for(const i of n){const o=e.node(i);r.warn(" Now next level",i,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),L=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const i=e.children(a),o=L(e,i);n=[...n,...o]}),n},"sorter"),ce=w(e=>L(e,e.children()),"sortNodesByHierarchy"),M=w(async(e,t,n,a,i,o)=>{r.warn("Graph in recursive render:XAX",b(t),i);const l=t.graph().rankdir;r.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?r.info("Recursive render XXX",t.nodes()):r.info("No nodes found for",t),t.edges().length>0&&r.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),h=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(i!==void 0){const g=JSON.parse(JSON.stringify(i.clusterData));r.trace(`Setting data for parent cluster XXX + Node.id = `,f,` + data=`,g.height,` +Parent cluster`,i.height),t.setNode(i.id,g),t.parent(f)||(r.trace("Setting parent",f,i.id),t.setParent(f,i.id,g))}if(r.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){r.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const p=await M(v,s.graph,n,a,t.node(f),o),x=p.elem;V(s,x),s.diff=p.diff||0,r.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),$(x,s)}else t.children(f).length>0?(r.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),r.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(r.trace("Node - the non recursive path XAX",f,v,t.node(f),l),await Q(v,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);r.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),r.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),r.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await z(h,g)});await Promise.all(f)},"processEdges")(),r.info("Graph before layout:",JSON.stringify(b(t))),r.info("############################################# XXX"),r.info("### Layout ### XXX"),r.info("############################################# XXX"),I(t),r.info("Graph after layout:",JSON.stringify(b(t)));let O=0,{subGraphTitleTotalMargin:S}=U(o);return await Promise.all(ce(t).map(async function(f){const s=t.node(f);if(r.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,r.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){r.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,p=E-g||0;r.debug("OffsetY",p,"labelHeight",E,"halfPadding",g),await W(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,r.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);r.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const p=Z(m,s,d,n,g,E,a);q(s,p)}),t.nodes().forEach(function(f){const s=t.node(f);r.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),r.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ue=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");_(a,e.markers,e.type,e.diagramId),Y(),F(),j(),re(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),r.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const h=structuredClone(o),v=structuredClone(o),X=structuredClone(o);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=l+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-mid",X.label="",X.startLabelRight="",X.startLabelLeft="",X.arrowTypeStart="none",m.isGroup&&(h.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,h,l+"-cyclic-special-0"),n.setEdge(u,c,v,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cycy({...j,...C().radar}),"getConfig"),b=l(()=>x.axes,"getAxes"),K=l(()=>x.curves,"getCurves"),N=l(()=>x.options,"getOptions"),U=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();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"),Z=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),J=l(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:K,getOptions:N,setAxes:U,setCurves:X,setOptions:Z,getConfig:q,clear:J,setAccTitle:D,getAccTitle:_,setDiagramTitle:F,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},Q=l(a=>{V(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await H("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=E(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,h,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((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 B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(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}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + dominant-baseline: middle; + text-anchor: middle; + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${ot(t,e)} + `},"styles"),gt={parser:tt,db:$,renderer:nt,styles:lt};export{gt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js b/apps/kimi-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js new file mode 100644 index 0000000000..74395e9977 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js @@ -0,0 +1,43 @@ +import{s as k,g as I,q as R,p as F,a as _,b as D,_ as l,I as E,z,F as y,D as C,G,l as P,K as W,e as B}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as V}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as H}from"./wardley-L42UT6IY-BJFn8eDD.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:h},x=structuredClone(w),j=G.radar,q=l(()=>y({...j,...C().radar}),"getConfig"),b=l(()=>x.axes,"getAxes"),K=l(()=>x.curves,"getCurves"),N=l(()=>x.options,"getOptions"),U=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();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"),Z=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule}},"setOptions"),J=l(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:K,getOptions:N,setAxes:U,setCurves:X,setOptions:Z,getConfig:q,clear:J,setAccTitle:D,getAccTitle:_,setDiagramTitle:F,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},Q=l(a=>{V(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await H("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=E(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),m=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,m,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((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 B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),m=n*Math.sin(u);return`${g},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const u=d.entries.map((g,m)=>{const v=2*Math.PI*m/n-Math.PI/2,f=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(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}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + dominant-baseline: middle; + text-anchor: middle; + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${ot(t,e)} + `},"styles"),pt={parser:tt,db:$,renderer:nt,styles:lt};export{pt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-BsckzYNE.js b/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-BsckzYNE.js new file mode 100644 index 0000000000..51741a0001 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-BsckzYNE.js @@ -0,0 +1,10 @@ +import{p as x,b as f,s as C,q as B,g as T,a as y,_ as s,F as u,l as k,I as V,e as _,D,z as N,G as S}from"./mermaid.core-zKrc8Ye9.js";import{p as I}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{I as $}from"./chunk-QZHKN3VN-Dyzf1Pwd.js";import{p as z}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.js";var d=new $(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),A=s(()=>{d.reset(),N()},"clear"),X=s(()=>d.records.stack[0],"getRoot"),H=s(()=>d.records.cnt,"getCount"),L=S.treeView,R=s(()=>u(L,D().treeView),"getConfig"),W=s((e,t)=>{for(;e<=d.records.stack[d.records.stack.length-1].level;)d.records.stack.pop();const a={id:d.records.cnt++,level:e,name:t,children:[]};d.records.stack[d.records.stack.length-1].children.push(a),d.records.stack.push(a)},"addNode"),E={clear:A,addNode:W,getRoot:X,getCount:H,getConfig:R,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},m=E,F=s(e=>{I(e,m),e.nodes.map(t=>m.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await z("treeView",e);k.debug(t),F(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),l=g+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+l/2),a.BBox={x:e,y:t,width:i,height:l}},"positionLabel"),b=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,a)=>{let n=0,o=0;const c=s((r,l,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,l,r,i);const{height:p,width:w}=l.BBox;b(r,v-i.rowIndent,n+p/2,v,n+p/2,i.lineThickness),o=Math.max(o,v+w),n+=p},"drawNode"),g=s((r,l=0)=>{c(e,r,a,l),r.children.forEach(p=>{g(p,l+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:p,height:w}=r.children[r.children.length-1].BBox;b(e,i+a.paddingX,h+v,i+a.paddingX,p+w/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),G=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram +`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),r=V(t),l=r.append("g");l.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(l,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),_(r,i,h,g.useMaxWidth)},"draw"),j={draw:G},J=j,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return` + .treeView-node-label { + font-size: ${t}; + fill: ${a}; + } + .treeView-node-line { + stroke: ${n}; + } + `},"styles"),P=O,ae={db:m,renderer:J,parser:M,styles:P};export{ae as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js b/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js new file mode 100644 index 0000000000..0d4ba27b0c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js @@ -0,0 +1,10 @@ +import{p as x,b as f,s as C,q as B,g as T,a as y,_ as s,F as u,l as k,I as V,e as _,D,z as N,G as S}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as I}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{I as $}from"./chunk-QZHKN3VN-_Rz9_NuS.js";import{p as z}from"./wardley-L42UT6IY-BJFn8eDD.js";var d=new $(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),A=s(()=>{d.reset(),N()},"clear"),X=s(()=>d.records.stack[0],"getRoot"),H=s(()=>d.records.cnt,"getCount"),L=S.treeView,R=s(()=>u(L,D().treeView),"getConfig"),W=s((e,t)=>{for(;e<=d.records.stack[d.records.stack.length-1].level;)d.records.stack.pop();const a={id:d.records.cnt++,level:e,name:t,children:[]};d.records.stack[d.records.stack.length-1].children.push(a),d.records.stack.push(a)},"addNode"),E={clear:A,addNode:W,getRoot:X,getCount:H,getConfig:R,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},m=E,F=s(e=>{I(e,m),e.nodes.map(t=>m.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await z("treeView",e);k.debug(t),F(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),l=g+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+l/2),a.BBox={x:e,y:t,width:i,height:l}},"positionLabel"),b=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,a)=>{let n=0,o=0;const c=s((r,l,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,l,r,i);const{height:p,width:w}=l.BBox;b(r,v-i.rowIndent,n+p/2,v,n+p/2,i.lineThickness),o=Math.max(o,v+w),n+=p},"drawNode"),g=s((r,l=0)=>{c(e,r,a,l),r.children.forEach(p=>{g(p,l+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:p,height:w}=r.children[r.children.length-1].BBox;b(e,i+a.paddingX,h+v,i+a.paddingX,p+w/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),G=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram +`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),r=V(t),l=r.append("g");l.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(l,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),_(r,i,h,g.useMaxWidth)},"draw"),j={draw:G},J=j,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return` + .treeView-node-label { + font-size: ${t}; + fill: ${a}; + } + .treeView-node-line { + stroke: ${n}; + } + `},"styles"),P=O,te={db:m,renderer:J,parser:M,styles:P};export{te as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-C4GWXOE2.js b/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-C4GWXOE2.js new file mode 100644 index 0000000000..2b0dde43f0 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-C4GWXOE2.js @@ -0,0 +1,3 @@ +import{p as re}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{q as oe,p as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as D,d as ue,E as xe,z as fe,F as ge,D as M,G as he,i as y,w as P,ak as pe}from"./mermaid.core-zKrc8Ye9.js";import{p as be,i as ve}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.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=L(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):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 G(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(G,"calculateEntityVisualProps");function L(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;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,d),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,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.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(L,"calculateTextProps");function V(e,n){const t=n,i=G(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,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={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,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,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:le,setAccDescription:de,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,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),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=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);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"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=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",d).attr("stroke",l),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:d}=D(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.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,l,d?.padding??30,d?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,He={parser:Ee,db:F,renderer:Te,styles:Ne};export{He as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js b/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js new file mode 100644 index 0000000000..dabd856549 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js @@ -0,0 +1,3 @@ +import{p as re}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{q as oe,p as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as D,d as ue,E as xe,z as fe,F as ge,D as M,G as he,i as y,w as P,ak as pe}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as be,i as ve}from"./wardley-L42UT6IY-BJFn8eDD.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=L(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):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 G(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(G,"calculateEntityVisualProps");function L(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;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,d),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,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.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(L,"calculateTextProps");function V(e,n){const t=n,i=G(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,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={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,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,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:le,setAccDescription:de,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,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),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=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);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"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=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",d).attr("stroke",l),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:d}=D(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.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,l,d?.padding??30,d?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,We={parser:Ee,db:F,renderer:Te,styles:Ne};export{We as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js b/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js new file mode 100644 index 0000000000..51e443ce97 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js @@ -0,0 +1,24 @@ +import{_ as b,F as u,I as $,e as B,l as m,b as C,a as S,p as D,q as T,g as z,s as F,D as P,G as E,z as A}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as W}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as _}from"./wardley-L42UT6IY-BJFn8eDD.js";var N=E.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=z,this.setAccDescription=F}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...P().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){A(),this.packet=[]}},I=1e4,L=b((t,e)=>{W(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),L(e,r)},"parse")},Y=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=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())G(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"),G=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:Y},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}; + } + .packetByte.start { + fill: ${e.startByteColor}; + } + .packetByte.end { + fill: ${e.endByteColor}; + } + .packetLabel { + fill: ${e.labelColor}; + font-size: ${e.labelFontSize}; + } + .packetTitle { + fill: ${e.titleColor}; + font-size: ${e.titleFontSize}; + } + .packetBlock { + stroke: ${e.blockStrokeColor}; + stroke-width: ${e.blockStrokeWidth}; + fill: ${e.blockFillColor}; + } + `},"styles"),U={parser:v,get db(){return new w},renderer:O,styles:q};export{U as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-WWKSVuAU.js b/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-WWKSVuAU.js new file mode 100644 index 0000000000..32bb2018f8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-LMA3HP47-WWKSVuAU.js @@ -0,0 +1,24 @@ +import{_ as b,F as u,I as $,e as B,l as m,b as C,a as S,p as D,q as T,g as z,s as F,D as P,G as E,z as A}from"./mermaid.core-zKrc8Ye9.js";import{p as W}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{p as _}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.js";var N=E.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=z,this.setAccDescription=F}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...P().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){A(),this.packet=[]}},I=1e4,L=b((t,e)=>{W(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),L(e,r)},"parse")},Y=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=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())G(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"),G=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:Y},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}; + } + .packetByte.start { + fill: ${e.startByteColor}; + } + .packetByte.end { + fill: ${e.endByteColor}; + } + .packetLabel { + fill: ${e.labelColor}; + font-size: ${e.labelFontSize}; + } + .packetTitle { + fill: ${e.titleColor}; + font-size: ${e.titleFontSize}; + } + .packetBlock { + stroke: ${e.blockStrokeColor}; + stroke-width: ${e.blockStrokeWidth}; + fill: ${e.blockFillColor}; + } + `},"styles"),X={parser:v,get db(){return new w},renderer:O,styles:q};export{X as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-B6TtcB01.js b/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-B6TtcB01.js new file mode 100644 index 0000000000..37a7a6dd80 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-B6TtcB01.js @@ -0,0 +1,24 @@ +import{_ as w,K as de,D as Q,F as Z,I as he,e as ue,l as J,bd as P,d as Y,b as pe,a as fe,p as me,q as ge,g as ye,s as Se,G as ve,be as xe,z as be}from"./mermaid.core-zKrc8Ye9.js";import{s as we}from"./chunk-2J33WTMH-BlbqWzB_.js";import{p as Ce}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{p as Te}from"./wardley-L42UT6IY-gSV1j6uw.js";import{b as H}from"./defaultLocale-DX6XiGOO.js";import{o as U}from"./ordinal-Cboi1Yqb.js";import"./index-DtRfJ0vw.js";import"./init-Gi6I4Gst.js";function Le(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(Le)}function Ae(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function Fe(e,a){for(var n=this,l=[n],r,o,d=-1;n=l.pop();)if(e.call(a,n,++d,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ne(e,a){for(var n=this,l=[n],r=[],o,d,h,m=-1;n=l.pop();)if(r.push(n),o=n.children)for(d=0,h=o.length;d=0;)n+=l[r].value;a.value=n})}function _e(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function ke(e){for(var a=this,n=ze(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 ze(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 De(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Pe(){return Array.from(this)}function Be(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Re(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ee(){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;--h)r.push(o=d[h]=new j(d[h])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ge)}function We(){return ee(this).eachBefore(Oe)}function Ie(e){return e.children}function He(e){return Array.isArray(e)?e[1]:null}function Oe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ge(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=ee.prototype={constructor:j,count:$e,each:Ae,eachAfter:Ne,eachBefore:Fe,find:Me,sum:Ve,sort:_e,path:ke,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function qe(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Xe(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 Ye(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(l-a)/e.value;++hM&&(M=c),V=p*p*R,N=Math.max(M/V,V/g),N>z){p-=c;break}z=N}d.push(m={value:p,dice:x1?l:1)},n})(Ke);function Je(){var e=Ze,a=!1,n=1,l=1,r=[0],o=O,d=O,h=O,m=O,c=O;function u(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Xe),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,p=s.x1-x,g=s.y1-x;p{xe(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(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ne(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(ne,"buildHierarchy");var Qe=w((e,a)=>{Ce(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 d=o.item;if(!d)continue;const h=o.indent?parseInt(o.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};n.push(b)}const l=ne(n),r=w((o,d)=>{for(const h of o)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(l,0)},"populate"),et=w(e=>e.name?String(e.name):"","getItemName"),le={parser:{yy:void 0},parse:w(async e=>{try{const n=await Te("treemap",e);J.debug("Treemap AST:",n);const l=le.parser?.yy;if(!(l instanceof ae))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.");Qe(n,l)}catch(a){throw J.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,q=25,at=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),d=o.padding??tt,h=r.getDiagramTitle(),m=r.getRoot(),{themeVariables:c}=Q();if(!m)return;const u=h?30:0,b=he(a),s=o.nodeWidth?o.nodeWidth*B:960,x=o.nodeHeight?o.nodeHeight*B:500,S=s,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,o.useMaxWidth);let p;try{const t=o.valueFormat||",";if(t==="$0,0")p=w(i=>"$"+H(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";p=w(C=>"$"+H(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);p=w(f=>"$"+H(i||"")(f),"valueFormat")}else p=H(t)}catch(t){J.error("Error creating format function:",t),p=H(",")}const g=U().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]),M=U().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]),N=U().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]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ee(m).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),te=Je().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+B:0).paddingInner(d).paddingLeft(t=>t.children&&t.children.length>0?B:0).paddingRight(t=>t.children&&t.children.length>0?B:0).paddingBottom(t=>t.children&&t.children.length>0?B:0).round(!0)(R),re=te.descendants().filter(t=>t.children&&t.children.length>0),E=z.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);E.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;":""),E.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),E.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=>g(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>M(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=P({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.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("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({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 $;o.showValues!==!1&&t.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),o.showValues!==!1&&E.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?p(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:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const se=te.leaves(),X=z.selectAll(".treemapLeafGroup").data(se).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})`);X.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("style",t=>P({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("stroke-width",3),X.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)),X.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: 38px;fill:"+N(t.data.name)+";",f=P({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(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,k=6,W=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(k,Math.min(F,Math.round(y*T))),K=y+W+I;for(;K>A&&y>_&&(y--,I=Math.max(k,Math.min(F,Math.round(y*T))),!(ID||y<_||A(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: 28px;fill:"+N(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(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 $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(i.y1-i.y0)/2+$/2+_;f.attr("y",k);const W=i.x1-i.x0,oe=i.y1-i.y0-4,ce=W-8;f.node().getComputedTextLength()>ce||k+F>oe||F{const a=de(),n=Q(),l=Z(a,n.themeVariables),r=Z(rt,e),o=r.titleColor??l.titleColor,d=r.labelColor??l.textColor,h=r.valueColor??l.textColor;return` + .treemapNode.section { + stroke: ${r.sectionStrokeColor}; + stroke-width: ${r.sectionStrokeWidth}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${d}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${h}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),it=st,yt={parser:le,get db(){return new ae},renderer:lt,styles:it};export{yt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js b/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js new file mode 100644 index 0000000000..93677522ae --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js @@ -0,0 +1,24 @@ +import{_ as w,K as de,D as Q,F as Z,I as he,e as ue,l as J,bd as P,d as Y,b as pe,a as fe,p as me,q as ge,g as ye,s as Se,G as ve,be as xe,z as be}from"./mermaidParser.worker-Dx4jPi9z.js";import{s as we}from"./chunk-2J33WTMH-w4sdiKFO.js";import{p as Ce}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as Te}from"./wardley-L42UT6IY-BJFn8eDD.js";import{b as H}from"./defaultLocale-CCNgq9ws.js";import{o as U}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function Le(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(Le)}function Ae(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function Fe(e,a){for(var n=this,l=[n],r,o,d=-1;n=l.pop();)if(e.call(a,n,++d,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ne(e,a){for(var n=this,l=[n],r=[],o,d,h,m=-1;n=l.pop();)if(r.push(n),o=n.children)for(d=0,h=o.length;d=0;)n+=l[r].value;a.value=n})}function _e(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function ke(e){for(var a=this,n=ze(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 ze(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 De(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Pe(){return Array.from(this)}function Be(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Re(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ee(){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;--h)r.push(o=d[h]=new j(d[h])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ge)}function We(){return ee(this).eachBefore(Oe)}function Ie(e){return e.children}function He(e){return Array.isArray(e)?e[1]:null}function Oe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ge(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=ee.prototype={constructor:j,count:$e,each:Ae,eachAfter:Ne,eachBefore:Fe,find:Me,sum:Ve,sort:_e,path:ke,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function qe(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Xe(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 Ye(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(l-a)/e.value;++hM&&(M=c),V=p*p*R,N=Math.max(M/V,V/g),N>z){p-=c;break}z=N}d.push(m={value:p,dice:x1?l:1)},n})(Ke);function Je(){var e=Ze,a=!1,n=1,l=1,r=[0],o=O,d=O,h=O,m=O,c=O;function u(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Xe),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,p=s.x1-x,g=s.y1-x;p{xe(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(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ne(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(ne,"buildHierarchy");var Qe=w((e,a)=>{Ce(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 d=o.item;if(!d)continue;const h=o.indent?parseInt(o.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};n.push(b)}const l=ne(n),r=w((o,d)=>{for(const h of o)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(l,0)},"populate"),et=w(e=>e.name?String(e.name):"","getItemName"),le={parser:{yy:void 0},parse:w(async e=>{try{const n=await Te("treemap",e);J.debug("Treemap AST:",n);const l=le.parser?.yy;if(!(l instanceof ae))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.");Qe(n,l)}catch(a){throw J.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,q=25,at=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),d=o.padding??tt,h=r.getDiagramTitle(),m=r.getRoot(),{themeVariables:c}=Q();if(!m)return;const u=h?30:0,b=he(a),s=o.nodeWidth?o.nodeWidth*B:960,x=o.nodeHeight?o.nodeHeight*B:500,S=s,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,o.useMaxWidth);let p;try{const t=o.valueFormat||",";if(t==="$0,0")p=w(i=>"$"+H(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";p=w(C=>"$"+H(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);p=w(f=>"$"+H(i||"")(f),"valueFormat")}else p=H(t)}catch(t){J.error("Error creating format function:",t),p=H(",")}const g=U().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]),M=U().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]),N=U().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]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ee(m).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),te=Je().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+B:0).paddingInner(d).paddingLeft(t=>t.children&&t.children.length>0?B:0).paddingRight(t=>t.children&&t.children.length>0?B:0).paddingBottom(t=>t.children&&t.children.length>0?B:0).round(!0)(R),re=te.descendants().filter(t=>t.children&&t.children.length>0),E=z.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);E.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;":""),E.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),E.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=>g(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>M(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=P({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.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("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({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 $;o.showValues!==!1&&t.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),o.showValues!==!1&&E.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?p(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:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const se=te.leaves(),X=z.selectAll(".treemapLeafGroup").data(se).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})`);X.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("style",t=>P({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("stroke-width",3),X.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)),X.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: 38px;fill:"+N(t.data.name)+";",f=P({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(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,k=6,W=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(k,Math.min(F,Math.round(y*T))),K=y+W+I;for(;K>A&&y>_&&(y--,I=Math.max(k,Math.min(F,Math.round(y*T))),!(ID||y<_||A(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: 28px;fill:"+N(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(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 $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(i.y1-i.y0)/2+$/2+_;f.attr("y",k);const W=i.x1-i.x0,oe=i.y1-i.y0-4,ce=W-8;f.node().getComputedTextLength()>ce||k+F>oe||F{const a=de(),n=Q(),l=Z(a,n.themeVariables),r=Z(rt,e),o=r.titleColor??l.titleColor,d=r.labelColor??l.textColor,h=r.valueColor??l.textColor;return` + .treemapNode.section { + stroke: ${r.sectionStrokeColor}; + stroke-width: ${r.sectionStrokeWidth}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${d}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${h}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),it=st,gt={parser:le,get db(){return new ae},renderer:lt,styles:it};export{gt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-BiQkmfSz.js b/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-BiQkmfSz.js new file mode 100644 index 0000000000..6a2d7c50cf --- /dev/null +++ b/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-BiQkmfSz.js @@ -0,0 +1,85 @@ +import{g as Mt}from"./chunk-55IACEB6-mUr9lxTD.js";import{s as Bt}from"./chunk-2J33WTMH-BlbqWzB_.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,p as Gt,q as Kt,c as it,l as V,z as Ut,x as Zt,B as jt,C as Wt,o as Qt,r as Xt,d as Ht,u as qt}from"./mermaid.core-zKrc8Ye9.js";import{c as Jt}from"./channel-Bt325_7a.js";import"./index-DtRfJ0vw.js";var _t=(function(){var e=l(function(C,n,c,o){for(c=c||{},o=C.length;o--;c[C[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],I=[1,18],S=[1,21],R=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes: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:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:R},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:I,51:S,52:R},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:I,51:S,52:R},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function Ct(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(Ct,"lex");for(var g,v,k,ft,w={},et,E,It,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Ct()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +`+_.showPosition()+` +Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),It=Z[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},vt=(function(){var C={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||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:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(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:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=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===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),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(n){this.unput(this.match.slice(n))},"less"),pastInput:l(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:l(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:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:l(function(n,c){var o,r,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in p)this[t]=p[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,o,r;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),t=0;tc[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,p[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,p[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,o,r,p){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return o.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return o.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,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,76,77,78],inclusive:!0}}};return C})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),f=a.db.getData(),m=Mt(i,u);f.type=a.type,f.layoutAlgorithm=Qt(y),f.config.flowchart.nodeSpacing=d?.nodeSpacing||140,f.config.flowchart.rankSpacing=d?.rankSpacing||80,f.direction=a.db.getDirection();const{config:j}=f,{look:W}=j;W==="neo"?f.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:f.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],f.diagramId=i,await Xt(f,m),f.layoutAlgorithm==="elk"&&m.select(".edges").lower();const T=m.selectAll('[id*="-background"]');Array.from(T).length>0&&T.each(function(){const M=Ht(this),I=M.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(I)}`);if(!S.empty()){const R=S.attr("transform");M.attr("transform",R)}});const Q=8;qt.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,Q,"erDiagram",d?.useMaxWidth??!0)},"draw"),Rt=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let f=0;f{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return` + ${se(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${rt.has(h)&&a?a:Rt(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${i==="neo"?u:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${i==="neo"?u:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${Rt(e.tertiaryColor,.5)}; + } +`},"getStyles"),re=ie,he={parser:$t,get db(){return new te},renderer:xt,styles:re};export{he as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js b/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js new file mode 100644 index 0000000000..0e71fb06bd --- /dev/null +++ b/apps/kimi-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js @@ -0,0 +1,85 @@ +import{g as Mt}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as Bt}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,p as Gt,q as Kt,c as it,l as V,z as Ut,x as Zt,B as jt,C as Wt,o as Qt,r as Xt,d as Ht,u as qt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as Jt}from"./channel-DNkUo9e6.js";var _t=(function(){var e=l(function(C,n,c,o){for(c=c||{},o=C.length;o--;c[C[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],p=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],I=[1,18],S=[1,21],R=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes: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:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,f,t,Z){var s=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:R},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:I,51:S,52:R},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:I,51:S,52:R},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],f=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}l(Vt,"popStack");function Ct(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(Ct,"lex");for(var g,v,k,pt,w={},et,E,It,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Ct()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +`+_.showPosition()+` +Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),f.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),pt=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],f,t].concat(Lt)),typeof pt<"u")return pt;E&&(o=o.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),It=Z[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},vt=(function(){var C={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||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:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(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:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=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 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:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-c]),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(n){this.unput(this.match.slice(n))},"less"),pastInput:l(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:l(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:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:l(function(n,c){var o,r,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,o,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;tc[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,f[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,o,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return o.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return o.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,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,76,77,78],inclusive:!0}}};return C})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),p=a.db.getData(),m=Mt(i,u);p.type=a.type,p.layoutAlgorithm=Qt(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=a.db.getDirection();const{config:j}=p,{look:W}=j;W==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=i,await Xt(p,m),p.layoutAlgorithm==="elk"&&m.select(".edges").lower();const T=m.selectAll('[id*="-background"]');Array.from(T).length>0&&T.each(function(){const M=Ht(this),I=M.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(I)}`);if(!S.empty()){const R=S.attr("transform");M.attr("transform",R)}});const Q=8;qt.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,Q,"erDiagram",d?.useMaxWidth??!0)},"draw"),Rt=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let p=0;p{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return` + ${se(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${rt.has(h)&&a?a:Rt(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${i==="neo"?u:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${i==="neo"?u:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${Rt(e.tertiaryColor,.5)}; + } +`},"getStyles"),re=ie,le={parser:$t,get db(){return new te},renderer:xt,styles:re};export{le as diagram}; diff --git a/apps/kimi-code/dist-web/assets/floating-ui.dom-CDU05fwN.js b/apps/kimi-code/dist-web/assets/floating-ui.dom-CDU05fwN.js new file mode 100644 index 0000000000..2e8602dea0 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/floating-ui.dom-CDU05fwN.js @@ -0,0 +1 @@ +const Ft=["top","right","bottom","left"],Rt=["start","end"],At=Ft.reduce((t,e)=>t.concat(e,e+"-"+Rt[0],e+"-"+Rt[1]),[]),V=Math.min,L=Math.max,it=Math.round,ot=Math.floor,X=t=>({x:t,y:t}),qt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return L(t,V(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function H(t){return t.split("-")[1]}function gt(t){return t==="x"?"y":"x"}function pt(t){return t==="y"?"height":"width"}function N(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function wt(t){return gt(N(t))}function Bt(t,e,n){n===void 0&&(n=!1);const o=H(t),i=wt(t),s=pt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=rt(r)),[r,rt(r)]}function Ut(t){const e=rt(t);return[st(t),e,st(e)]}function st(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ot=["left","right"],Ct=["right","left"],Kt=["top","bottom"],Gt=["bottom","top"];function Jt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ct:Ot:e?Ot:Ct;case"left":case"right":return e?Kt:Gt;default:return[]}}function Qt(t,e,n,o){const i=H(t);let s=Jt(B(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(st)))),s}function rt(t){const e=B(t);return qt[e]+t.slice(e.length)}function Zt(t){return{top:0,right:0,bottom:0,left:0,...t}}function xt(t){return typeof t!="number"?Zt(t):{top:t,right:t,bottom:t,left:t}}function Q(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function St(t,e,n){let{reference:o,floating:i}=t;const s=N(e),r=wt(e),c=pt(r),a=B(e),d=s==="y",u=o.x+o.width/2-i.width/2,l=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:l};break;case"left":f={x:o.x-i.width,y:l};break;default:f={x:o.x,y:o.y}}switch(H(e)){case"start":f[r]-=m*(n&&d?-1:1);break;case"end":f[r]+=m*(n&&d?-1:1);break}return f}async function Wt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:a}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:l="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=xt(f),p=c[m?l==="floating"?"reference":"floating":l],w=Q(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:a})),x=l==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},R=Q(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:a}):x);return{top:(w.top-R.top+h.top)/v.y,bottom:(R.bottom-w.bottom+h.bottom)/v.y,left:(w.left-R.left+h.left)/v.x,right:(R.right-w.right+h.right)/v.x}}const te=50,ee=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Wt},a=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:l}=St(d,o,a),m=o,f=0;const h={};for(let g=0;g({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:a}=e,{element:d,padding:u=0}=_(t,e)||{};if(d==null)return{};const l=xt(u),m={x:n,y:o},f=wt(i),h=pt(f),g=await r.getDimensions(d),p=f==="y",w=p?"top":"left",x=p?"bottom":"right",y=p?"clientHeight":"clientWidth",v=s.reference[h]+s.reference[f]-m[f]-s.floating[h],R=m[f]-s.reference[f],A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let O=A?A[y]:0;(!O||!await(r.isElement==null?void 0:r.isElement(A)))&&(O=c.floating[y]||s.floating[h]);const W=v/2-R/2,T=O/2-g[h]/2-1,b=V(l[w],T),C=V(l[x],T),P=b,E=O-g[h]-C,S=O/2-g[h]/2+W,$=mt(P,S,E),k=!a.arrow&&H(i)!=null&&S!==$&&s.reference[h]/2-(SH(i)===t),...n.filter(i=>H(i)!==t)]:n.filter(i=>B(i)===i)).filter(i=>t?H(i)===t||(e?st(i)!==i:!1):!0)}const ie=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:r,placement:c,platform:a,elements:d}=e,{crossAxis:u=!1,alignment:l,allowedPlacements:m=At,autoAlignment:f=!0,...h}=_(t,e),g=l!==void 0||m===At?oe(l||null,f,m):m,p=await a.detectOverflow(e,h),w=((n=r.autoPlacement)==null?void 0:n.index)||0,x=g[w];if(x==null)return{};const y=Bt(x,s,await(a.isRTL==null?void 0:a.isRTL(d.floating)));if(c!==x)return{reset:{placement:g[0]}};const v=[p[B(x)],p[y[0]],p[y[1]]],R=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:v}],A=g[w+1];if(A)return{data:{index:w+1,overflows:R},reset:{placement:A}};const O=R.map(b=>{const C=H(b.placement);return[b.placement,C&&u?b.overflows.slice(0,2).reduce((P,E)=>P+E,0):b.overflows[0],b.overflows]}).sort((b,C)=>b[1]-C[1]),T=((i=O.filter(b=>b[2].slice(0,H(b[0])?2:3).every(C=>C<=0))[0])==null?void 0:i[0])||O[0][0];return T!==c?{data:{index:w+1,overflows:R},reset:{placement:T}}:{}}}},se=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:a,elements:d}=e,{mainAxis:u=!0,crossAxis:l=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=_(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=B(i),x=N(c),y=B(c)===c,v=await(a.isRTL==null?void 0:a.isRTL(d.floating)),R=m||(y||!g?[rt(c)]:Ut(c)),A=h!=="none";!m&&A&&R.push(...Qt(c,g,h,v));const O=[c,...R],W=await a.detectOverflow(e,p),T=[];let b=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&T.push(W[w]),l){const S=Bt(i,r,v);T.push(W[S[0]],W[S[1]])}if(b=[...b,{placement:i,overflows:T}],!T.every(S=>S<=0)){var C,P;const S=(((C=s.flip)==null?void 0:C.index)||0)+1,$=O[S];if($&&(!(l==="alignment"?x!==N($):!1)||b.every(M=>N(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:S,overflows:b},reset:{placement:$}};let k=(P=b.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:P.placement;if(!k)switch(f){case"bestFit":{var E;const D=(E=b.filter(M=>{if(A){const q=N(M.placement);return q===x||q==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(q=>q>0).reduce((q,jt)=>q+jt,0)]).sort((M,q)=>M[1]-q[1])[0])==null?void 0:E[0];D&&(k=D);break}case"initialPlacement":k=c;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function Lt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const re=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...s}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...s,elementContext:"reference"}),c=Lt(r,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Tt(c)}}}case"escaped":{const r=await o.detectOverflow(e,{...s,altBoundary:!0}),c=Lt(r,n.floating);return{data:{escapedOffsets:c,escaped:Tt(c)}}}default:return{}}}}};function kt(t){const e=V(...t.map(s=>s.left)),n=V(...t.map(s=>s.top)),o=L(...t.map(s=>s.right)),i=L(...t.map(s=>s.bottom));return{x:e,y:n,width:o-e,height:i-n}}function ce(t){const e=t.slice().sort((i,s)=>i.y-s.y),n=[];let o=null;for(let i=0;io.height/2?n.push([s]):n[n.length-1].push(s),o=s}return n.map(i=>Q(kt(i)))}const le=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:s,strategy:r}=e,{padding:c=2,x:a,y:d}=_(t,e),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(o.reference))||[]),l=ce(u),m=Q(kt(u)),f=xt(c);function h(){if(l.length===2&&l[0].left>l[1].right&&a!=null&&d!=null)return l.find(p=>a>p.left-f.left&&ap.top-f.top&&d=2){if(N(n)==="y"){const b=l[0],C=l[l.length-1],P=B(n)==="top",E=b.top,S=C.bottom,$=P?b.left:C.left,k=P?b.right:C.right,D=k-$,M=S-E;return{top:E,bottom:S,left:$,right:k,width:D,height:M,x:$,y:E}}const p=B(n)==="left",w=L(...l.map(b=>b.right)),x=V(...l.map(b=>b.left)),y=l.filter(b=>p?b.left===x:b.right===w),v=y[0].top,R=y[y.length-1].bottom,A=x,O=w,W=O-A,T=R-v;return{top:v,bottom:R,left:A,right:O,width:W,height:T,x:A,y:v}}return m}const g=await s.getElementRects({reference:{getBoundingClientRect:h},floating:o.floating,strategy:r});return i.reference.x!==g.reference.x||i.reference.y!==g.reference.y||i.reference.width!==g.reference.width||i.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},$t=new Set(["left","top"]);async function fe(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),c=H(n),a=N(n)==="y",d=$t.has(r)?-1:1,u=s&&a?-1:1,l=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof h=="number"&&(f=c==="end"?h*-1:h),a?{x:f*u,y:m*d}:{x:m*d,y:f*u}}const ae=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,a=await fe(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:s+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:a={fn:w=>{let{x,y}=w;return{x,y}}},...d}=_(t,e),u={x:n,y:o},l=await s.detectOverflow(e,d),m=N(B(i)),f=gt(m);let h=u[f],g=u[m];if(r){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=h+l[w],v=h-l[x];h=mt(y,h,v)}if(c){const w=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=g+l[w],v=g-l[x];g=mt(y,g,v)}const p=a.fn({...e,[f]:h,[m]:g});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[f]:r,[m]:c}}}}}},de=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=e,{offset:c=0,mainAxis:a=!0,crossAxis:d=!0}=_(t,e),u={x:n,y:o},l=N(i),m=gt(l);let f=u[m],h=u[l];const g=_(c,e),p=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const y=m==="y"?"height":"width",v=s.reference[m]-s.floating[y]+p.mainAxis,R=s.reference[m]+s.reference[y]-p.mainAxis;fR&&(f=R)}if(d){var w,x;const y=m==="y"?"width":"height",v=$t.has(B(i)),R=s.reference[l]-s.floating[y]+(v&&((w=r.offset)==null?void 0:w[l])||0)+(v?0:p.crossAxis),A=s.reference[l]+s.reference[y]+(v?0:((x=r.offset)==null?void 0:x[l])||0)-(v?p.crossAxis:0);hA&&(h=A)}return{[m]:f,[l]:h}}}},me=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:r,elements:c}=e,{apply:a=()=>{},...d}=_(t,e),u=await r.detectOverflow(e,d),l=B(i),m=H(i),f=N(i)==="y",{width:h,height:g}=s.floating;let p,w;l==="top"||l==="bottom"?(p=l,w=m===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(w=l,p=m==="end"?"top":"bottom");const x=g-u.top-u.bottom,y=h-u.left-u.right,v=V(g-u[p],x),R=V(h-u[w],y),A=!e.middlewareData.shift;let O=v,W=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(W=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=x),A&&!m){const b=L(u.left,0),C=L(u.right,0),P=L(u.top,0),E=L(u.bottom,0);f?W=h-2*(b!==0||C!==0?b+C:L(u.left,u.right)):O=g-2*(P!==0||E!==0?P+E:L(u.top,u.bottom))}await a({...e,availableWidth:W,availableHeight:O});const T=await r.getDimensions(c.floating);return h!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function ct(){return typeof window<"u"}function tt(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return ct()?t instanceof Node||t instanceof F(t).Node:!1}function z(t){return ct()?t instanceof Element||t instanceof F(t).Element:!1}function j(t){return ct()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function Pt(t){return!ct()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=I(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function he(t){return/^(table|td|th)$/.test(tt(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const ge=/transform|translate|scale|rotate|perspective|filter/,pe=/paint|layout|strict|content/,K=t=>!!t&&t!=="none";let ut;function yt(t){const e=z(t)?I(t):t;return K(e.transform)||K(e.translate)||K(e.scale)||K(e.rotate)||K(e.perspective)||!vt()&&(K(e.backdropFilter)||K(e.filter))||ge.test(e.willChange||"")||pe.test(e.contain||"")}function we(t){let e=U(t);for(;j(e)&&!Z(e);){if(yt(e))return e;if(lt(e))return null;e=U(e)}return null}function vt(){return ut==null&&(ut=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ut}function Z(t){return/^(html|body|#document)$/.test(tt(t))}function I(t){return F(t).getComputedStyle(t)}function ft(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Pt(t)&&t.host||Y(t);return Pt(e)?e.host:e}function Ht(t){const e=U(t);return Z(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&nt(e)?e:Ht(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ht(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=F(i);if(s){const c=ht(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],c&&n?et(c):[])}else return e.concat(i,et(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Vt(t){const e=I(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=it(n)!==s||it(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function bt(t){return z(t)?t:t.contextElement}function J(t){const e=bt(t);if(!j(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Vt(e);let r=(s?it(n.width):n.width)/o,c=(s?it(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const xe=X(0);function _t(t){const e=F(t);return!vt()||!e.visualViewport?xe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=bt(t);let r=X(1);e&&(o?z(o)&&(r=J(o)):r=J(t));const c=ye(s,n,o)?_t(s):X(0);let a=(i.left+c.x)/r.x,d=(i.top+c.y)/r.y,u=i.width/r.x,l=i.height/r.y;if(s){const m=F(s),f=o&&z(o)?F(o):o;let h=m,g=ht(h);for(;g&&o&&f!==h;){const p=J(g),w=g.getBoundingClientRect(),x=I(g),y=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*p.x,v=w.top+(g.clientTop+parseFloat(x.paddingTop))*p.y;a*=p.x,d*=p.y,u*=p.x,l*=p.y,a+=y,d+=v,h=F(g),g=ht(h)}}return Q({width:u,height:l,x:a,y:d})}function at(t,e){const n=ft(t).scrollLeft;return e?e.left+n:G(Y(t)).left+n}function zt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-at(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ve(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=Y(o),c=e?lt(e.floating):!1;if(o===r||c&&s)return n;let a={scrollLeft:0,scrollTop:0},d=X(1);const u=X(0),l=j(o);if((l||!l&&!s)&&((tt(o)!=="body"||nt(r))&&(a=ft(o)),l)){const f=G(o);d=J(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!l&&!s?zt(r,a):X(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+u.x+m.x,y:n.y*d.y-a.scrollTop*d.y+u.y+m.y}}function be(t){return Array.from(t.getClientRects())}function Re(t){const e=Y(t),n=ft(t),o=t.ownerDocument.body,i=L(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=L(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+at(t);const c=-n.scrollTop;return I(o).direction==="rtl"&&(r+=L(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}const Et=25;function Ae(t,e){const n=F(t),o=Y(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,c=0,a=0;if(i){s=i.width,r=i.height;const u=vt();(!u||u&&e==="fixed")&&(c=i.offsetLeft,a=i.offsetTop)}const d=at(o);if(d<=0){const u=o.ownerDocument,l=u.body,m=getComputedStyle(l),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-l.clientWidth-f);h<=Et&&(s-=h)}else d<=Et&&(s+=d);return{width:s,height:r,x:c,y:a}}function Oe(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t)?J(t):X(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,a=i*s.x,d=o*s.y;return{width:r,height:c,x:a,y:d}}function Dt(t,e,n){let o;if(e==="viewport")o=Ae(t,n);else if(e==="document")o=Re(Y(t));else if(z(e))o=Oe(e,n);else{const i=_t(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(o)}function It(t,e){const n=U(t);return n===e||!z(n)||Z(n)?!1:I(n).position==="fixed"||It(n,e)}function Ce(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(c=>z(c)&&tt(c)!=="body"),i=null;const s=I(t).position==="fixed";let r=s?U(t):t;for(;z(r)&&!Z(r);){const c=I(r),a=yt(r);!a&&c.position==="fixed"&&(i=null),(s?!a&&!i:!a&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&It(t,r))?o=o.filter(u=>u!==r):i=c,r=U(r)}return e.set(t,o),o}function Se(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?lt(e)?[]:Ce(e,this._c):[].concat(n),o],c=Dt(e,r[0],i);let a=c.top,d=c.right,u=c.bottom,l=c.left;for(let m=1;m{r(!1,1e-7)},1e3)}O===1&&!Yt(d,t.getBoundingClientRect())&&r(),v=!1}try{n=new IntersectionObserver(R,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(R,y)}n.observe(t)}return r(!0),s}function Fe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,d=bt(t),u=i||s?[...d?et(d):[],...e?et(e):[]]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const l=d&&c?Me(d,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===d&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(e)})),n()}),d&&!a&&f.observe(d),e&&f.observe(e));let h,g=a?G(t):null;a&&p();function p(){const w=G(t);g&&!Yt(g,w)&&n(),g=w,h=requestAnimationFrame(p)}return n(),()=>{var w;u.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),l?.(),(w=f)==null||w.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Be=Wt,We=ae,ke=ie,$e=ue,Ne=se,He=me,Ve=re,_e=ne,ze=le,Ie=de,Xe=(t,e,n)=>{const o=new Map,i={platform:De,...n},s={...i.platform,_c:o};return ee(t,e,{...i,platform:s})};export{_e as arrow,ke as autoPlacement,Fe as autoUpdate,Xe as computePosition,Be as detectOverflow,Ne as flip,et as getOverflowAncestors,Ve as hide,ze as inline,Ie as limitShift,We as offset,De as platform,$e as shift,He as size}; diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-ChzNYmSi.js b/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-ChzNYmSi.js new file mode 100644 index 0000000000..c2eb8a9b1e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-ChzNYmSi.js @@ -0,0 +1,162 @@ +import{g as qe}from"./chunk-FMBD7UC4-_3v8zWlF.js";import{_ as b,n as Oe,l as Q,c as g1,o as He,r as Xe,u as ie,b as Qe,s as Je,p as Ze,a as $e,g as et,q as tt,k as st,t as it,J as rt,v as at,x as te,d as se,y as nt,z as ut,A as ot,B as lt}from"./mermaid.core-zKrc8Ye9.js";import{c as ct}from"./chunk-ND2GUHAM-D-Pih1kA.js";import{g as ht}from"./chunk-55IACEB6-mUr9lxTD.js";import{s as dt}from"./chunk-2J33WTMH-BlbqWzB_.js";import{c as pt}from"./channel-Bt325_7a.js";import"./index-DtRfJ0vw.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),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=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,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{b(this,"FlowDB")}sanitizeText(e){return st.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,o,d,l={},f){if(!e||e.trim().length===0)return;let n;if(f!==void 0){let E;f.includes(` +`)?E=f+` +`:E=`{ +`+f+` +}`,n=it(E,{schema:rt})}const A=this.edges.find(E=>E.id===e);if(A){const E=n;E?.animate!==void 0&&(A.animate=E.animate),E?.animation!==void 0&&(A.animation=E.animation),E?.curve!==void 0&&(A.interpolate=E.curve);return}let S,g=this.vertices.get(e);if(g===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Q.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),g={id:e,labelType:"text",domId:ft+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,i!==void 0?(this.config=g1(),S=this.sanitizeText(i.text.trim()),g.labelType=i.type,S.startsWith('"')&&S.endsWith('"')&&(S=S.substring(1,S.length-1)),g.text=S):g.text===void 0&&(g.text=e),r!==void 0&&(g.type=r),a?.forEach(E=>{g.styles.push(E)}),o?.forEach(E=>{g.classes.push(E)}),d!==void 0&&(g.dir=d),g.props===void 0?g.props=l:l!==void 0&&Object.assign(g.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!at(n.shape))throw new Error(`No such shape: ${n.shape}.`);g.type=n?.shape}n?.label&&(g.text=n?.label,g.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(g.icon=n?.icon,!n.label?.trim()&&g.text===e&&(g.text="")),n?.form&&(g.form=n?.form),n?.pos&&(g.pos=n?.pos),n?.img&&(g.img=n?.img,!n.label?.trim()&&g.text===e&&(g.text="")),n?.constraint&&(g.constraint=n.constraint),n.w&&(g.assetWidth=Number(n.w)),n.h&&(g.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Q.info("abc78 Got edge...",l);const f=r.text;if(f!==void 0&&(l.text=this.sanitizeText(f.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(f.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(A=>A.start===l.start&&A.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Q.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Q.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],f=d===i[0];l&&f?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ct();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const f=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),i.html(nt.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ut()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(g=>{const E={boolean:{},number:{},string:{}},Z=[];let _;return{nodeList:g.filter(function(K){const h1=typeof K;return K.stmt&&K.stmt==="dir"?(_=K.value,!1):K.trim()===""?!1:h1 in E?E[h1].hasOwnProperty(K)?!1:E[h1][K]=!0:Z.includes(K)?!1:Z.push(K)}),dir:_}},"uniq")(i.flat()),f=l.nodeList;let n=l.dir;const A=g1().flowchart??{};if(n=n??(A.inheritDir?this.getDirection()??g1().direction??void 0:void 0),this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),f=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const A={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};f?i.push({...A,isGroup:!0,shape:"rect"}):i.push({...A,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const A=a[n];A.nodes.length>0&&d.set(A.id,!0);for(const S of A.nodes)o.set(S,A.id)}for(let n=a.length-1;n>=0;n--){const A=a[n];i.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const f=this.getEdges();return f.forEach((n,A)=>{const{arrowTypeStart:S,arrowTypeEnd:g}=this.destructEdgeType(n.type),E=[...f.defaultStyle??[]];n.style&&E.push(...n.style);const Z={id:te(n.start,n.end,{counter:A,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":S,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":g,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:E,style:E,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Z)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return ot.flowchart}},bt=b(function(e,i){return i.db.getClasses()},"getClasses"),At=b(async function(e,i,r,a){Q.info("REF0:"),Q.info("Drawing state diagram (v2)",i);const{securityLevel:o,flowchart:d,layout:l}=g1();a.db.setDiagramId(i),Q.debug("Before getData: ");const f=a.db.getData();Q.debug("Data: ",f);const n=ht(i,o),A=a.db.getDirection();f.type=a.type,f.layoutAlgorithm=He(l),f.layoutAlgorithm==="dagre"&&l==="elk"&&Q.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),f.direction=A,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross"],f.diagramId=i,Q.debug("REF1:",f),await Xe(f,n);const S=f.config.flowchart?.diagramPadding??8;ie.insertTitle(n,"flowchartTitleText",d?.titleTopMargin||0,a.db.getDiagramTitle()),dt(n,S,"flowchart",d?.useMaxWidth||!1)},"draw"),kt={getClasses:bt,draw:At},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],f=[1,14],n=[1,15],A=[1,16],S=[1,23],g=[1,25],E=[1,26],Z=[1,27],_=[1,50],v=[1,49],K=[1,29],h1=[1,30],N1=[1,31],G1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],m1=[8,9,11,75,77,78],ae=[1,79],C1=[1,92],D1=[1,97],E1=[1,96],T1=[1,93],S1=[1,89],y1=[1,95],x1=[1,91],F1=[1,98],_1=[1,94],B1=[1,99],v1=[1,90],b1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],Y=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],L1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],K1=[1,125],j1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],Ce=[1,145],De=[1,146],Ee=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],F=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],k=[1,177],z=[1,173],W=[1,174],m=[1,178],C=[1,175],D=[1,176],V1=[77,116,119],y=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],I1=[1,269],we=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,x,t,R1){var s=t.length-1;switch(x){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1]};break;case 78:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length};break;case 84:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(m1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:C1,44:D1,60:E1,80:[1,87],89:T1,95:[1,84],97:[1,85],101:86,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(b1,[2,51]),e(b1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:v,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(Y,[2,181]),e(Y,[2,142]),e(Y,[2,143]),e(Y,[2,144]),e(Y,[2,145]),e(Y,[2,146]),e(Y,[2,147]),e(Y,[2,148]),e(Y,[2,149]),e(Y,[2,150]),e(Y,[2,151]),e(Y,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(L1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:K1,119:j1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(m1,[2,48],{44:Le}),e(m1,[2,49],{18:156,10:d1,40:Ve}),e(b1,[2,44]),{44:_,47:158,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:_,47:163,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(F,[2,115],{120:168,10:[1,167],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,117],{10:[1,169]}),e(q,[2,183]),e(q,[2,170]),e(q,[2,171]),e(q,[2,172]),e(q,[2,173]),e(q,[2,174]),e(q,[2,175]),e(q,[2,176]),e(q,[2,177]),e(q,[2,178]),e(q,[2,179]),e(q,[2,180]),{44:_,47:170,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:179,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:181,50:[1,180],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:182,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:183,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:184,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{109:[1,185]},{30:186,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:187,65:[1,188],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:189,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:190,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:191,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(Y,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(m1,[2,46],{39:192,18:193,10:d1,40:ae}),e(L1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{77:[1,197],79:198,116:K1,119:j1},e(V1,[2,79]),e(V1,[2,81]),e(V1,[2,82]),e(V1,[2,168]),e(V1,[2,169]),{76:199,79:121,80:ue,81:oe,116:K1,119:j1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(y,[2,101]),e(y,[2,103]),e(y,[2,104]),e(y,[2,157]),e(y,[2,158]),e(y,[2,159]),e(y,[2,160]),e(y,[2,161]),e(y,[2,162]),e(y,[2,163]),e(y,[2,164]),e(y,[2,165]),e(y,[2,166]),e(y,[2,167]),e(y,[2,90]),e(y,[2,91]),e(y,[2,92]),e(y,[2,93]),e(y,[2,94]),e(y,[2,95]),e(y,[2,96]),e(y,[2,97]),e(y,[2,98]),e(y,[2,99]),e(y,[2,100]),{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,203],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(b1,[2,43]),{10:[1,206],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(F,[2,109],{10:[1,213]}),e(F,[2,111],{10:[1,214]}),{80:[1,215]},e(q,[2,184]),{80:[1,216],98:[1,217]},e(b1,[2,55],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:k,82:219,116:m,117:C,118:D},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:k,82:219,116:m,117:C,118:D},{30:221,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{51:[1,222],67:k,82:219,116:m,117:C,118:D},{53:[1,223],67:k,82:219,116:m,117:C,118:D},{55:[1,224],67:k,82:219,116:m,117:C,118:D},{57:[1,225],67:k,82:219,116:m,117:C,118:D},{60:[1,226]},{64:[1,227],67:k,82:219,116:m,117:C,118:D},{66:[1,228],67:k,82:219,116:m,117:C,118:D},{30:229,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{31:[1,230],67:k,82:219,116:m,117:C,118:D},{67:k,69:[1,231],71:[1,232],82:219,116:m,117:C,118:D},{67:k,69:[1,234],71:[1,233],82:219,116:m,117:C,118:D},e(m1,[2,45],{18:156,10:d1,40:Ve}),e(m1,[2,47],{44:Le}),e(L1,[2,75]),e(L1,[2,74]),{62:[1,235],67:k,82:219,116:m,117:C,118:D},e(L1,[2,77]),e(V1,[2,80]),{77:[1,236],79:198,116:K1,119:j1},{30:237,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(X1,d,{5:238}),e(y,[2,102]),e(T,[2,35]),{43:239,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:_,47:258,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(F,[2,116]),e(F,[2,118],{10:[1,262]}),e(F,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:k,82:219,116:m,117:C,118:D},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:k,82:219,116:m,117:C,118:D},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(L1,[2,78]),{31:[1,266],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,267],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(b1,[2,53]),{43:268,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,121],{106:I1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(J,[2,132]),e(J,[2,134]),e(J,[2,135]),e(J,[2,136]),e(J,[2,137]),e(J,[2,138]),e(J,[2,139]),e(J,[2,140]),e(J,[2,141]),e(F,[2,122],{106:I1}),{10:[1,271]},e(F,[2,123],{106:I1}),{10:[1,272]},e(Ie,[2,129]),e(F,[2,105],{106:I1}),e(F,[2,106],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(F,[2,110]),e(F,[2,112],{10:[1,273]}),e(F,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(b1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(J,[2,133]),{14:C1,44:D1,60:E1,89:T1,101:280,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{14:C1,44:D1,60:E1,89:T1,101:281,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{98:[1,282]},e(F,[2,120]),e(U,[2,58]),{30:283,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(F,[2,126],{120:168,10:[1,285],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,127],{120:168,10:[1,286],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,114]),{31:[1,287],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,288],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(F,[2,124],{106:I1}),e(F,[2,125],{106:I1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],x=[null],t=[],R1=this.table,s="",B=0,Re=0,We=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),A1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(A1.yy[J1]=this.yy[J1]);M.setInput(c,A1.yy),A1.yy.lexer=M,A1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var je=M.options&&M.options.ranges;typeof A1.yy.parseError=="function"?this.parseError=A1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ye(H){p.length=p.length-2*H,x.length=x.length-H,t.length=t.length-H}b(Ye,"popStack");function Ge(){var H;return H=u.pop()||M.lex()||Ne,typeof H!="number"&&(H instanceof Array&&(u=H,H=u.pop()),H=h.symbols_[H]||H),H}b(Ge,"lex");for(var j,k1,X,$1,w1={},q1,c1,Pe,H1;;){if(k1=p[p.length-1],this.defaultActions[k1]?X=this.defaultActions[k1]:((j===null||typeof j>"u")&&(j=Ge()),X=R1[k1]&&R1[k1][j]),typeof X>"u"||!X.length||!X[0]){var ee="";H1=[];for(q1 in R1[k1])this.terminals_[q1]&&q1>We&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(B+1)+`: +`+M.showPosition()+` +Expecting `+H1.join(", ")+", got '"+(this.terminals_[j]||j)+"'":ee="Parse error on line "+(B+1)+": Unexpected "+(j==Ne?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[j]||j,line:M.yylineno,loc:Z1,expected:H1})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k1+", token: "+j);switch(X[0]){case 1:p.push(j),x.push(M.yytext),t.push(M.yylloc),p.push(X[1]),j=null,Re=M.yyleng,s=M.yytext,B=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[X[1]][1],w1.$=x[x.length-c1],w1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},je&&(w1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(w1,[s,Re,B,A1.yy,X[1],x,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),x=x.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[X[1]][0]),x.push(w1.$),t.push(w1._$),Pe=R1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},ze=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||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:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.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),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=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 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:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(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:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(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:b(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:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in x)this[t]=x[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,x[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,x[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,x){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\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]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\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\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\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\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\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]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return f1})();Q1.lexer=ze;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} +`);return Me.parse(i)};var mt=Ue,Ct=b((e,i)=>{const r=pt,a=r(e,"r"),o=r(e,"g"),d=r(e,"b");return lt(a,o,d,i)},"fade"),Dt=b(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${Ct(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${qe()} +`,"getStyles"),Et=Dt,vt={parser:mt,get db(){return new gt},renderer:kt,styles:Et,init:b(e=>{e.flowchart||(e.flowchart={}),e.layout&&Oe({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{vt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js b/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js new file mode 100644 index 0000000000..c983cfc64d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js @@ -0,0 +1,162 @@ +import{g as qe}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{_ as b,n as Oe,l as Q,c as g1,o as He,r as Xe,u as ie,b as Qe,s as Je,p as Ze,a as $e,g as et,q as tt,k as st,t as it,J as rt,v as at,x as te,d as se,y as nt,z as ut,A as ot,B as lt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as ct}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{g as ht}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as dt}from"./chunk-2J33WTMH-w4sdiKFO.js";import{c as pt}from"./channel-DNkUo9e6.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),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=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,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{b(this,"FlowDB")}sanitizeText(e){return st.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,o,d,l={},f){if(!e||e.trim().length===0)return;let n;if(f!==void 0){let E;f.includes(` +`)?E=f+` +`:E=`{ +`+f+` +}`,n=it(E,{schema:rt})}const A=this.edges.find(E=>E.id===e);if(A){const E=n;E?.animate!==void 0&&(A.animate=E.animate),E?.animation!==void 0&&(A.animation=E.animation),E?.curve!==void 0&&(A.interpolate=E.curve);return}let S,g=this.vertices.get(e);if(g===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Q.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),g={id:e,labelType:"text",domId:ft+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,i!==void 0?(this.config=g1(),S=this.sanitizeText(i.text.trim()),g.labelType=i.type,S.startsWith('"')&&S.endsWith('"')&&(S=S.substring(1,S.length-1)),g.text=S):g.text===void 0&&(g.text=e),r!==void 0&&(g.type=r),a?.forEach(E=>{g.styles.push(E)}),o?.forEach(E=>{g.classes.push(E)}),d!==void 0&&(g.dir=d),g.props===void 0?g.props=l:l!==void 0&&Object.assign(g.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!at(n.shape))throw new Error(`No such shape: ${n.shape}.`);g.type=n?.shape}n?.label&&(g.text=n?.label,g.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(g.icon=n?.icon,!n.label?.trim()&&g.text===e&&(g.text="")),n?.form&&(g.form=n?.form),n?.pos&&(g.pos=n?.pos),n?.img&&(g.img=n?.img,!n.label?.trim()&&g.text===e&&(g.text="")),n?.constraint&&(g.constraint=n.constraint),n.w&&(g.assetWidth=Number(n.w)),n.h&&(g.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Q.info("abc78 Got edge...",l);const f=r.text;if(f!==void 0&&(l.text=this.sanitizeText(f.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(f.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(A=>A.start===l.start&&A.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Q.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Q.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],f=d===i[0];l&&f?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ct();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const f=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),i.html(nt.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ut()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(g=>{const E={boolean:{},number:{},string:{}},Z=[];let _;return{nodeList:g.filter(function(K){const h1=typeof K;return K.stmt&&K.stmt==="dir"?(_=K.value,!1):K.trim()===""?!1:h1 in E?E[h1].hasOwnProperty(K)?!1:E[h1][K]=!0:Z.includes(K)?!1:Z.push(K)}),dir:_}},"uniq")(i.flat()),f=l.nodeList;let n=l.dir;const A=g1().flowchart??{};if(n=n??(A.inheritDir?this.getDirection()??g1().direction??void 0:void 0),this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),f=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const A={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};f?i.push({...A,isGroup:!0,shape:"rect"}):i.push({...A,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const A=a[n];A.nodes.length>0&&d.set(A.id,!0);for(const S of A.nodes)o.set(S,A.id)}for(let n=a.length-1;n>=0;n--){const A=a[n];i.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const f=this.getEdges();return f.forEach((n,A)=>{const{arrowTypeStart:S,arrowTypeEnd:g}=this.destructEdgeType(n.type),E=[...f.defaultStyle??[]];n.style&&E.push(...n.style);const Z={id:te(n.start,n.end,{counter:A,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":S,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":g,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:E,style:E,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Z)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return ot.flowchart}},bt=b(function(e,i){return i.db.getClasses()},"getClasses"),At=b(async function(e,i,r,a){Q.info("REF0:"),Q.info("Drawing state diagram (v2)",i);const{securityLevel:o,flowchart:d,layout:l}=g1();a.db.setDiagramId(i),Q.debug("Before getData: ");const f=a.db.getData();Q.debug("Data: ",f);const n=ht(i,o),A=a.db.getDirection();f.type=a.type,f.layoutAlgorithm=He(l),f.layoutAlgorithm==="dagre"&&l==="elk"&&Q.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),f.direction=A,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross"],f.diagramId=i,Q.debug("REF1:",f),await Xe(f,n);const S=f.config.flowchart?.diagramPadding??8;ie.insertTitle(n,"flowchartTitleText",d?.titleTopMargin||0,a.db.getDiagramTitle()),dt(n,S,"flowchart",d?.useMaxWidth||!1)},"draw"),kt={getClasses:bt,draw:At},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],f=[1,14],n=[1,15],A=[1,16],S=[1,23],g=[1,25],E=[1,26],Z=[1,27],_=[1,50],v=[1,49],K=[1,29],h1=[1,30],N1=[1,31],G1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],m1=[8,9,11,75,77,78],ae=[1,79],C1=[1,92],D1=[1,97],E1=[1,96],T1=[1,93],S1=[1,89],y1=[1,95],x1=[1,91],F1=[1,98],_1=[1,94],B1=[1,99],v1=[1,90],b1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],Y=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],L1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],K1=[1,125],j1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],Ce=[1,145],De=[1,146],Ee=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],F=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],k=[1,177],z=[1,173],W=[1,174],m=[1,178],C=[1,175],D=[1,176],V1=[77,116,119],y=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],I1=[1,269],we=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,x,t,R1){var s=t.length-1;switch(x){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1]};break;case 78:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length};break;case 84:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(m1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:C1,44:D1,60:E1,80:[1,87],89:T1,95:[1,84],97:[1,85],101:86,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(b1,[2,51]),e(b1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:v,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(Y,[2,181]),e(Y,[2,142]),e(Y,[2,143]),e(Y,[2,144]),e(Y,[2,145]),e(Y,[2,146]),e(Y,[2,147]),e(Y,[2,148]),e(Y,[2,149]),e(Y,[2,150]),e(Y,[2,151]),e(Y,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(L1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:K1,119:j1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(m1,[2,48],{44:Le}),e(m1,[2,49],{18:156,10:d1,40:Ve}),e(b1,[2,44]),{44:_,47:158,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:_,47:163,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(F,[2,115],{120:168,10:[1,167],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,117],{10:[1,169]}),e(q,[2,183]),e(q,[2,170]),e(q,[2,171]),e(q,[2,172]),e(q,[2,173]),e(q,[2,174]),e(q,[2,175]),e(q,[2,176]),e(q,[2,177]),e(q,[2,178]),e(q,[2,179]),e(q,[2,180]),{44:_,47:170,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:179,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:181,50:[1,180],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:182,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:183,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:184,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{109:[1,185]},{30:186,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:187,65:[1,188],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:189,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:190,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:191,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(Y,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(m1,[2,46],{39:192,18:193,10:d1,40:ae}),e(L1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{77:[1,197],79:198,116:K1,119:j1},e(V1,[2,79]),e(V1,[2,81]),e(V1,[2,82]),e(V1,[2,168]),e(V1,[2,169]),{76:199,79:121,80:ue,81:oe,116:K1,119:j1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(y,[2,101]),e(y,[2,103]),e(y,[2,104]),e(y,[2,157]),e(y,[2,158]),e(y,[2,159]),e(y,[2,160]),e(y,[2,161]),e(y,[2,162]),e(y,[2,163]),e(y,[2,164]),e(y,[2,165]),e(y,[2,166]),e(y,[2,167]),e(y,[2,90]),e(y,[2,91]),e(y,[2,92]),e(y,[2,93]),e(y,[2,94]),e(y,[2,95]),e(y,[2,96]),e(y,[2,97]),e(y,[2,98]),e(y,[2,99]),e(y,[2,100]),{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,203],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(b1,[2,43]),{10:[1,206],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(F,[2,109],{10:[1,213]}),e(F,[2,111],{10:[1,214]}),{80:[1,215]},e(q,[2,184]),{80:[1,216],98:[1,217]},e(b1,[2,55],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:k,82:219,116:m,117:C,118:D},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:k,82:219,116:m,117:C,118:D},{30:221,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{51:[1,222],67:k,82:219,116:m,117:C,118:D},{53:[1,223],67:k,82:219,116:m,117:C,118:D},{55:[1,224],67:k,82:219,116:m,117:C,118:D},{57:[1,225],67:k,82:219,116:m,117:C,118:D},{60:[1,226]},{64:[1,227],67:k,82:219,116:m,117:C,118:D},{66:[1,228],67:k,82:219,116:m,117:C,118:D},{30:229,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{31:[1,230],67:k,82:219,116:m,117:C,118:D},{67:k,69:[1,231],71:[1,232],82:219,116:m,117:C,118:D},{67:k,69:[1,234],71:[1,233],82:219,116:m,117:C,118:D},e(m1,[2,45],{18:156,10:d1,40:Ve}),e(m1,[2,47],{44:Le}),e(L1,[2,75]),e(L1,[2,74]),{62:[1,235],67:k,82:219,116:m,117:C,118:D},e(L1,[2,77]),e(V1,[2,80]),{77:[1,236],79:198,116:K1,119:j1},{30:237,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(X1,d,{5:238}),e(y,[2,102]),e(T,[2,35]),{43:239,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:_,47:258,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(F,[2,116]),e(F,[2,118],{10:[1,262]}),e(F,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:k,82:219,116:m,117:C,118:D},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:k,82:219,116:m,117:C,118:D},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(L1,[2,78]),{31:[1,266],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,267],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(b1,[2,53]),{43:268,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,121],{106:I1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(J,[2,132]),e(J,[2,134]),e(J,[2,135]),e(J,[2,136]),e(J,[2,137]),e(J,[2,138]),e(J,[2,139]),e(J,[2,140]),e(J,[2,141]),e(F,[2,122],{106:I1}),{10:[1,271]},e(F,[2,123],{106:I1}),{10:[1,272]},e(Ie,[2,129]),e(F,[2,105],{106:I1}),e(F,[2,106],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(F,[2,110]),e(F,[2,112],{10:[1,273]}),e(F,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(b1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(J,[2,133]),{14:C1,44:D1,60:E1,89:T1,101:280,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{14:C1,44:D1,60:E1,89:T1,101:281,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{98:[1,282]},e(F,[2,120]),e(U,[2,58]),{30:283,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(F,[2,126],{120:168,10:[1,285],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,127],{120:168,10:[1,286],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,114]),{31:[1,287],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,288],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(F,[2,124],{106:I1}),e(F,[2,125],{106:I1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],x=[null],t=[],R1=this.table,s="",B=0,Re=0,We=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),A1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(A1.yy[J1]=this.yy[J1]);M.setInput(c,A1.yy),A1.yy.lexer=M,A1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var je=M.options&&M.options.ranges;typeof A1.yy.parseError=="function"?this.parseError=A1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ye(H){p.length=p.length-2*H,x.length=x.length-H,t.length=t.length-H}b(Ye,"popStack");function Ge(){var H;return H=u.pop()||M.lex()||Ne,typeof H!="number"&&(H instanceof Array&&(u=H,H=u.pop()),H=h.symbols_[H]||H),H}b(Ge,"lex");for(var j,k1,X,$1,w1={},q1,c1,Pe,H1;;){if(k1=p[p.length-1],this.defaultActions[k1]?X=this.defaultActions[k1]:((j===null||typeof j>"u")&&(j=Ge()),X=R1[k1]&&R1[k1][j]),typeof X>"u"||!X.length||!X[0]){var ee="";H1=[];for(q1 in R1[k1])this.terminals_[q1]&&q1>We&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(B+1)+`: +`+M.showPosition()+` +Expecting `+H1.join(", ")+", got '"+(this.terminals_[j]||j)+"'":ee="Parse error on line "+(B+1)+": Unexpected "+(j==Ne?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[j]||j,line:M.yylineno,loc:Z1,expected:H1})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k1+", token: "+j);switch(X[0]){case 1:p.push(j),x.push(M.yytext),t.push(M.yylloc),p.push(X[1]),j=null,Re=M.yyleng,s=M.yytext,B=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[X[1]][1],w1.$=x[x.length-c1],w1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},je&&(w1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(w1,[s,Re,B,A1.yy,X[1],x,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),x=x.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[X[1]][0]),x.push(w1.$),t.push(w1._$),Pe=R1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},ze=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||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:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.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),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=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 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:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(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:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(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:b(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:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in x)this[t]=x[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,x[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,x[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,x){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\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]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\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\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\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\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\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]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return f1})();Q1.lexer=ze;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} +`);return Me.parse(i)};var mt=Ue,Ct=b((e,i)=>{const r=pt,a=r(e,"r"),o=r(e,"g"),d=r(e,"b");return lt(a,o,d,i)},"fade"),Dt=b(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${Ct(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${qe()} +`,"getStyles"),Et=Dt,Bt={parser:mt,get db(){return new gt},renderer:kt,styles:Et,init:b(e=>{e.flowchart||(e.flowchart={}),e.layout&&Oe({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{Bt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js b/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js new file mode 100644 index 0000000000..19f9412a19 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js @@ -0,0 +1,292 @@ +import{bf as on,bg as $n,bh as cn,bi as un,bj as ln,bk as ue,bl as On,b4 as oe,g as Hn,s as Nn,q as Pn,p as Rn,a as Vn,b as zn,_ as d,c as Yt,d as Zt,e as qn,bm as rt,l as Tt,k as Bn,j as Zn,z as Xn,u as Gn}from"./mermaidParser.worker-Dx4jPi9z.js";import{b as jn,t as Ne,c as Qn,a as Jn,l as Kn}from"./linear-3mB6q2-g.js";import{i as tr}from"./init-Gi6I4Gst.js";import"./defaultLocale-CCNgq9ws.js";function er(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 nr(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 rr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ir(t){return"translate("+t+",0)"}function sr(t){return"translate(0,"+t+")"}function ar(t){return e=>+t(e)}function or(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,a=6,c=6,m=3,Y=typeof window<"u"&&window.devicePixelRatio>1?0:.5,C=t===Gt||t===Xt?-1:1,p=t===Xt||t===le?"x":"y",L=t===Gt||t===xe?ir:sr;function _(S){var B=r??(e.ticks?e.ticks.apply(e,n):e.domain()),A=i??(e.tickFormat?e.tickFormat.apply(e,n):rr),U=Math.max(a,0)+m,I=e.range(),N=+I[0]+Y,W=+I[I.length-1]+Y,q=(e.bandwidth?or:ar)(e.copy(),Y),j=S.selection?S.selection():S,k=j.selectAll(".domain").data([null]),g=j.selectAll(".tick").data(B,e).order(),y=g.exit(),h=g.enter().append("g").attr("class","tick"),D=g.select("line"),w=g.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),g=g.merge(h),D=D.merge(h.append("line").attr("stroke","currentColor").attr(p+"2",C*a)),w=w.merge(h.append("text").attr("fill","currentColor").attr(p,C*U).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),S!==j&&(k=k.transition(S),g=g.transition(S),D=D.transition(S),w=w.transition(S),y=y.transition(S).attr("opacity",Pe).attr("transform",function(T){return isFinite(T=q(T))?L(T+Y):this.getAttribute("transform")}),h.attr("opacity",Pe).attr("transform",function(T){var v=this.parentNode.__axis;return L((v&&isFinite(v=v(T))?v:q(T))+Y)})),y.remove(),k.attr("d",t===Xt||t===le?c?"M"+C*c+","+N+"H"+Y+"V"+W+"H"+C*c:"M"+Y+","+N+"V"+W:c?"M"+N+","+C*c+"V"+Y+"H"+W+"V"+C*c:"M"+N+","+Y+"H"+W),g.attr("opacity",1).attr("transform",function(T){return L(q(T)+Y)}),D.attr(p+"2",C*a),w.attr(p,C*U).text(A),j.filter(cr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),j.each(function(){this.__axis=q})}return _.scale=function(S){return arguments.length?(e=S,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(S){return arguments.length?(n=S==null?[]:Array.from(S),_):n.slice()},_.tickValues=function(S){return arguments.length?(r=S==null?null:Array.from(S),_):r&&r.slice()},_.tickFormat=function(S){return arguments.length?(i=S,_):i},_.tickSize=function(S){return arguments.length?(a=c=+S,_):a},_.tickSizeInner=function(S){return arguments.length?(a=+S,_):a},_.tickSizeOuter=function(S){return arguments.length?(c=+S,_):c},_.tickPadding=function(S){return arguments.length?(m=+S,_):m},_.offset=function(S){return arguments.length?(Y=+S,_):Y},_}function ur(t){return fn(Gt,t)}function lr(t){return fn(xe,t)}const fr=Math.PI/180,dr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,hr=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=$n(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),a,c;return e===n&&n===r?a=c=i:(a=fe((.4360747*e+.3850649*n+.1430804*r)/dn),c=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(a-i),200*(i-c),t.opacity)}function mr(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,mr,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>hr?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 gr(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(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const c=i(a),m=i.ceil(a);return a-c(e(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,m)=>{const Y=[];if(a=i.ceil(a),m=m==null?1:Math.floor(m),!(a0))return Y;let C;do Y.push(C=new Date(+a)),e(a,m),t(a);while(Cet(c=>{if(c>=c)for(;t(c),!a(c);)c.setTime(c-1)},(c,m)=>{if(c>=c)if(m<0)for(;++m<=0;)for(;e(c,-1),!a(c););else for(;--m>=0;)for(;e(c,1),!a(c););}),n&&(i.count=(a,c)=>(ge.setTime(+a),ye.setTime(+c),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const Et=et(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?et(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,Re=yt*30,ke=yt*365,vt=et(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Ot=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Ot.range;const vr=et(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());vr.range;const Ht=et(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());Ht.range;const Tr=et(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());Tr.range;const xt=et(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=et(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 xr=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));xr.range;function Dt(t){return et(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 Rt=Dt(0),Nt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);Rt.range;Nt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return et(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),br=Mt(2),wr=Mt(3),It=Mt(4),Dr=Mt(5),Mr=Mt(6);wn.range;re.range;br.range;wr.range;It.range;Dr.range;Mr.range;const Pt=et(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());Pt.range;const Cr=et(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());Cr.range;const kt=et(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:et(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=et(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:et(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 Sr(t,e,n,r,i,a){const c=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[a,1,ct],[a,5,5*ct],[a,15,15*ct],[a,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,Re],[e,3,3*Re],[t,1,ke]];function m(C,p,L){const _=pU).right(c,_);if(S===c.length)return t.every(Ne(C/ke,p/ke,L));if(S===0)return Et.every(Math.max(Ne(C,p,L),1));const[B,A]=c[_/c[S-1][2]53)return null;"w"in l||(l.w=1),"Z"in l?($=ve(At(l.y,0,1)),Q=$.getUTCDay(),$=Q>4||Q===0?re.ceil($):re($),$=_e.offset($,(l.V-1)*7),l.y=$.getUTCFullYear(),l.m=$.getUTCMonth(),l.d=$.getUTCDate()+(l.w+6)%7):($=pe(At(l.y,0,1)),Q=$.getDay(),$=Q>4||Q===0?Nt.ceil($):Nt($),$=xt.offset($,(l.V-1)*7),l.y=$.getFullYear(),l.m=$.getMonth(),l.d=$.getDate()+(l.w+6)%7)}else("W"in l||"U"in l)&&("w"in l||(l.w="u"in l?l.u%7:"W"in l?1:0),Q="Z"in l?ve(At(l.y,0,1)).getUTCDay():pe(At(l.y,0,1)).getDay(),l.m=0,l.d="W"in l?(l.w+6)%7+l.W*7-(Q+5)%7:l.w+l.U*7-(Q+6)%7);return"Z"in l?(l.H+=l.Z/100|0,l.M+=l.Z%100,ve(l)):pe(l)}}function y(M,H,R,l){for(var J=0,$=H.length,Q=R.length,G,it;J<$;){if(l>=Q)return-1;if(G=H.charCodeAt(J++),G===37){if(G=H.charAt(J++),it=j[G in Ve?H.charAt(J++):G],!it||(l=it(M,R,l))<0)return-1}else if(G!=R.charCodeAt(l++))return-1}return l}function h(M,H,R){var l=C.exec(H.slice(R));return l?(M.p=p.get(l[0].toLowerCase()),R+l[0].length):-1}function D(M,H,R){var l=S.exec(H.slice(R));return l?(M.w=B.get(l[0].toLowerCase()),R+l[0].length):-1}function w(M,H,R){var l=L.exec(H.slice(R));return l?(M.w=_.get(l[0].toLowerCase()),R+l[0].length):-1}function T(M,H,R){var l=I.exec(H.slice(R));return l?(M.m=N.get(l[0].toLowerCase()),R+l[0].length):-1}function v(M,H,R){var l=A.exec(H.slice(R));return l?(M.m=U.get(l[0].toLowerCase()),R+l[0].length):-1}function u(M,H,R){return y(M,e,H,R)}function f(M,H,R){return y(M,n,H,R)}function x(M,H,R){return y(M,r,H,R)}function b(M){return c[M.getDay()]}function F(M){return a[M.getDay()]}function o(M){return Y[M.getMonth()]}function X(M){return m[M.getMonth()]}function s(M){return i[+(M.getHours()>=12)]}function E(M){return 1+~~(M.getMonth()/3)}function z(M){return c[M.getUTCDay()]}function V(M){return a[M.getUTCDay()]}function P(M){return Y[M.getUTCMonth()]}function K(M){return m[M.getUTCMonth()]}function O(M){return i[+(M.getUTCHours()>=12)]}function st(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var H=k(M+="",W);return H.toString=function(){return M},H},parse:function(M){var H=g(M+="",!1);return H.toString=function(){return M},H},utcFormat:function(M){var H=k(M+="",q);return H.toString=function(){return M},H},utcParse:function(M){var H=g(M+="",!0);return H.toString=function(){return M},H}}}var Ve={"-":"",_:" ",0:"0"},nt=/^\s*\d+/,Ur=/^%/,Er=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Lr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hr(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 Nr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Pr(t,e,n){var r=nt.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=nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=nt.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=nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zr(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function jr(t,e){return Z(t.getHours(),e,2)}function Qr(t,e){return Z(t.getHours()%12||12,e,2)}function Jr(t,e){return Z(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function Kr(t,e){return Dn(t,e)+"000"}function ti(t,e){return Z(t.getMonth()+1,e,2)}function ei(t,e){return Z(t.getMinutes(),e,2)}function ni(t,e){return Z(t.getSeconds(),e,2)}function ri(t){var e=t.getDay();return e===0?7:e}function ii(t,e){return Z(Rt.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 si(t,e){return t=Mn(t),Z(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ai(t){return t.getDay()}function oi(t,e){return Z(Nt.count(kt(t)-1,t),e,2)}function ci(t,e){return Z(t.getFullYear()%100,e,2)}function ui(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function li(t,e){return Z(t.getFullYear()%1e4,e,4)}function fi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function di(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function hi(t,e){return Z(t.getUTCHours(),e,2)}function mi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function gi(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function yi(t,e){return Cn(t,e)+"000"}function ki(t,e){return Z(t.getUTCMonth()+1,e,2)}function pi(t,e){return Z(t.getUTCMinutes(),e,2)}function vi(t,e){return Z(t.getUTCSeconds(),e,2)}function Ti(t){var e=t.getUTCDay();return e===0?7:e}function xi(t,e){return Z(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 bi(t,e){return t=Sn(t),Z(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function wi(t){return t.getUTCDay()}function Di(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Mi(t,e){return Z(t.getUTCFullYear()%100,e,2)}function Ci(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Si(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function _i(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Yi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Fi({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 Fi(t){return St=Fr(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ui(t){return new Date(t)}function Ei(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,a,c,m,Y,C){var p=Qn(),L=p.invert,_=p.domain,S=C(".%L"),B=C(":%S"),A=C("%I:%M"),U=C("%I %p"),I=C("%a %d"),N=C("%b %d"),W=C("%B"),q=C("%Y");function j(k){return(Y(k)4&&(S+=7),_.add(S,n));return B.diff(A,"week")+1},m.isoWeekday=function(C){return this.$utils().u(C)?this.day()||7:this.day(this.day()%7?C:C-7)};var Y=m.startOf;m.startOf=function(C,p){var L=this.$utils(),_=!!L.u(p)||p;return L.p(C)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):Y.bind(this)(C,p)}}}))})(jt)),jt.exports}var Wi=Ai(),$i=oe(Wi),Qt={exports:{}},Oi=Qt.exports,tn;function Hi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Oi,(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/,a=/\d\d/,c=/\d\d?/,m=/\d*[^-_:/,()\s\d]+/,Y={},C=function(U){return(U=+U)+(U>68?1900:2e3)},p=function(U){return function(I){this[U]=+I}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var N=I.match(/([+-]|\d\d)/g),W=60*N[1]+(+N[2]||0);return W===0?0:N[0]==="+"?-W:W})(U)}],_=function(U){var I=Y[U];return I&&(I.indexOf?I:I.s.concat(I.f))},S=function(U,I){var N,W=Y.meridiem;if(W){for(var q=1;q<=24;q+=1)if(U.indexOf(W(q,0,I))>-1){N=q>12;break}}else N=U===(I?"pm":"PM");return N},B={A:[m,function(U){this.afternoon=S(U,!1)}],a:[m,function(U){this.afternoon=S(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],s:[c,p("seconds")],ss:[c,p("seconds")],m:[c,p("minutes")],mm:[c,p("minutes")],H:[c,p("hours")],h:[c,p("hours")],HH:[c,p("hours")],hh:[c,p("hours")],D:[c,p("day")],DD:[a,p("day")],Do:[m,function(U){var I=Y.ordinal,N=U.match(/\d+/);if(this.day=N[0],I)for(var W=1;W<=31;W+=1)I(W).replace(/\[|\]/g,"")===U&&(this.day=W)}],w:[c,p("week")],ww:[a,p("week")],M:[c,p("month")],MM:[a,p("month")],MMM:[m,function(U){var I=_("months"),N=(_("monthsShort")||I.map((function(W){return W.slice(0,3)}))).indexOf(U)+1;if(N<1)throw new Error;this.month=N%12||N}],MMMM:[m,function(U){var I=_("months").indexOf(U)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,p("year")],YY:[a,function(U){this.year=C(U)}],YYYY:[/\d{4}/,p("year")],Z:L,ZZ:L};function A(U){var I,N;I=U,N=Y&&Y.formats;for(var W=(U=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,w,T){var v=T&&T.toUpperCase();return w||N[T]||n[T]||N[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(u,f,x){return f||x.slice(1)}))}))).match(r),q=W.length,j=0;j-1)return new Date((F==="X"?1e3:1)*b);var s=A(F)(b),E=s.year,z=s.month,V=s.day,P=s.hours,K=s.minutes,O=s.seconds,st=s.milliseconds,M=s.zone,H=s.week,R=new Date,l=V||(E||z?1:R.getDate()),J=E||R.getFullYear(),$=0;E&&!z||($=z>0?z-1:R.getMonth());var Q,G=P||0,it=K||0,at=O||0,pt=st||0;return M?new Date(Date.UTC(J,$,l,G,it,at,pt+60*M.offset*1e3)):o?new Date(Date.UTC(J,$,l,G,it,at,pt)):(Q=new Date(J,$,l,G,it,at,pt),H&&(Q=X(Q).week(H).toDate()),Q)}catch{return new Date("")}})(k,h,g,N),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),T&&k!=this.format(h)&&(this.$d=new Date("")),Y={}}else if(h instanceof Array)for(var u=h.length,f=1;f<=u;f+=1){y[1]=h[f-1];var x=N.apply(this,y);if(x.isValid()){this.$d=x.$d,this.$L=x.$L,this.init();break}f===u&&(this.$d=new Date(""))}else q.call(this,j)}}}))})(Qt)),Qt.exports}var Ni=Hi(),Pi=oe(Ni),Jt={exports:{}},Ri=Jt.exports,en;function Vi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,a=i.format;i.format=function(c){var m=this,Y=this.$locale();if(!this.isValid())return a.bind(this)(c);var C=this.$utils(),p=(c||"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(L){switch(L){case"Q":return Math.ceil((m.$M+1)/3);case"Do":return Y.ordinal(m.$D);case"gggg":return m.weekYear();case"GGGG":return m.isoWeekYear();case"wo":return Y.ordinal(m.week(),"W");case"w":case"ww":return C.s(m.week(),L==="w"?1:2,"0");case"W":case"WW":return C.s(m.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return C.s(String(m.$H===0?24:m.$H),L==="k"?1:2,"0");case"X":return Math.floor(m.$d.getTime()/1e3);case"x":return m.$d.getTime();case"z":return"["+m.offsetName()+"]";case"zzz":return"["+m.offsetName("long")+"]";default:return L}}));return a.bind(this)(p)}}}))})(Jt)),Jt.exports}var zi=Vi(),qi=oe(zi),Kt={exports:{}},Bi=Kt.exports,nn;function Zi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Bi,(function(){var n,r,i=1e3,a=6e4,c=36e5,m=864e5,Y=31536e6,C=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,L=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:Y,months:C,days:m,hours:c,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},S=function(k){return k instanceof q},B=function(k,g,y){return new q(k,y,g.$l)},A=function(k){return r.p(k)+"s"},U=function(k){return k<0},I=function(k){return U(k)?Math.ceil(k):Math.floor(k)},N=function(k){return Math.abs(k)},W=function(k,g){return k?U(k)?{negative:!0,format:""+N(k)+g}:{negative:!1,format:""+k+g}:{negative:!1,format:""}},q=(function(){function k(y,h,D){var w=this;if(this.$d={},this.$l=D,y===void 0&&(this.$ms=0,this.parseFromMilliseconds()),h)return B(y*_[A(h)],this);if(typeof y=="number")return this.$ms=y,this.parseFromMilliseconds(),this;if(typeof y=="object")return Object.keys(y).forEach((function(u){w.$d[A(u)]=y[u]})),this.calMilliseconds(),this;if(typeof y=="string"){var T=y.match(p);if(T){var v=T.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=v[0],this.$d.months=v[1],this.$d.weeks=v[2],this.$d.days=v[3],this.$d.hours=v[4],this.$d.minutes=v[5],this.$d.seconds=v[6],this.calMilliseconds(),this}}return this}var g=k.prototype;return g.calMilliseconds=function(){var y=this;this.$ms=Object.keys(this.$d).reduce((function(h,D){return h+(y.$d[D]||0)*_[D]}),0)},g.parseFromMilliseconds=function(){var y=this.$ms;this.$d.years=I(y/Y),y%=Y,this.$d.months=I(y/C),y%=C,this.$d.days=I(y/m),y%=m,this.$d.hours=I(y/c),y%=c,this.$d.minutes=I(y/a),y%=a,this.$d.seconds=I(y/i),y%=i,this.$d.milliseconds=y},g.toISOString=function(){var y=W(this.$d.years,"Y"),h=W(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var w=W(D,"D"),T=W(this.$d.hours,"H"),v=W(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var f=W(u,"S"),x=y.negative||h.negative||w.negative||T.negative||v.negative||f.negative,b=T.format||v.format||f.format?"T":"",F=(x?"-":"")+"P"+y.format+h.format+w.format+b+T.format+v.format+f.format;return F==="P"||F==="-P"?"P0D":F},g.toJSON=function(){return this.toISOString()},g.format=function(y){var h=y||"YYYY-MM-DDTHH:mm:ss",D={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 h.replace(L,(function(w,T){return T||String(D[w])}))},g.as=function(y){return this.$ms/_[A(y)]},g.get=function(y){var h=this.$ms,D=A(y);return D==="milliseconds"?h%=1e3:h=D==="weeks"?I(h/_[D]):this.$d[D],h||0},g.add=function(y,h,D){var w;return w=h?y*_[A(h)]:S(y)?y.$ms:B(y,this).$ms,B(this.$ms+w*(D?-1:1),this)},g.subtract=function(y,h){return this.add(y,h,!0)},g.locale=function(y){var h=this.clone();return h.$l=y,h},g.clone=function(){return B(this.$ms,this)},g.humanize=function(y){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!y)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},k})(),j=function(k,g,y){return k.add(g.years()*y,"y").add(g.months()*y,"M").add(g.days()*y,"d").add(g.hours()*y,"h").add(g.minutes()*y,"m").add(g.seconds()*y,"s").add(g.milliseconds()*y,"ms")};return function(k,g,y){n=y,r=y().$utils(),y.duration=function(w,T){var v=y.locale();return B(w,{$l:v},T)},y.isDuration=S;var h=g.prototype.add,D=g.prototype.subtract;g.prototype.add=function(w,T){return S(w)?j(this,w,1):h.bind(this)(w,T)},g.prototype.subtract=function(w,T){return S(w)?j(this,w,-1):D.bind(this)(w,T)}}}))})(Kt)),Kt.exports}var Xi=Zi(),Gi=oe(Xi),we=(function(){var t=d(function(v,u,f,x){for(f=f||{},x=v.length;x--;f[v[x]]=u);return f},"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],a=[1,29],c=[1,30],m=[1,31],Y=[1,32],C=[1,33],p=[1,34],L=[1,9],_=[1,10],S=[1,11],B=[1,12],A=[1,13],U=[1,14],I=[1,15],N=[1,16],W=[1,19],q=[1,20],j=[1,21],k=[1,22],g=[1,23],y=[1,25],h=[1,35],D={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(u,f,x,b,F,o,X){var s=o.length-1;switch(F){case 1:return o[s-1];case 2:this.$=[];break;case 3:o[s-1].push(o[s]),this.$=o[s-1];break;case 4:case 5:this.$=o[s];break;case 6:case 7:this.$=[];break;case 8:b.setWeekday("monday");break;case 9:b.setWeekday("tuesday");break;case 10:b.setWeekday("wednesday");break;case 11:b.setWeekday("thursday");break;case 12:b.setWeekday("friday");break;case 13:b.setWeekday("saturday");break;case 14:b.setWeekday("sunday");break;case 15:b.setWeekend("friday");break;case 16:b.setWeekend("saturday");break;case 17:b.setDateFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 18:b.enableInclusiveEndDates(),this.$=o[s].substr(18);break;case 19:b.TopAxis(),this.$=o[s].substr(8);break;case 20:b.setAxisFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 21:b.setTickInterval(o[s].substr(13)),this.$=o[s].substr(13);break;case 22:b.setExcludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 23:b.setIncludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 24:b.setTodayMarker(o[s].substr(12)),this.$=o[s].substr(12);break;case 27:b.setDiagramTitle(o[s].substr(6)),this.$=o[s].substr(6);break;case 28:this.$=o[s].trim(),b.setAccTitle(this.$);break;case 29:case 30:this.$=o[s].trim(),b.setAccDescription(this.$);break;case 31:b.addSection(o[s].substr(8)),this.$=o[s].substr(8);break;case 33:b.addTask(o[s-1],o[s]),this.$="task";break;case 34:this.$=o[s-1],b.setClickEvent(o[s-1],o[s],null);break;case 35:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],o[s]);break;case 36:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],null),b.setLink(o[s-2],o[s]);break;case 37:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-2],o[s-1]),b.setLink(o[s-3],o[s]);break;case 38:this.$=o[s-2],b.setClickEvent(o[s-2],o[s],null),b.setLink(o[s-2],o[s-1]);break;case 39:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-1],o[s]),b.setLink(o[s-3],o[s-2]);break;case 40:this.$=o[s-1],b.setLink(o[s-1],o[s]);break;case 41:case 47:this.$=o[s-1]+" "+o[s];break;case 42:case 43:case 45:this.$=o[s-2]+" "+o[s-1]+" "+o[s];break;case 44:case 46:this.$=o[s-3]+" "+o[s-2]+" "+o[s-1]+" "+o[s];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:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},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(u,f){if(f.recoverable)this.trace(u);else{var x=new Error(u);throw x.hash=f,x}},"parseError"),parse:d(function(u){var f=this,x=[0],b=[],F=[null],o=[],X=this.table,s="",E=0,z=0,V=2,P=1,K=o.slice.call(arguments,1),O=Object.create(this.lexer),st={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(st.yy[M]=this.yy[M]);O.setInput(u,st.yy),st.yy.lexer=O,st.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var H=O.yylloc;o.push(H);var R=O.options&&O.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function l(ot){x.length=x.length-2*ot,F.length=F.length-ot,o.length=o.length-ot}d(l,"popStack");function J(){var ot;return ot=b.pop()||O.lex()||P,typeof ot!="number"&&(ot instanceof Array&&(b=ot,ot=b.pop()),ot=f.symbols_[ot]||ot),ot}d(J,"lex");for(var $,Q,G,it,at={},pt,ut,He,Bt;;){if(Q=x[x.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:(($===null||typeof $>"u")&&($=J()),G=X[Q]&&X[Q][$]),typeof G>"u"||!G.length||!G[0]){var ce="";Bt=[];for(pt in X[Q])this.terminals_[pt]&&pt>V&&Bt.push("'"+this.terminals_[pt]+"'");O.showPosition?ce="Parse error on line "+(E+1)+`: +`+O.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":ce="Parse error on line "+(E+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(ce,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:H,expected:Bt})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+$);switch(G[0]){case 1:x.push($),F.push(O.yytext),o.push(O.yylloc),x.push(G[1]),$=null,z=O.yyleng,s=O.yytext,E=O.yylineno,H=O.yylloc;break;case 2:if(ut=this.productions_[G[1]][1],at.$=F[F.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},R&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),it=this.performAction.apply(at,[s,z,E,st.yy,G[1],F,o].concat(K)),typeof it<"u")return it;ut&&(x=x.slice(0,-1*ut*2),F=F.slice(0,-1*ut),o=o.slice(0,-1*ut)),x.push(this.productions_[G[1]][0]),F.push(at.$),o.push(at._$),He=X[x[x.length-2]][x[x.length-1]],x.push(He);break;case 3:return!0}}return!0},"parse")},w=(function(){var v={EOF:1,parseError:d(function(f,x){if(this.yy.parser)this.yy.parser.parseError(f,x);else throw new Error(f)},"parseError"),setInput:d(function(u,f){return this.yy=f||this.yy||{},this._input=u,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 u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var f=u.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:d(function(u){var f=u.length,x=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var b=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),x.length-1&&(this.yylineno-=x.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:x?(x.length===b.length?this.yylloc.first_column:0)+b[b.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-f]),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(u){this.unput(this.match.slice(u))},"less"),pastInput:d(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var u=this.pastInput(),f=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+f+"^"},"showPosition"),test_match:d(function(u,f){var x,b,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),b=u[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,f,x,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;of[0].length)){if(f=x,b=o,this.options.backtrack_lexer){if(u=this.test_match(x,F[o]),u!==!1)return u;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(u=this.test_match(f,F[b]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var f=this.next();return f||this.lex()},"lex"),begin:d(function(f){this.conditionStack.push(f)},"begin"),popState:d(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:d(function(f){this.begin(f)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(f,x,b,F){switch(b){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return v})();D.lexer=w;function T(){this.yy={}}return d(T,"Parser"),T.prototype=D,D.Parser=T,new T})();we.parser=we;var ji=we;rt.extend($i);rt.extend(Pi);rt.extend(qi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Vt=[],zt=[],Ee=new Map,Ie=[],se=[],Lt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Qi=d(function(){Ie=[],se=[],Lt="",Ae=[],te=0,Ce=void 0,ee=void 0,tt=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Vt=[],zt=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Xn(),$e="sunday",ae="saturday"},"clear"),Ji=d(function(t){_t=t},"setDiagramId"),Ki=d(function(t){Ye=t},"setAxisFormat"),ts=d(function(){return Ye},"getAxisFormat"),es=d(function(t){Fe=t},"setTickInterval"),ns=d(function(){return Fe},"getTickInterval"),rs=d(function(t){Ue=t},"setTodayMarker"),is=d(function(){return Ue},"getTodayMarker"),ss=d(function(t){lt=t},"setDateFormat"),as=d(function(){qt=!0},"enableInclusiveEndDates"),os=d(function(){return qt},"endDatesAreInclusive"),cs=d(function(){We=!0},"enableTopAxis"),us=d(function(){return We},"topAxisEnabled"),ls=d(function(t){Le=t},"setDisplayMode"),fs=d(function(){return Le},"getDisplayMode"),ds=d(function(){return lt},"getDateFormat"),hs=d(function(t){Vt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),ms=d(function(){return Vt},"getIncludes"),gs=d(function(t){zt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),ys=d(function(){return zt},"getExcludes"),ks=d(function(){return Ee},"getLinks"),ps=d(function(t){Lt=t,Ie.push(t)},"addSection"),vs=d(function(){return Ie},"getSections"),Ts=d(function(){let t=sn();const e=10;let n=0;for(;!t&&nm))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,c]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(m=>{const Y=m.trim();return Y==="x"||Y==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const a=/^after\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let m=null;for(const C of a.groups.ids.split(" ")){let p=Ct(C);p!==void 0&&(!m||p.endTime>m.endTime)&&(m=p)}if(m)return m.endTime;const Y=new Date;return Y.setHours(0,0,0,0),Y}let c=rt(n,e.trim(),!0);if(c.isValid())return c.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const m=new Date(n);if(m===void 0||isNaN(m.getTime())||m.getFullYear()<-1e4||m.getFullYear()>1e4)throw new Error("Invalid date:"+n);return m}},"getStartDate"),En=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),In=d(function(t,e,n,r=!1){n=n.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let p=null;for(const _ of a.groups.ids.split(" ")){let S=Ct(_);S!==void 0&&(!p||S.startTime{window.open(n,"_self")}),Ee.set(r,n))}),An(t,"clickable")},"setLink"),An=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Fs=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Gn.runFunc(e,...r)})},"setClickFun"),Wn=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Us=d(function(t,e,n){t.split(",").forEach(function(r){Fs(r,e,n)}),An(t,"clickable")},"setClickEvent"),Es=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Is={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Qi,setDateFormat:ss,getDateFormat:ds,enableInclusiveEndDates:as,endDatesAreInclusive:os,enableTopAxis:cs,topAxisEnabled:us,setAxisFormat:Ki,getAxisFormat:ts,setTickInterval:es,getTickInterval:ns,setTodayMarker:rs,getTodayMarker:is,setAccTitle:zn,getAccTitle:Vn,setDiagramTitle:Rn,getDiagramTitle:Pn,setDiagramId:Ji,setDisplayMode:ls,getDisplayMode:fs,setAccDescription:Nn,getAccDescription:Hn,addSection:ps,getSections:vs,getTasks:Ts,addTask:Ss,findTaskById:Ct,addTaskOrg:_s,setIncludes:hs,getIncludes:ms,setExcludes:gs,getExcludes:ys,setClickEvent:Us,setLink:Ys,getLinks:ks,bindFunctions:Es,parseDuration:En,isInvalidDate:Fn,setWeekday:xs,getWeekday:bs,setWeekend:ws};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const a="^\\s*"+i+"\\s*$",c=new RegExp(a);t[0].match(c)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");rt.extend(Gi);var Ls=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Nt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:Rt},As=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((a,c)=>a.startTime-c.startTime||a.order-c.order),i=0;for(const a of r)for(let c=0;c=n[c]){n[c]=a.endTime,a.order=c+e,c>i&&(i=c);break}return i},"getMaxIntersections"),dt,Te=1e4,Ws=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const a=Yt().securityLevel;let c;a==="sandbox"&&(c=Zt("#i"+e));const m=a==="sandbox"?Zt(c.nodes()[0].contentDocument.body):Zt("body"),Y=a==="sandbox"?c.nodes()[0].contentDocument:document,C=Y.getElementById(e);dt=C.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const p=r.db.getTasks();let L=[];for(const h of p)L.push(h.type);L=y(L);const _={};let S=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const h={};for(const w of p)h[w.section]===void 0?h[w.section]=[w]:h[w.section].push(w);let D=0;for(const w of Object.keys(h)){const T=As(h[w],D)+1;D+=T,S+=T*(i.barHeight+i.barGap),_[w]=T}}else{S+=p.length*(i.barHeight+i.barGap);for(const h of L)_[h]=p.filter(D=>D.type===h).length}C.setAttribute("viewBox","0 0 "+dt+" "+S);const B=m.select(`[id="${e}"]`),A=Ii().domain([nr(p,function(h){return h.startTime}),er(p,function(h){return h.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(h,D){const w=h.startTime,T=D.startTime;let v=0;return w>T?v=1:ws.vert===E.vert?0:s.vert?1:-1);const b=[...new Set(h.map(s=>s.order))].map(s=>h.find(E=>E.order===s));B.append("g").selectAll("rect").data(b).enter().append("rect").attr("x",0).attr("y",function(s,E){return E=s.order,E*D+w-2}).attr("width",function(){return f-i.rightPadding/2}).attr("height",D).attr("class",function(s){for(const[E,z]of L.entries())if(s.type===z)return"section section"+E%i.numberSectionStyles;return"section section0"}).enter();const F=B.append("g").selectAll("rect").data(h).enter(),o=r.db.getLinks();if(F.append("rect").attr("id",function(s){return e+"-"+s.id}).attr("rx",3).attr("ry",3).attr("x",function(s){return s.milestone?A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))-.5*v:A(s.startTime)+T}).attr("y",function(s,E){return E=s.order,s.vert?i.gridLineStartPadding:E*D+w}).attr("width",function(s){return s.milestone?v:s.vert?.08*v:A(s.renderEndTime||s.endTime)-A(s.startTime)}).attr("height",function(s){return s.vert?p.length*(i.barHeight+i.barGap)+i.barHeight*2:v}).attr("transform-origin",function(s,E){return E=s.order,(A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))).toString()+"px "+(E*D+w+.5*v).toString()+"px"}).attr("class",function(s){const E="task";let z="";s.classes.length>0&&(z=s.classes.join(" "));let V=0;for(const[K,O]of L.entries())s.type===O&&(V=K%i.numberSectionStyles);let P="";return s.active?s.crit?P+=" activeCrit":P=" active":s.done?s.crit?P=" doneCrit":P=" done":s.crit&&(P+=" crit"),P.length===0&&(P=" task"),s.milestone&&(P=" milestone "+P),s.vert&&(P=" vert "+P),P+=V,P+=" "+z,E+P}),F.append("text").attr("id",function(s){return e+"-"+s.id+"-text"}).text(function(s){return s.task}).attr("font-size",i.fontSize).attr("x",function(s){let E=A(s.startTime),z=A(s.renderEndTime||s.endTime);if(s.milestone&&(E+=.5*(A(s.endTime)-A(s.startTime))-.5*v,z=E+v),s.vert)return A(s.startTime)+T;const V=this.getBBox().width;return V>z-E?z+V+1.5*i.leftPadding>f?E+T-5:z+T+5:(z-E)/2+E+T}).attr("y",function(s,E){return s.vert?i.gridLineStartPadding+p.length*(i.barHeight+i.barGap)+60:(E=s.order,E*D+i.barHeight/2+(i.fontSize/2-2)+w)}).attr("text-height",v).attr("class",function(s){const E=A(s.startTime);let z=A(s.endTime);s.milestone&&(z=E+v);const V=this.getBBox().width;let P="";s.classes.length>0&&(P=s.classes.join(" "));let K=0;for(const[st,M]of L.entries())s.type===M&&(K=st%i.numberSectionStyles);let O="";return s.active&&(s.crit?O="activeCritText"+K:O="activeText"+K),s.done?s.crit?O=O+" doneCritText"+K:O=O+" doneText"+K:s.crit&&(O=O+" critText"+K),s.milestone&&(O+=" milestoneText"),s.vert&&(O+=" vertText"),V>z-E?z+V+1.5*i.leftPadding>f?P+" taskTextOutsideLeft taskTextOutside"+K+" "+O:P+" taskTextOutsideRight taskTextOutside"+K+" "+O+" width-"+V:P+" taskText taskText"+K+" "+O+" width-"+V}),Yt().securityLevel==="sandbox"){let s;s=Zt("#i"+e);const E=s.nodes()[0].contentDocument;F.filter(function(z){return o.has(z.id)}).each(function(z){var V=E.querySelector("#"+CSS.escape(e+"-"+z.id)),P=E.querySelector("#"+CSS.escape(e+"-"+z.id+"-text"));const K=V.parentNode;var O=E.createElement("a");O.setAttribute("xlink:href",o.get(z.id)),O.setAttribute("target","_top"),K.appendChild(O),O.appendChild(V),O.appendChild(P)})}}d(N,"drawRects");function W(h,D,w,T,v,u,f,x){if(f.length===0&&x.length===0)return;let b,F;for(const{startTime:V,endTime:P}of u)(b===void 0||VF)&&(F=P);if(!b||!F)return;if(rt(F).diff(rt(b),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const o=r.db.getDateFormat(),X=[];let s=null,E=rt(b);for(;E.valueOf()<=F;)r.db.isInvalidDate(E,o,f,x)?s?s.end=E:s={start:E,end:E}:s&&(X.push(s),s=null),E=E.add(1,"d");B.append("g").selectAll("rect").data(X).enter().append("rect").attr("id",V=>e+"-exclude-"+V.start.format("YYYY-MM-DD")).attr("x",V=>A(V.start.startOf("day"))+w).attr("y",i.gridLineStartPadding).attr("width",V=>A(V.end.endOf("day"))-A(V.start.startOf("day"))).attr("height",v-D-i.gridLineStartPadding).attr("transform-origin",function(V,P){return(A(V.start)+w+.5*(A(V.end)-A(V.start))).toString()+"px "+(P*h+.5*v).toString()+"px"}).attr("class","exclude-range")}d(W,"drawExcludeDays");function q(h,D,w,T){if(w<=0||h>D)return 1/0;const v=D-h,u=rt.duration({[T??"day"]:w}).asMilliseconds();return u<=0?1/0:Math.ceil(v/u)}d(q,"getEstimatedTickCount");function j(h,D,w,T){const v=r.db.getDateFormat(),u=r.db.getAxisFormat();let f;u?f=u:v==="D"?f="%d":f=i.axisFormat??"%Y-%m-%d";let x=lr(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(F!==null){const o=parseInt(F[1],10);if(isNaN(o)||o<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const X=F[2],s=r.db.getWeekday()||i.weekday,E=A.domain(),z=E[0],V=E[1],P=q(z,V,o,X);if(P>Te)Tt.warn(`The tick interval "${o}${X}" would generate ${P} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(X){case"millisecond":x.ticks(Et.every(o));break;case"second":x.ticks(vt.every(o));break;case"minute":x.ticks(Ot.every(o));break;case"hour":x.ticks(Ht.every(o));break;case"day":x.ticks(xt.every(o));break;case"week":x.ticks(an[s].every(o));break;case"month":x.ticks(Pt.every(o));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+h+", "+(T-50)+")").call(x).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let o=ur(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));if(F!==null){const X=parseInt(F[1],10);if(isNaN(X)||X<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const s=F[2],E=r.db.getWeekday()||i.weekday,z=A.domain(),V=z[0],P=z[1];if(q(V,P,X,s)<=Te)switch(s){case"millisecond":o.ticks(Et.every(X));break;case"second":o.ticks(vt.every(X));break;case"minute":o.ticks(Ot.every(X));break;case"hour":o.ticks(Ht.every(X));break;case"day":o.ticks(xt.every(X));break;case"week":o.ticks(an[E].every(X));break;case"month":o.ticks(Pt.every(X));break}}}B.append("g").attr("class","grid").attr("transform","translate("+h+", "+D+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(j,"makeGrid");function k(h,D){let w=0;const T=Object.keys(_).map(v=>[v,_[v]]);B.append("g").selectAll("text").data(T).enter().append(function(v){const u=v[0].split(Bn.lineBreakRegex),f=-(u.length-1)/2,x=Y.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("dy",f+"em");for(const[b,F]of u.entries()){const o=Y.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttribute("alignment-baseline","central"),o.setAttribute("x","10"),b>0&&o.setAttribute("dy","1em"),o.textContent=F,x.appendChild(o)}return x}).attr("x",10).attr("y",function(v,u){if(u>0)for(let f=0;f` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Hs=Os,zs={parser:ji,db:Is,renderer:$s,styles:Hs};export{zs as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-DQcybq4U.js b/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-DQcybq4U.js new file mode 100644 index 0000000000..66eeddde51 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-6RSMTGT7-DQcybq4U.js @@ -0,0 +1,292 @@ +import{bf as on,bg as $n,bh as cn,bi as un,bj as ln,bk as ue,bl as On,b4 as oe,g as Hn,s as Nn,q as Pn,p as Rn,a as Vn,b as zn,_ as d,c as Yt,d as Zt,e as qn,bm as rt,l as Tt,k as Bn,j as Zn,z as Xn,u as Gn}from"./mermaid.core-zKrc8Ye9.js";import{b as jn,t as Ne,c as Qn,a as Jn,l as Kn}from"./linear-JZGc9yht.js";import{i as tr}from"./init-Gi6I4Gst.js";import"./index-DtRfJ0vw.js";import"./defaultLocale-DX6XiGOO.js";function er(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 nr(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 rr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ir(t){return"translate("+t+",0)"}function sr(t){return"translate(0,"+t+")"}function ar(t){return e=>+t(e)}function or(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,a=6,c=6,m=3,Y=typeof window<"u"&&window.devicePixelRatio>1?0:.5,C=t===Gt||t===Xt?-1:1,p=t===Xt||t===le?"x":"y",L=t===Gt||t===xe?ir:sr;function _(S){var B=r??(e.ticks?e.ticks.apply(e,n):e.domain()),A=i??(e.tickFormat?e.tickFormat.apply(e,n):rr),U=Math.max(a,0)+m,I=e.range(),N=+I[0]+Y,W=+I[I.length-1]+Y,q=(e.bandwidth?or:ar)(e.copy(),Y),j=S.selection?S.selection():S,k=j.selectAll(".domain").data([null]),g=j.selectAll(".tick").data(B,e).order(),y=g.exit(),h=g.enter().append("g").attr("class","tick"),D=g.select("line"),w=g.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),g=g.merge(h),D=D.merge(h.append("line").attr("stroke","currentColor").attr(p+"2",C*a)),w=w.merge(h.append("text").attr("fill","currentColor").attr(p,C*U).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),S!==j&&(k=k.transition(S),g=g.transition(S),D=D.transition(S),w=w.transition(S),y=y.transition(S).attr("opacity",Pe).attr("transform",function(T){return isFinite(T=q(T))?L(T+Y):this.getAttribute("transform")}),h.attr("opacity",Pe).attr("transform",function(T){var v=this.parentNode.__axis;return L((v&&isFinite(v=v(T))?v:q(T))+Y)})),y.remove(),k.attr("d",t===Xt||t===le?c?"M"+C*c+","+N+"H"+Y+"V"+W+"H"+C*c:"M"+Y+","+N+"V"+W:c?"M"+N+","+C*c+"V"+Y+"H"+W+"V"+C*c:"M"+N+","+Y+"H"+W),g.attr("opacity",1).attr("transform",function(T){return L(q(T)+Y)}),D.attr(p+"2",C*a),w.attr(p,C*U).text(A),j.filter(cr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),j.each(function(){this.__axis=q})}return _.scale=function(S){return arguments.length?(e=S,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(S){return arguments.length?(n=S==null?[]:Array.from(S),_):n.slice()},_.tickValues=function(S){return arguments.length?(r=S==null?null:Array.from(S),_):r&&r.slice()},_.tickFormat=function(S){return arguments.length?(i=S,_):i},_.tickSize=function(S){return arguments.length?(a=c=+S,_):a},_.tickSizeInner=function(S){return arguments.length?(a=+S,_):a},_.tickSizeOuter=function(S){return arguments.length?(c=+S,_):c},_.tickPadding=function(S){return arguments.length?(m=+S,_):m},_.offset=function(S){return arguments.length?(Y=+S,_):Y},_}function ur(t){return fn(Gt,t)}function lr(t){return fn(xe,t)}const fr=Math.PI/180,dr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,hr=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=$n(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),a,c;return e===n&&n===r?a=c=i:(a=fe((.4360747*e+.3850649*n+.1430804*r)/dn),c=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(a-i),200*(i-c),t.opacity)}function mr(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,mr,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>hr?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 gr(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(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const c=i(a),m=i.ceil(a);return a-c(e(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,m)=>{const Y=[];if(a=i.ceil(a),m=m==null?1:Math.floor(m),!(a0))return Y;let C;do Y.push(C=new Date(+a)),e(a,m),t(a);while(Cet(c=>{if(c>=c)for(;t(c),!a(c);)c.setTime(c-1)},(c,m)=>{if(c>=c)if(m<0)for(;++m<=0;)for(;e(c,-1),!a(c););else for(;--m>=0;)for(;e(c,1),!a(c););}),n&&(i.count=(a,c)=>(ge.setTime(+a),ye.setTime(+c),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const Et=et(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?et(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,Re=yt*30,ke=yt*365,vt=et(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Ot=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Ot.range;const vr=et(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());vr.range;const Ht=et(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());Ht.range;const Tr=et(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());Tr.range;const xt=et(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=et(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 xr=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));xr.range;function Dt(t){return et(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 Rt=Dt(0),Nt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);Rt.range;Nt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return et(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),br=Mt(2),wr=Mt(3),It=Mt(4),Dr=Mt(5),Mr=Mt(6);wn.range;re.range;br.range;wr.range;It.range;Dr.range;Mr.range;const Pt=et(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());Pt.range;const Cr=et(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());Cr.range;const kt=et(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:et(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=et(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:et(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 Sr(t,e,n,r,i,a){const c=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[a,1,ct],[a,5,5*ct],[a,15,15*ct],[a,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,Re],[e,3,3*Re],[t,1,ke]];function m(C,p,L){const _=pU).right(c,_);if(S===c.length)return t.every(Ne(C/ke,p/ke,L));if(S===0)return Et.every(Math.max(Ne(C,p,L),1));const[B,A]=c[_/c[S-1][2]53)return null;"w"in l||(l.w=1),"Z"in l?($=ve(At(l.y,0,1)),Q=$.getUTCDay(),$=Q>4||Q===0?re.ceil($):re($),$=_e.offset($,(l.V-1)*7),l.y=$.getUTCFullYear(),l.m=$.getUTCMonth(),l.d=$.getUTCDate()+(l.w+6)%7):($=pe(At(l.y,0,1)),Q=$.getDay(),$=Q>4||Q===0?Nt.ceil($):Nt($),$=xt.offset($,(l.V-1)*7),l.y=$.getFullYear(),l.m=$.getMonth(),l.d=$.getDate()+(l.w+6)%7)}else("W"in l||"U"in l)&&("w"in l||(l.w="u"in l?l.u%7:"W"in l?1:0),Q="Z"in l?ve(At(l.y,0,1)).getUTCDay():pe(At(l.y,0,1)).getDay(),l.m=0,l.d="W"in l?(l.w+6)%7+l.W*7-(Q+5)%7:l.w+l.U*7-(Q+6)%7);return"Z"in l?(l.H+=l.Z/100|0,l.M+=l.Z%100,ve(l)):pe(l)}}function y(M,H,R,l){for(var J=0,$=H.length,Q=R.length,G,it;J<$;){if(l>=Q)return-1;if(G=H.charCodeAt(J++),G===37){if(G=H.charAt(J++),it=j[G in Ve?H.charAt(J++):G],!it||(l=it(M,R,l))<0)return-1}else if(G!=R.charCodeAt(l++))return-1}return l}function h(M,H,R){var l=C.exec(H.slice(R));return l?(M.p=p.get(l[0].toLowerCase()),R+l[0].length):-1}function D(M,H,R){var l=S.exec(H.slice(R));return l?(M.w=B.get(l[0].toLowerCase()),R+l[0].length):-1}function w(M,H,R){var l=L.exec(H.slice(R));return l?(M.w=_.get(l[0].toLowerCase()),R+l[0].length):-1}function T(M,H,R){var l=I.exec(H.slice(R));return l?(M.m=N.get(l[0].toLowerCase()),R+l[0].length):-1}function v(M,H,R){var l=A.exec(H.slice(R));return l?(M.m=U.get(l[0].toLowerCase()),R+l[0].length):-1}function u(M,H,R){return y(M,e,H,R)}function f(M,H,R){return y(M,n,H,R)}function x(M,H,R){return y(M,r,H,R)}function b(M){return c[M.getDay()]}function F(M){return a[M.getDay()]}function o(M){return Y[M.getMonth()]}function X(M){return m[M.getMonth()]}function s(M){return i[+(M.getHours()>=12)]}function E(M){return 1+~~(M.getMonth()/3)}function z(M){return c[M.getUTCDay()]}function V(M){return a[M.getUTCDay()]}function P(M){return Y[M.getUTCMonth()]}function K(M){return m[M.getUTCMonth()]}function O(M){return i[+(M.getUTCHours()>=12)]}function st(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var H=k(M+="",W);return H.toString=function(){return M},H},parse:function(M){var H=g(M+="",!1);return H.toString=function(){return M},H},utcFormat:function(M){var H=k(M+="",q);return H.toString=function(){return M},H},utcParse:function(M){var H=g(M+="",!0);return H.toString=function(){return M},H}}}var Ve={"-":"",_:" ",0:"0"},nt=/^\s*\d+/,Ur=/^%/,Er=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Lr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hr(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 Nr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Pr(t,e,n){var r=nt.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=nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=nt.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=nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zr(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function jr(t,e){return Z(t.getHours(),e,2)}function Qr(t,e){return Z(t.getHours()%12||12,e,2)}function Jr(t,e){return Z(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function Kr(t,e){return Dn(t,e)+"000"}function ti(t,e){return Z(t.getMonth()+1,e,2)}function ei(t,e){return Z(t.getMinutes(),e,2)}function ni(t,e){return Z(t.getSeconds(),e,2)}function ri(t){var e=t.getDay();return e===0?7:e}function ii(t,e){return Z(Rt.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 si(t,e){return t=Mn(t),Z(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ai(t){return t.getDay()}function oi(t,e){return Z(Nt.count(kt(t)-1,t),e,2)}function ci(t,e){return Z(t.getFullYear()%100,e,2)}function ui(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function li(t,e){return Z(t.getFullYear()%1e4,e,4)}function fi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function di(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function hi(t,e){return Z(t.getUTCHours(),e,2)}function mi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function gi(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function yi(t,e){return Cn(t,e)+"000"}function ki(t,e){return Z(t.getUTCMonth()+1,e,2)}function pi(t,e){return Z(t.getUTCMinutes(),e,2)}function vi(t,e){return Z(t.getUTCSeconds(),e,2)}function Ti(t){var e=t.getUTCDay();return e===0?7:e}function xi(t,e){return Z(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 bi(t,e){return t=Sn(t),Z(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function wi(t){return t.getUTCDay()}function Di(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Mi(t,e){return Z(t.getUTCFullYear()%100,e,2)}function Ci(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Si(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function _i(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Yi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Fi({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 Fi(t){return St=Fr(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ui(t){return new Date(t)}function Ei(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,a,c,m,Y,C){var p=Qn(),L=p.invert,_=p.domain,S=C(".%L"),B=C(":%S"),A=C("%I:%M"),U=C("%I %p"),I=C("%a %d"),N=C("%b %d"),W=C("%B"),q=C("%Y");function j(k){return(Y(k)4&&(S+=7),_.add(S,n));return B.diff(A,"week")+1},m.isoWeekday=function(C){return this.$utils().u(C)?this.day()||7:this.day(this.day()%7?C:C-7)};var Y=m.startOf;m.startOf=function(C,p){var L=this.$utils(),_=!!L.u(p)||p;return L.p(C)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):Y.bind(this)(C,p)}}}))})(jt)),jt.exports}var Wi=Ai();const $i=oe(Wi);var Qt={exports:{}},Oi=Qt.exports,tn;function Hi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Oi,(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/,a=/\d\d/,c=/\d\d?/,m=/\d*[^-_:/,()\s\d]+/,Y={},C=function(U){return(U=+U)+(U>68?1900:2e3)},p=function(U){return function(I){this[U]=+I}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var N=I.match(/([+-]|\d\d)/g),W=60*N[1]+(+N[2]||0);return W===0?0:N[0]==="+"?-W:W})(U)}],_=function(U){var I=Y[U];return I&&(I.indexOf?I:I.s.concat(I.f))},S=function(U,I){var N,W=Y.meridiem;if(W){for(var q=1;q<=24;q+=1)if(U.indexOf(W(q,0,I))>-1){N=q>12;break}}else N=U===(I?"pm":"PM");return N},B={A:[m,function(U){this.afternoon=S(U,!1)}],a:[m,function(U){this.afternoon=S(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],s:[c,p("seconds")],ss:[c,p("seconds")],m:[c,p("minutes")],mm:[c,p("minutes")],H:[c,p("hours")],h:[c,p("hours")],HH:[c,p("hours")],hh:[c,p("hours")],D:[c,p("day")],DD:[a,p("day")],Do:[m,function(U){var I=Y.ordinal,N=U.match(/\d+/);if(this.day=N[0],I)for(var W=1;W<=31;W+=1)I(W).replace(/\[|\]/g,"")===U&&(this.day=W)}],w:[c,p("week")],ww:[a,p("week")],M:[c,p("month")],MM:[a,p("month")],MMM:[m,function(U){var I=_("months"),N=(_("monthsShort")||I.map((function(W){return W.slice(0,3)}))).indexOf(U)+1;if(N<1)throw new Error;this.month=N%12||N}],MMMM:[m,function(U){var I=_("months").indexOf(U)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,p("year")],YY:[a,function(U){this.year=C(U)}],YYYY:[/\d{4}/,p("year")],Z:L,ZZ:L};function A(U){var I,N;I=U,N=Y&&Y.formats;for(var W=(U=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,w,T){var v=T&&T.toUpperCase();return w||N[T]||n[T]||N[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(u,f,x){return f||x.slice(1)}))}))).match(r),q=W.length,j=0;j-1)return new Date((F==="X"?1e3:1)*b);var s=A(F)(b),E=s.year,z=s.month,V=s.day,P=s.hours,K=s.minutes,O=s.seconds,st=s.milliseconds,M=s.zone,H=s.week,R=new Date,l=V||(E||z?1:R.getDate()),J=E||R.getFullYear(),$=0;E&&!z||($=z>0?z-1:R.getMonth());var Q,G=P||0,it=K||0,at=O||0,pt=st||0;return M?new Date(Date.UTC(J,$,l,G,it,at,pt+60*M.offset*1e3)):o?new Date(Date.UTC(J,$,l,G,it,at,pt)):(Q=new Date(J,$,l,G,it,at,pt),H&&(Q=X(Q).week(H).toDate()),Q)}catch{return new Date("")}})(k,h,g,N),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),T&&k!=this.format(h)&&(this.$d=new Date("")),Y={}}else if(h instanceof Array)for(var u=h.length,f=1;f<=u;f+=1){y[1]=h[f-1];var x=N.apply(this,y);if(x.isValid()){this.$d=x.$d,this.$L=x.$L,this.init();break}f===u&&(this.$d=new Date(""))}else q.call(this,j)}}}))})(Qt)),Qt.exports}var Ni=Hi();const Pi=oe(Ni);var Jt={exports:{}},Ri=Jt.exports,en;function Vi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,a=i.format;i.format=function(c){var m=this,Y=this.$locale();if(!this.isValid())return a.bind(this)(c);var C=this.$utils(),p=(c||"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(L){switch(L){case"Q":return Math.ceil((m.$M+1)/3);case"Do":return Y.ordinal(m.$D);case"gggg":return m.weekYear();case"GGGG":return m.isoWeekYear();case"wo":return Y.ordinal(m.week(),"W");case"w":case"ww":return C.s(m.week(),L==="w"?1:2,"0");case"W":case"WW":return C.s(m.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return C.s(String(m.$H===0?24:m.$H),L==="k"?1:2,"0");case"X":return Math.floor(m.$d.getTime()/1e3);case"x":return m.$d.getTime();case"z":return"["+m.offsetName()+"]";case"zzz":return"["+m.offsetName("long")+"]";default:return L}}));return a.bind(this)(p)}}}))})(Jt)),Jt.exports}var zi=Vi();const qi=oe(zi);var Kt={exports:{}},Bi=Kt.exports,nn;function Zi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Bi,(function(){var n,r,i=1e3,a=6e4,c=36e5,m=864e5,Y=31536e6,C=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,L=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:Y,months:C,days:m,hours:c,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},S=function(k){return k instanceof q},B=function(k,g,y){return new q(k,y,g.$l)},A=function(k){return r.p(k)+"s"},U=function(k){return k<0},I=function(k){return U(k)?Math.ceil(k):Math.floor(k)},N=function(k){return Math.abs(k)},W=function(k,g){return k?U(k)?{negative:!0,format:""+N(k)+g}:{negative:!1,format:""+k+g}:{negative:!1,format:""}},q=(function(){function k(y,h,D){var w=this;if(this.$d={},this.$l=D,y===void 0&&(this.$ms=0,this.parseFromMilliseconds()),h)return B(y*_[A(h)],this);if(typeof y=="number")return this.$ms=y,this.parseFromMilliseconds(),this;if(typeof y=="object")return Object.keys(y).forEach((function(u){w.$d[A(u)]=y[u]})),this.calMilliseconds(),this;if(typeof y=="string"){var T=y.match(p);if(T){var v=T.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=v[0],this.$d.months=v[1],this.$d.weeks=v[2],this.$d.days=v[3],this.$d.hours=v[4],this.$d.minutes=v[5],this.$d.seconds=v[6],this.calMilliseconds(),this}}return this}var g=k.prototype;return g.calMilliseconds=function(){var y=this;this.$ms=Object.keys(this.$d).reduce((function(h,D){return h+(y.$d[D]||0)*_[D]}),0)},g.parseFromMilliseconds=function(){var y=this.$ms;this.$d.years=I(y/Y),y%=Y,this.$d.months=I(y/C),y%=C,this.$d.days=I(y/m),y%=m,this.$d.hours=I(y/c),y%=c,this.$d.minutes=I(y/a),y%=a,this.$d.seconds=I(y/i),y%=i,this.$d.milliseconds=y},g.toISOString=function(){var y=W(this.$d.years,"Y"),h=W(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var w=W(D,"D"),T=W(this.$d.hours,"H"),v=W(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var f=W(u,"S"),x=y.negative||h.negative||w.negative||T.negative||v.negative||f.negative,b=T.format||v.format||f.format?"T":"",F=(x?"-":"")+"P"+y.format+h.format+w.format+b+T.format+v.format+f.format;return F==="P"||F==="-P"?"P0D":F},g.toJSON=function(){return this.toISOString()},g.format=function(y){var h=y||"YYYY-MM-DDTHH:mm:ss",D={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 h.replace(L,(function(w,T){return T||String(D[w])}))},g.as=function(y){return this.$ms/_[A(y)]},g.get=function(y){var h=this.$ms,D=A(y);return D==="milliseconds"?h%=1e3:h=D==="weeks"?I(h/_[D]):this.$d[D],h||0},g.add=function(y,h,D){var w;return w=h?y*_[A(h)]:S(y)?y.$ms:B(y,this).$ms,B(this.$ms+w*(D?-1:1),this)},g.subtract=function(y,h){return this.add(y,h,!0)},g.locale=function(y){var h=this.clone();return h.$l=y,h},g.clone=function(){return B(this.$ms,this)},g.humanize=function(y){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!y)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},k})(),j=function(k,g,y){return k.add(g.years()*y,"y").add(g.months()*y,"M").add(g.days()*y,"d").add(g.hours()*y,"h").add(g.minutes()*y,"m").add(g.seconds()*y,"s").add(g.milliseconds()*y,"ms")};return function(k,g,y){n=y,r=y().$utils(),y.duration=function(w,T){var v=y.locale();return B(w,{$l:v},T)},y.isDuration=S;var h=g.prototype.add,D=g.prototype.subtract;g.prototype.add=function(w,T){return S(w)?j(this,w,1):h.bind(this)(w,T)},g.prototype.subtract=function(w,T){return S(w)?j(this,w,-1):D.bind(this)(w,T)}}}))})(Kt)),Kt.exports}var Xi=Zi();const Gi=oe(Xi);var we=(function(){var t=d(function(v,u,f,x){for(f=f||{},x=v.length;x--;f[v[x]]=u);return f},"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],a=[1,29],c=[1,30],m=[1,31],Y=[1,32],C=[1,33],p=[1,34],L=[1,9],_=[1,10],S=[1,11],B=[1,12],A=[1,13],U=[1,14],I=[1,15],N=[1,16],W=[1,19],q=[1,20],j=[1,21],k=[1,22],g=[1,23],y=[1,25],h=[1,35],D={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(u,f,x,b,F,o,X){var s=o.length-1;switch(F){case 1:return o[s-1];case 2:this.$=[];break;case 3:o[s-1].push(o[s]),this.$=o[s-1];break;case 4:case 5:this.$=o[s];break;case 6:case 7:this.$=[];break;case 8:b.setWeekday("monday");break;case 9:b.setWeekday("tuesday");break;case 10:b.setWeekday("wednesday");break;case 11:b.setWeekday("thursday");break;case 12:b.setWeekday("friday");break;case 13:b.setWeekday("saturday");break;case 14:b.setWeekday("sunday");break;case 15:b.setWeekend("friday");break;case 16:b.setWeekend("saturday");break;case 17:b.setDateFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 18:b.enableInclusiveEndDates(),this.$=o[s].substr(18);break;case 19:b.TopAxis(),this.$=o[s].substr(8);break;case 20:b.setAxisFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 21:b.setTickInterval(o[s].substr(13)),this.$=o[s].substr(13);break;case 22:b.setExcludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 23:b.setIncludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 24:b.setTodayMarker(o[s].substr(12)),this.$=o[s].substr(12);break;case 27:b.setDiagramTitle(o[s].substr(6)),this.$=o[s].substr(6);break;case 28:this.$=o[s].trim(),b.setAccTitle(this.$);break;case 29:case 30:this.$=o[s].trim(),b.setAccDescription(this.$);break;case 31:b.addSection(o[s].substr(8)),this.$=o[s].substr(8);break;case 33:b.addTask(o[s-1],o[s]),this.$="task";break;case 34:this.$=o[s-1],b.setClickEvent(o[s-1],o[s],null);break;case 35:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],o[s]);break;case 36:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],null),b.setLink(o[s-2],o[s]);break;case 37:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-2],o[s-1]),b.setLink(o[s-3],o[s]);break;case 38:this.$=o[s-2],b.setClickEvent(o[s-2],o[s],null),b.setLink(o[s-2],o[s-1]);break;case 39:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-1],o[s]),b.setLink(o[s-3],o[s-2]);break;case 40:this.$=o[s-1],b.setLink(o[s-1],o[s]);break;case 41:case 47:this.$=o[s-1]+" "+o[s];break;case 42:case 43:case 45:this.$=o[s-2]+" "+o[s-1]+" "+o[s];break;case 44:case 46:this.$=o[s-3]+" "+o[s-2]+" "+o[s-1]+" "+o[s];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:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},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(u,f){if(f.recoverable)this.trace(u);else{var x=new Error(u);throw x.hash=f,x}},"parseError"),parse:d(function(u){var f=this,x=[0],b=[],F=[null],o=[],X=this.table,s="",E=0,z=0,V=2,P=1,K=o.slice.call(arguments,1),O=Object.create(this.lexer),st={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(st.yy[M]=this.yy[M]);O.setInput(u,st.yy),st.yy.lexer=O,st.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var H=O.yylloc;o.push(H);var R=O.options&&O.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function l(ot){x.length=x.length-2*ot,F.length=F.length-ot,o.length=o.length-ot}d(l,"popStack");function J(){var ot;return ot=b.pop()||O.lex()||P,typeof ot!="number"&&(ot instanceof Array&&(b=ot,ot=b.pop()),ot=f.symbols_[ot]||ot),ot}d(J,"lex");for(var $,Q,G,it,at={},pt,ut,He,Bt;;){if(Q=x[x.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:(($===null||typeof $>"u")&&($=J()),G=X[Q]&&X[Q][$]),typeof G>"u"||!G.length||!G[0]){var ce="";Bt=[];for(pt in X[Q])this.terminals_[pt]&&pt>V&&Bt.push("'"+this.terminals_[pt]+"'");O.showPosition?ce="Parse error on line "+(E+1)+`: +`+O.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":ce="Parse error on line "+(E+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(ce,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:H,expected:Bt})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+$);switch(G[0]){case 1:x.push($),F.push(O.yytext),o.push(O.yylloc),x.push(G[1]),$=null,z=O.yyleng,s=O.yytext,E=O.yylineno,H=O.yylloc;break;case 2:if(ut=this.productions_[G[1]][1],at.$=F[F.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},R&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),it=this.performAction.apply(at,[s,z,E,st.yy,G[1],F,o].concat(K)),typeof it<"u")return it;ut&&(x=x.slice(0,-1*ut*2),F=F.slice(0,-1*ut),o=o.slice(0,-1*ut)),x.push(this.productions_[G[1]][0]),F.push(at.$),o.push(at._$),He=X[x[x.length-2]][x[x.length-1]],x.push(He);break;case 3:return!0}}return!0},"parse")},w=(function(){var v={EOF:1,parseError:d(function(f,x){if(this.yy.parser)this.yy.parser.parseError(f,x);else throw new Error(f)},"parseError"),setInput:d(function(u,f){return this.yy=f||this.yy||{},this._input=u,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 u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var f=u.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:d(function(u){var f=u.length,x=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var b=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),x.length-1&&(this.yylineno-=x.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:x?(x.length===b.length?this.yylloc.first_column:0)+b[b.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-f]),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(u){this.unput(this.match.slice(u))},"less"),pastInput:d(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var u=this.pastInput(),f=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+f+"^"},"showPosition"),test_match:d(function(u,f){var x,b,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),b=u[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,f,x,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;of[0].length)){if(f=x,b=o,this.options.backtrack_lexer){if(u=this.test_match(x,F[o]),u!==!1)return u;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(u=this.test_match(f,F[b]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var f=this.next();return f||this.lex()},"lex"),begin:d(function(f){this.conditionStack.push(f)},"begin"),popState:d(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:d(function(f){this.begin(f)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(f,x,b,F){switch(b){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return v})();D.lexer=w;function T(){this.yy={}}return d(T,"Parser"),T.prototype=D,D.Parser=T,new T})();we.parser=we;var ji=we;rt.extend($i);rt.extend(Pi);rt.extend(qi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Vt=[],zt=[],Ee=new Map,Ie=[],se=[],Lt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Qi=d(function(){Ie=[],se=[],Lt="",Ae=[],te=0,Ce=void 0,ee=void 0,tt=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Vt=[],zt=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Xn(),$e="sunday",ae="saturday"},"clear"),Ji=d(function(t){_t=t},"setDiagramId"),Ki=d(function(t){Ye=t},"setAxisFormat"),ts=d(function(){return Ye},"getAxisFormat"),es=d(function(t){Fe=t},"setTickInterval"),ns=d(function(){return Fe},"getTickInterval"),rs=d(function(t){Ue=t},"setTodayMarker"),is=d(function(){return Ue},"getTodayMarker"),ss=d(function(t){lt=t},"setDateFormat"),as=d(function(){qt=!0},"enableInclusiveEndDates"),os=d(function(){return qt},"endDatesAreInclusive"),cs=d(function(){We=!0},"enableTopAxis"),us=d(function(){return We},"topAxisEnabled"),ls=d(function(t){Le=t},"setDisplayMode"),fs=d(function(){return Le},"getDisplayMode"),ds=d(function(){return lt},"getDateFormat"),hs=d(function(t){Vt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),ms=d(function(){return Vt},"getIncludes"),gs=d(function(t){zt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),ys=d(function(){return zt},"getExcludes"),ks=d(function(){return Ee},"getLinks"),ps=d(function(t){Lt=t,Ie.push(t)},"addSection"),vs=d(function(){return Ie},"getSections"),Ts=d(function(){let t=sn();const e=10;let n=0;for(;!t&&nm))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,c]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(m=>{const Y=m.trim();return Y==="x"||Y==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const a=/^after\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let m=null;for(const C of a.groups.ids.split(" ")){let p=Ct(C);p!==void 0&&(!m||p.endTime>m.endTime)&&(m=p)}if(m)return m.endTime;const Y=new Date;return Y.setHours(0,0,0,0),Y}let c=rt(n,e.trim(),!0);if(c.isValid())return c.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const m=new Date(n);if(m===void 0||isNaN(m.getTime())||m.getFullYear()<-1e4||m.getFullYear()>1e4)throw new Error("Invalid date:"+n);return m}},"getStartDate"),En=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),In=d(function(t,e,n,r=!1){n=n.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let p=null;for(const _ of a.groups.ids.split(" ")){let S=Ct(_);S!==void 0&&(!p||S.startTime{window.open(n,"_self")}),Ee.set(r,n))}),An(t,"clickable")},"setLink"),An=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Fs=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Gn.runFunc(e,...r)})},"setClickFun"),Wn=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Us=d(function(t,e,n){t.split(",").forEach(function(r){Fs(r,e,n)}),An(t,"clickable")},"setClickEvent"),Es=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Is={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Qi,setDateFormat:ss,getDateFormat:ds,enableInclusiveEndDates:as,endDatesAreInclusive:os,enableTopAxis:cs,topAxisEnabled:us,setAxisFormat:Ki,getAxisFormat:ts,setTickInterval:es,getTickInterval:ns,setTodayMarker:rs,getTodayMarker:is,setAccTitle:zn,getAccTitle:Vn,setDiagramTitle:Rn,getDiagramTitle:Pn,setDiagramId:Ji,setDisplayMode:ls,getDisplayMode:fs,setAccDescription:Nn,getAccDescription:Hn,addSection:ps,getSections:vs,getTasks:Ts,addTask:Ss,findTaskById:Ct,addTaskOrg:_s,setIncludes:hs,getIncludes:ms,setExcludes:gs,getExcludes:ys,setClickEvent:Us,setLink:Ys,getLinks:ks,bindFunctions:Es,parseDuration:En,isInvalidDate:Fn,setWeekday:xs,getWeekday:bs,setWeekend:ws};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const a="^\\s*"+i+"\\s*$",c=new RegExp(a);t[0].match(c)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");rt.extend(Gi);var Ls=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Nt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:Rt},As=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((a,c)=>a.startTime-c.startTime||a.order-c.order),i=0;for(const a of r)for(let c=0;c=n[c]){n[c]=a.endTime,a.order=c+e,c>i&&(i=c);break}return i},"getMaxIntersections"),dt,Te=1e4,Ws=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const a=Yt().securityLevel;let c;a==="sandbox"&&(c=Zt("#i"+e));const m=a==="sandbox"?Zt(c.nodes()[0].contentDocument.body):Zt("body"),Y=a==="sandbox"?c.nodes()[0].contentDocument:document,C=Y.getElementById(e);dt=C.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const p=r.db.getTasks();let L=[];for(const h of p)L.push(h.type);L=y(L);const _={};let S=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const h={};for(const w of p)h[w.section]===void 0?h[w.section]=[w]:h[w.section].push(w);let D=0;for(const w of Object.keys(h)){const T=As(h[w],D)+1;D+=T,S+=T*(i.barHeight+i.barGap),_[w]=T}}else{S+=p.length*(i.barHeight+i.barGap);for(const h of L)_[h]=p.filter(D=>D.type===h).length}C.setAttribute("viewBox","0 0 "+dt+" "+S);const B=m.select(`[id="${e}"]`),A=Ii().domain([nr(p,function(h){return h.startTime}),er(p,function(h){return h.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(h,D){const w=h.startTime,T=D.startTime;let v=0;return w>T?v=1:ws.vert===E.vert?0:s.vert?1:-1);const b=[...new Set(h.map(s=>s.order))].map(s=>h.find(E=>E.order===s));B.append("g").selectAll("rect").data(b).enter().append("rect").attr("x",0).attr("y",function(s,E){return E=s.order,E*D+w-2}).attr("width",function(){return f-i.rightPadding/2}).attr("height",D).attr("class",function(s){for(const[E,z]of L.entries())if(s.type===z)return"section section"+E%i.numberSectionStyles;return"section section0"}).enter();const F=B.append("g").selectAll("rect").data(h).enter(),o=r.db.getLinks();if(F.append("rect").attr("id",function(s){return e+"-"+s.id}).attr("rx",3).attr("ry",3).attr("x",function(s){return s.milestone?A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))-.5*v:A(s.startTime)+T}).attr("y",function(s,E){return E=s.order,s.vert?i.gridLineStartPadding:E*D+w}).attr("width",function(s){return s.milestone?v:s.vert?.08*v:A(s.renderEndTime||s.endTime)-A(s.startTime)}).attr("height",function(s){return s.vert?p.length*(i.barHeight+i.barGap)+i.barHeight*2:v}).attr("transform-origin",function(s,E){return E=s.order,(A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))).toString()+"px "+(E*D+w+.5*v).toString()+"px"}).attr("class",function(s){const E="task";let z="";s.classes.length>0&&(z=s.classes.join(" "));let V=0;for(const[K,O]of L.entries())s.type===O&&(V=K%i.numberSectionStyles);let P="";return s.active?s.crit?P+=" activeCrit":P=" active":s.done?s.crit?P=" doneCrit":P=" done":s.crit&&(P+=" crit"),P.length===0&&(P=" task"),s.milestone&&(P=" milestone "+P),s.vert&&(P=" vert "+P),P+=V,P+=" "+z,E+P}),F.append("text").attr("id",function(s){return e+"-"+s.id+"-text"}).text(function(s){return s.task}).attr("font-size",i.fontSize).attr("x",function(s){let E=A(s.startTime),z=A(s.renderEndTime||s.endTime);if(s.milestone&&(E+=.5*(A(s.endTime)-A(s.startTime))-.5*v,z=E+v),s.vert)return A(s.startTime)+T;const V=this.getBBox().width;return V>z-E?z+V+1.5*i.leftPadding>f?E+T-5:z+T+5:(z-E)/2+E+T}).attr("y",function(s,E){return s.vert?i.gridLineStartPadding+p.length*(i.barHeight+i.barGap)+60:(E=s.order,E*D+i.barHeight/2+(i.fontSize/2-2)+w)}).attr("text-height",v).attr("class",function(s){const E=A(s.startTime);let z=A(s.endTime);s.milestone&&(z=E+v);const V=this.getBBox().width;let P="";s.classes.length>0&&(P=s.classes.join(" "));let K=0;for(const[st,M]of L.entries())s.type===M&&(K=st%i.numberSectionStyles);let O="";return s.active&&(s.crit?O="activeCritText"+K:O="activeText"+K),s.done?s.crit?O=O+" doneCritText"+K:O=O+" doneText"+K:s.crit&&(O=O+" critText"+K),s.milestone&&(O+=" milestoneText"),s.vert&&(O+=" vertText"),V>z-E?z+V+1.5*i.leftPadding>f?P+" taskTextOutsideLeft taskTextOutside"+K+" "+O:P+" taskTextOutsideRight taskTextOutside"+K+" "+O+" width-"+V:P+" taskText taskText"+K+" "+O+" width-"+V}),Yt().securityLevel==="sandbox"){let s;s=Zt("#i"+e);const E=s.nodes()[0].contentDocument;F.filter(function(z){return o.has(z.id)}).each(function(z){var V=E.querySelector("#"+CSS.escape(e+"-"+z.id)),P=E.querySelector("#"+CSS.escape(e+"-"+z.id+"-text"));const K=V.parentNode;var O=E.createElement("a");O.setAttribute("xlink:href",o.get(z.id)),O.setAttribute("target","_top"),K.appendChild(O),O.appendChild(V),O.appendChild(P)})}}d(N,"drawRects");function W(h,D,w,T,v,u,f,x){if(f.length===0&&x.length===0)return;let b,F;for(const{startTime:V,endTime:P}of u)(b===void 0||VF)&&(F=P);if(!b||!F)return;if(rt(F).diff(rt(b),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const o=r.db.getDateFormat(),X=[];let s=null,E=rt(b);for(;E.valueOf()<=F;)r.db.isInvalidDate(E,o,f,x)?s?s.end=E:s={start:E,end:E}:s&&(X.push(s),s=null),E=E.add(1,"d");B.append("g").selectAll("rect").data(X).enter().append("rect").attr("id",V=>e+"-exclude-"+V.start.format("YYYY-MM-DD")).attr("x",V=>A(V.start.startOf("day"))+w).attr("y",i.gridLineStartPadding).attr("width",V=>A(V.end.endOf("day"))-A(V.start.startOf("day"))).attr("height",v-D-i.gridLineStartPadding).attr("transform-origin",function(V,P){return(A(V.start)+w+.5*(A(V.end)-A(V.start))).toString()+"px "+(P*h+.5*v).toString()+"px"}).attr("class","exclude-range")}d(W,"drawExcludeDays");function q(h,D,w,T){if(w<=0||h>D)return 1/0;const v=D-h,u=rt.duration({[T??"day"]:w}).asMilliseconds();return u<=0?1/0:Math.ceil(v/u)}d(q,"getEstimatedTickCount");function j(h,D,w,T){const v=r.db.getDateFormat(),u=r.db.getAxisFormat();let f;u?f=u:v==="D"?f="%d":f=i.axisFormat??"%Y-%m-%d";let x=lr(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(F!==null){const o=parseInt(F[1],10);if(isNaN(o)||o<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const X=F[2],s=r.db.getWeekday()||i.weekday,E=A.domain(),z=E[0],V=E[1],P=q(z,V,o,X);if(P>Te)Tt.warn(`The tick interval "${o}${X}" would generate ${P} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(X){case"millisecond":x.ticks(Et.every(o));break;case"second":x.ticks(vt.every(o));break;case"minute":x.ticks(Ot.every(o));break;case"hour":x.ticks(Ht.every(o));break;case"day":x.ticks(xt.every(o));break;case"week":x.ticks(an[s].every(o));break;case"month":x.ticks(Pt.every(o));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+h+", "+(T-50)+")").call(x).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let o=ur(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));if(F!==null){const X=parseInt(F[1],10);if(isNaN(X)||X<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const s=F[2],E=r.db.getWeekday()||i.weekday,z=A.domain(),V=z[0],P=z[1];if(q(V,P,X,s)<=Te)switch(s){case"millisecond":o.ticks(Et.every(X));break;case"second":o.ticks(vt.every(X));break;case"minute":o.ticks(Ot.every(X));break;case"hour":o.ticks(Ht.every(X));break;case"day":o.ticks(xt.every(X));break;case"week":o.ticks(an[E].every(X));break;case"month":o.ticks(Pt.every(X));break}}}B.append("g").attr("class","grid").attr("transform","translate("+h+", "+D+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(j,"makeGrid");function k(h,D){let w=0;const T=Object.keys(_).map(v=>[v,_[v]]);B.append("g").selectAll("text").data(T).enter().append(function(v){const u=v[0].split(Bn.lineBreakRegex),f=-(u.length-1)/2,x=Y.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("dy",f+"em");for(const[b,F]of u.entries()){const o=Y.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttribute("alignment-baseline","central"),o.setAttribute("x","10"),b>0&&o.setAttribute("dy","1em"),o.textContent=F,x.appendChild(o)}return x}).attr("x",10).attr("y",function(v,u){if(u>0)for(let f=0;f` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Hs=Os,qs={parser:ji,db:Is,renderer:$s,styles:Hs};export{qs as diagram}; diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js new file mode 100644 index 0000000000..f493694e6c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js @@ -0,0 +1,106 @@ +import{p as le}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{I as he}from"./chunk-QZHKN3VN-_Rz9_NuS.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,D as J,l as w,d as me,c as W,u as pe,E as be,z as we,k as B,F as ke,G as ve,H as Ce}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as Ee}from"./wardley-L42UT6IY-BJFn8eDD.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 he(()=>{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)=>{le(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} + ${t.posWithOffset+i/2+L},${x-c-R} + ${t.posWithOffset+i/2+L},${x+c+R} + ${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` + ${t.x},${u+2} + ${t.x},${u-2} + ${t.x+O},${u-c-2} + ${t.x+O+i+4},${u-c-2} + ${t.x+O+i+4},${u+c+2} + ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-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",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` + .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } + .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } + .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } + .label${r} { fill: ${e["git"+t]}; } + .arrow${r} { stroke: ${e["git"+t]}; } + `}).join(` +`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${s?kr(e):vr(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${s?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + stroke-width: ${s?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${de.has(t)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles"),Er=Cr,Rr={parser:Ve,db:se,renderer:yr,styles:Er};export{Rr as diagram}; diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-XdaI0ZOj.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-XdaI0ZOj.js new file mode 100644 index 0000000000..2780522a4d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-PVQCEYII-XdaI0ZOj.js @@ -0,0 +1,106 @@ +import{p as le}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{I as he}from"./chunk-QZHKN3VN-Dyzf1Pwd.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,D as J,l as w,d as me,c as W,u as pe,E as be,z as we,k as B,F as ke,G as ve,H as Ce}from"./mermaid.core-zKrc8Ye9.js";import{p as Ee}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.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 he(()=>{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)=>{le(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} + ${t.posWithOffset+i/2+L},${x-c-R} + ${t.posWithOffset+i/2+L},${x+c+R} + ${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` + ${t.x},${u+2} + ${t.x},${u-2} + ${t.x+O},${u-c-2} + ${t.x+O+i+4},${u-c-2} + ${t.x+O+i+4},${u+c+2} + ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-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",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` + .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } + .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } + .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } + .label${r} { fill: ${e["git"+t]}; } + .arrow${r} { stroke: ${e["git"+t]}; } + `}).join(` +`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${s?kr(e):vr(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${s?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + stroke-width: ${s?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${de.has(t)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles"),Er=Cr,Ir={parser:Ve,db:se,renderer:yr,styles:Er};export{Ir as diagram}; diff --git a/apps/kimi-code/dist-web/assets/graph--OzhPTMs.js b/apps/kimi-code/dist-web/assets/graph--OzhPTMs.js new file mode 100644 index 0000000000..6056a11691 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/graph--OzhPTMs.js @@ -0,0 +1 @@ +var Ze=typeof global=="object"&&global&&global.Object===Object&&global,pt=typeof self=="object"&&self&&self.Object===Object&&self,w=Ze||pt||Function("return this")(),y=w.Symbol,We=Object.prototype,_t=We.hasOwnProperty,bt=We.toString,D=y?y.toStringTag:void 0;function yt(e){var t=_t.call(e,D),r=e[D];try{e[D]=void 0;var n=!0}catch{}var i=bt.call(e);return n&&(t?e[D]=r:delete e[D]),i}var vt=Object.prototype,Ot=vt.toString;function mt(e){return Ot.call(e)}var wt="[object Null]",Tt="[object Undefined]",Oe=y?y.toStringTag:void 0;function M(e){return e==null?e===void 0?Tt:wt:Oe&&Oe in Object(e)?yt(e):mt(e)}function j(e){return e!=null&&typeof e=="object"}var At="[object Symbol]";function he(e){return typeof e=="symbol"||j(e)&&M(e)==At}function Je(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n1?i.setNode(s,r):i.setNode(s)}),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]=C,this._children[t]={},this._children[C][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=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],S(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),S(b(this._in[t]),r),delete this._in[t],delete this._preds[t],S(b(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(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===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!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(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 n=this;S(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),S(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&S(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,m as A,Wt as B,g as C,Le as D,de as E,zi as F,gt as G,V as H,Z as I,Fi as J,dt as K,Jt as L,ye as M,Je as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,$n as Y,S as Z,F as _,he as a,se as a0,Ji as a1,ce as b,Q as c,Ae as d,ke as e,Ve as f,ir as g,et as h,R as i,Br as j,jn as k,Kr as l,j as m,M as n,nr as o,b as p,zn as q,w as r,Zt as s,Fn as t,ot as u,Hn as v,O as w,Gr as x,Ce as y,W as z}; diff --git a/apps/kimi-code/dist-web/assets/graph-BwjfAU3j.js b/apps/kimi-code/dist-web/assets/graph-BwjfAU3j.js new file mode 100644 index 0000000000..0d76f7cff7 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/graph-BwjfAU3j.js @@ -0,0 +1 @@ +var Ze=typeof global=="object"&&global&&global.Object===Object&&global,pt=typeof self=="object"&&self&&self.Object===Object&&self,w=Ze||pt||Function("return this")(),y=w.Symbol,We=Object.prototype,_t=We.hasOwnProperty,bt=We.toString,D=y?y.toStringTag:void 0;function yt(e){var t=_t.call(e,D),r=e[D];try{e[D]=void 0;var n=!0}catch{}var i=bt.call(e);return n&&(t?e[D]=r:delete e[D]),i}var vt=Object.prototype,Ot=vt.toString;function mt(e){return Ot.call(e)}var wt="[object Null]",Tt="[object Undefined]",Oe=y?y.toStringTag:void 0;function M(e){return e==null?e===void 0?Tt:wt:Oe&&Oe in Object(e)?yt(e):mt(e)}function j(e){return e!=null&&typeof e=="object"}var At="[object Symbol]";function he(e){return typeof e=="symbol"||j(e)&&M(e)==At}function Je(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n1?i.setNode(s,r):i.setNode(s)}),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]=C,this._children[t]={},this._children[C][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=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],$(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),$(b(this._in[t]),r),delete this._in[t],delete this._preds[t],$(b(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(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===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!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(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 n=this;$(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),$(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&$(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,m as A,Wt as B,g as C,Le as D,de as E,zi as F,gt as G,V as H,Z as I,Fi as J,dt as K,Jt as L,ye as M,Je as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,Sn as Y,$ as Z,F as _,he as a,se as a0,Ji as a1,ce as b,Q as c,Ae as d,ke as e,Ve as f,ir as g,et as h,R as i,Br as j,jn as k,Kr as l,j as m,M as n,nr as o,b as p,zn as q,w as r,Zt as s,Fn as t,ot as u,Hn as v,O as w,Gr as x,Ce as y,W as z}; diff --git a/apps/kimi-code/dist-web/assets/index-BsKKzRv6.js b/apps/kimi-code/dist-web/assets/index-BsKKzRv6.js new file mode 100644 index 0000000000..2450fd4952 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-BsKKzRv6.js @@ -0,0 +1,9 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-COMYI0Oj.js","assets/index-DtRfJ0vw.js","assets/index-ByWw02oy.css"])))=>i.map(i=>d[i]); +import{bR as _t}from"./index-DtRfJ0vw.js";const et=new WeakMap;function W(e){return et.get(e)??0}function hn(e){const t=W(e)+1;return et.set(e,t),t}function dn(e){et.delete(e)}const gn=30,je=new WeakMap;function Ft(e){je.delete(e)}function Pt(e){let t=je.get(e);return t||(t=new Map,je.set(e,t)),t}function qt(e){return typeof e?.htmlCacheMaxEntries=="number"?Math.max(0,Math.floor(e.htmlCacheMaxEntries)):gn}function mn(e,t,n){const r=n?.htmlCache!==!1,s=qt(n);if(!r||s<=0)return;const i=Pt(e),o=i.get(t);return o&&(i.delete(t),i.set(t,o)),o}function pn(e,t,n,r){const s=r?.htmlCache!==!1,i=qt(r);if(!s||i<=0)return;const o=Pt(e);if(o.set(t,n),o.size>i){const c=o.keys().next().value;c!==void 0&&o.delete(c)}}const Cn=50,Be=new WeakMap;function yn(e){let t=Be.get(e);return t||(t=new Map,Be.set(e,t)),t}function $t(e){Be.delete(e)}function zt(e,t,n,r,s){const i=s?.tokenCache!==!1,o=typeof s?.tokenCacheMaxEntries=="number"?Math.max(0,Math.floor(s.tokenCacheMaxEntries)):Cn,c=e,a=()=>{if(typeof c.codeToThemedTokens=="function")return c.codeToThemedTokens(t,n,r);if(typeof c.codeToTokens=="function")return c.codeToTokens(t,{lang:n,theme:r}).tokens;throw new TypeError("Highlighter does not support token APIs: codeToThemedTokens/codeToTokens")};if(!i||o<=0)return a();const l=yn(e),g=JSON.stringify(["stream-markdown-token-v2",W(e),n,r,t]),d=l.get(g);if(d)return l.delete(g),l.set(g,d),d;const h=a();if(l.set(g,h),l.size>o){const N=l.keys().next().value;N!==void 0&&l.delete(N)}return h}const Le=["jsx","tsx","vue","csharp","python","java","c","cpp","rust","go","powershell","sql","json","html","javascript","typescript","css","markdown","xml","yaml","toml","dockerfile","kotlin","objective-c","objective-cpp","php","ruby","scala","svelte","swift","erlang","angular-html","angular-ts","dart","lua","mermaid","cmake","nginx"],dt=["vitesse-dark","vitesse-light"];let U=null,oe=null;const K=new Set;let q=[];const J=new Set,Me=new Set,Dt=new WeakMap,xe=new Map;let Ue=Promise.resolve(),z=0;const bn=["loadLanguage","loadTheme"],We=new WeakMap;function fe(e){hn(e),$t(e),Ft(e)}function jt(e,t){const n=We.get(e)?.[t];if(n)return n;const r=e[t];return typeof r=="function"?r:void 0}function gt(e,t){return!!jt(e,t)}async function mt(e,t,...n){const r=jt(e,t);r&&await r.apply(e,n)}function kn(e,t,n){if(U===e){if(t==="loadLanguage"){for(const r of n)typeof r=="string"&&J.add(r);return}for(const r of n)tt(r)}}function pt(e,t,n){kn(e,t,n),fe(e)}function Tn(e){if(We.has(e))return;const t={},n=e;for(const r of bn){const s=n[r];typeof s=="function"&&(t[r]=s,n[r]=(...i)=>{let o;try{o=s.apply(e,i)}catch(c){throw fe(e),c}return o&&typeof o.then=="function"?o.then(c=>(pt(e,r,i),c),c=>{throw fe(e),c}):(pt(e,r,i),o)})}We.set(e,t)}function le(e,t){return z===t&&U===e}function Bt(e){try{const t=e.dispose?.();t&&typeof t.catch=="function"&&t.catch(()=>{})}catch{}}function Ce(e){if(typeof e=="string")return e;try{const t=e?.name;return typeof t=="string"?t:void 0}catch{return}}function ee(e){return!!e&&typeof e=="object"}function Y(e,t){return t===void 0?{__streamMarkdownType:e}:{__streamMarkdownType:e,value:t}}function Je(e,t=new WeakSet){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number")return Number.isFinite(e)?e:Y("number",String(e));if(typeof e>"u")return Y("undefined");if(typeof e=="bigint")return Y("bigint",e.toString());if(typeof e=="symbol")return Y("symbol",String(e));if(typeof e=="function")return Y("function",e.name||"");if(typeof e!="object")return Y(typeof e);if(t.has(e))return Y("circular");t.add(e);try{if(Array.isArray(e))return e.map(s=>Je(s,t));const n=e,r={};for(const s of Object.keys(n).sort())r[s]=Je(n[s],t);return r}finally{t.delete(e)}}function Ut(e){if(ee(e))try{return JSON.stringify(Je(e))}catch{return}}function Sn(e){if(!ee(e))return;const t=Ce(e),n=t?xe.get(t):Dt.get(e);return n?.generation===z?n.fingerprint:void 0}function he(e){if(typeof e=="string")return Me.has(e);const t=Ut(e);return t!==void 0&&Sn(e)===t}function tt(e){if(typeof e=="string"){Me.add(e),xe.delete(e);return}if(!ee(e))return;const t=Ce(e),n=Ut(e);if(n!==void 0){const r={generation:z,fingerprint:n};t?xe.set(t,r):Dt.set(e,r)}t&&Me.delete(t)}function wn(e,t){for(const n of e)J.add(n);for(const n of t)tt(n)}function Ln(e){const t=new Set,n=new Set;for(const r of e){if(typeof r=="string"){t.add(r);continue}ee(r)&&n.add(r)}q=q.filter(r=>typeof r=="string"?!t.has(r):!(ee(r)&&n.has(r)))}function Mn(e){for(const t of e)J.has(t)||K.add(t)}function Wt(e){return q.findIndex(t=>Ce(t)===e)}function Jt(e){return q.includes(e)}function xn(e){for(const t of e){const n=Ce(t);if(n){const r=Wt(n);if(r!==-1){he(t)?q.splice(r,1):q[r]=t;continue}}else if(ee(t)&&Jt(t))continue;he(t)||q.push(t)}}function Nn(e){for(const t of e){if(he(t))continue;const n=Ce(t);n&&Wt(n)!==-1||!n&&ee(t)&&Jt(t)||q.push(t)}}async function Rn(e,t){if(!le(e,t))return;const n=Array.from(K).filter(l=>!J.has(l)),r=q.filter(l=>!he(l));K.clear(),q=[];let s=!1,i=!1,o=!1,c=0,a=0;try{if(n.length>0&>(e,"loadLanguage"))for(;c0&>(e,"loadTheme"))for(;a{}).then(()=>{if(le(e,t))return Rn(e,t)});return Ue=n.catch(()=>{}),n}async function Z(e={}){const t=!e.langs||e.langs.length===0?Le:e.langs,n=!e.themes||e.themes.length===0?dt:e.themes;Mn(t),xn(n);const r=z;if(U){const i=U;return await $e(i,r),r!==z||U!==i?Z(e):i}if(!oe){const i=z,o=(async()=>{const{createHighlighter:c}=await _t(async()=>{const{createHighlighter:d}=await import("./index-COMYI0Oj.js");return{createHighlighter:d}},__vite__mapDeps([0,1,2])),a=q.length>0?q.slice():dt,l=K.size>0?Array.from(K):Le,g=await c({themes:a,langs:l});if(i!==z)return Bt(g),g;Tn(g),wn(l,a);for(const d of l)K.delete(d);return Ln(a),U=g,await $e(g,i),g})().finally(()=>{oe===o&&(oe=null)});oe=o}const s=await oe;return r!==z||(await $e(s,r),r!==z||U!==s)?Z(e):s}function Mr(){z++;const e=U;U=null,oe=null,e&&(dn(e),$t(e),Ft(e),Bt(e)),K.clear(),q=[],J.clear(),Me.clear(),xe.clear(),Ue=Promise.resolve()}const vn=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i,En=/^[a-z][a-z0-9-]*$/i,In=/^--[\w-]+$/,Kt=new Set(["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","light-dark","var","calc","min","max","clamp"]),Ct=/([a-z][\w-]*)\s*\(/gi;function On(e){if(e==null||!Number.isFinite(e)||e<=0)return"";const t=[];return e&1&&t.push("font-style: italic;"),e&2&&t.push("font-weight: 600;"),e&4&&t.push("text-decoration: underline; text-underline-offset: 0.15em;"),t.join(" ")}const ze=new Map,yt=new Map,bt=new Map,nt=[],Hn=3;let de=0,kt="",Tt=-1;const St=new WeakMap;function An(e){for(let t=0;t\\`.includes(e[t]))return!0}return!1}function _n(e){return!e||An(e)||/url\s*\(|\/\*|@/i.test(e)||!Fn(e)?!1:Pn(e)}function Fn(e){let t=0;for(let n=0;n>>0).toString(36)}-${(n>>>0).toString(36)}`}function jn(e){return Array.from({length:Hn},()=>`.${e}`).join("")}function Gt(e){if(!e)return"";const t=ze.get(e);if(t)return t;const n=`smd-token-${Dn(e)}`;let r=n,s=1;for(;;){const i=bt.get(r);if(!i)return ze.set(e,r),bt.set(r,e),nt.push(`${jn(r)}{${e}}`),de++,r;if(i===e)return ze.set(e,r),r;r=`${n}-${s++}`}}function Bn(e,t){const n=Ie(e,t);return n?` style="${zn(n)}"`:""}function Un(e,t){const n=Ie(e,t);if(!n)return"";const r=Gt(n);return r?` class="${r}"`:""}function ce(e,t,n="inline"){return n==="class"?Un(e,t):Bn(e,t)}function Wn(e,t,n,r="inline"){const s=Ie(t,n);if(s){if(r==="class"){const i=Gt(s);if(i){e.className=i;return}return}e.setAttribute("style",s)}}function ge(e){return e.nodeType===9}function wt(e){return e.nodeType===11&&"host"in e}function Vt(e){if(e===null)return null;if(e!==void 0){if(ge(e)||wt(e))return e;if(e.isConnected===!1)return null;const t=typeof e.getRootNode=="function"?e.getRootNode():null;return t&&(ge(t)||wt(t))?t:e.ownerDocument??null}return typeof document<"u"?document:null}function Lt(e){return Vt(e)!=null}function Yt(e,t,n="inline"){const r=e??n;return(r==="auto"||r==="class")&&Lt(t)?"class":"inline"}function Qt(e){return ge(e)?e:e.ownerDocument}function Jn(e,t){if(ge(e)){(e.head??e.documentElement).appendChild(t);return}e.appendChild(t)}function Kn(e,t){if(typeof t.getRootNode=="function")return t.getRootNode()===e;const n=e.contains;return typeof n=="function"?n.call(e,t):t.ownerDocument===e&&t.isConnected===!0}function Gn(e,t){return t.ownerDocument!==Qt(e)?!1:ge(e)?Kn(e,t):t.parentNode===e}function Vn(){return Tt!==de&&(kt=nt.join(` +`),Tt=de),kt}function Ke(e){if(nt.length===0)return;const t=Vt(e);if(!t)return;let n=St.get(t);if(!n||!Gn(t,n.element)){const s=Qt(t).createElement("style");s.dataset.streamMarkdownTokenStyles="",Jn(t,s),n={element:s,generation:-1},St.set(t,n)}const r=Vn();n.generation===de&&n.element.textContent===r||(n.element.textContent=r,n.generation=de)}function Yn(e){let t=1;for(let n=0;ni.slice()):e;return s.length>r&&(s=s.slice(0,r)),s.length[]))),s}function xt(e){return e.replace(/\r/g,"").replace(/&/g,"&").replace(//g,">")}function Te(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}function Qn(e){return typeof e!="number"||!Number.isFinite(e)?1:Math.trunc(e)}function Zn(e){return e.styleRoot!==void 0?e.styleRoot:typeof document<"u"?document:void 0}function Zt(e,t,n){const{lang:r,theme:s,preClass:i="shiki",codeClass:o="",lineClass:c="line",showLineNumbers:a=!1,startingLineNumber:l=1}=n,g=Qn(l),d=Zn(n),h=Yt(n.tokenStyleMode,d,"inline");let N;try{N=e.getTheme?.(s)?.bg}catch{}const S=rt(N),w=JSON.stringify(["stream-markdown-html-v3",W(e),h,S,r,s,i,o,c,a,g,t]),m=n.tokenLines==null;if(m){const y=mn(e,w,{htmlCache:n.htmlCache,htmlCacheMaxEntries:n.htmlCacheMaxEntries});if(y)return h==="class"&&Ke(d),y}const T=n.tokenLines?Mt(n.tokenLines,t,!0):Mt(zt(e,t,r,s,{tokenCache:n.tokenCache,tokenCacheMaxEntries:n.tokenCacheMaxEntries}),t);let C=g;const E=T.map(y=>{const x=h==="class"?(()=>{let H="",b=0;for(;b${xt(p)}`}return H})():y.map(H=>`${xt(H.content)}`).join(""),L=a?``:"";return`${L}${x}`}).join(` +`),O=S?` style="background-color: ${Te(S)};"`:"",I=`

${E}
`;return h==="class"&&Ke(d),m&&pn(e,w,I,{htmlCache:n.htmlCache,htmlCacheMaxEntries:n.htmlCacheMaxEntries}),I}const ye=new WeakMap,Ge=new WeakMap,Ve=new WeakMap,it=new WeakMap,Re=new WeakMap;function st(e){let t=1;for(let n=0;ni.slice()):e;return s.length>r&&(s=s.slice(0,r)),s.length[]))),s}function Ye(e){return e?.map(t=>t.map(n=>({...n})))}function Oe(e){return typeof e!="number"||!Number.isFinite(e)?1:Math.trunc(e)}function Rt(e){const t=st(e),n=Math.ceil(e.length/6);return Math.min(8e3,t+n)}function Xn(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?0:e}function vt(e,t=50){if(typeof e?.timeRemaining!="function")return t;const n=e.timeRemaining();return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:t}function te(e){return e.replace(/\r/g,"")}function Et(e){return te(e).replace(/&/g,"&").replace(//g,">")}function He(e){return JSON.stringify([e.lang,e.theme,e.backgroundColor,e.highlighterRevision,e.tokenStyleMode,e.preClass,e.codeClass,e.lineClass,e.showLineNumbers,e.startingLineNumber])}function Ae(e,t){try{const n=e.getTheme?.(t);return rt(n?.bg)}catch{return""}}function Qe(e){return e.getAttribute("class")??""}function er(e){return e?`background-color: ${e};`:""}function It(e,t){if(!t)return"";const n=e.createElement("pre");return n.setAttribute("style",t),n.style.cssText.trim()}function tr(e,t){const n=e.getAttribute("style")??"",r=er(t);return n===r?!0:It(e.ownerDocument,n)===It(e.ownerDocument,r)}function ot(e,t,n){const r=t.parentElement;return!!r&&r.tagName.toLowerCase()==="pre"&&r.parentElement===e&&e.childNodes.length===1&&e.firstChild===r&&r.childNodes.length===1&&r.firstChild===t&&Qe(r)===n.preClass&&Qe(t)===n.codeClass&&tr(r,n.backgroundColor)}function Xt(e){it.delete(e),ye.delete(e),Re.delete(e)}function en(e,t,n){it.set(e,t),ye.set(e,n);const r=e.querySelector("code");r?Re.set(e,r.innerHTML):Re.delete(e)}function we(e,t){Ge.set(e,t),Ve.set(e,e.innerHTML)}function nr(e){const t=Ge.get(e);if(t){if(Ve.get(e)!==e.innerHTML){Ge.delete(e),Ve.delete(e);return}return t}}function tn(e,t){return Re.get(e)===t.innerHTML}function _e(e,t){return e.styleRoot===void 0?t:e.styleRoot}function Fe(e,t){return Yt(e.tokenStyleMode,t,"class")}function Q(e,t){t==="class"&&Ke(e)}function rr(e){return e.trim().split(/\s+/).filter(Boolean)}function ir(e,t){const n=Array.from(e.children),r=rr(t);return r.length===0?n:n.filter(s=>r.every(i=>s.classList.contains(i)))}function sr(e){return te(e).split(` +`)}function or(e,t){return e.tagName.toLowerCase()==="span"&&Qe(e)===t}function lr(e,t){if(t.length===0)return e.childNodes.length===0;if(e.childNodes.length!==t.length*2-1)return!1;for(let n=0;n${Et(i.content)}`}else{let i=0;for(;i${Et(a)}`}}return`${t&&typeof n=="number"?``:""}${s}`}function se(e,t,n,r){const s=[r,t&&typeof n=="number"?n:""];let i=0;for(;i=e.length||Ne(e[i].color,e[i].fontStyle)!==o)break}s.push(o,c.length,c)}return JSON.stringify(s)}function ae(e,t,n,r,s,i,o){const c=i.createElement("span");if(c.className=r,t&&typeof n=="number"){const l=i.createElement("span");l.className="line-number",l.dataset.line=String(n),c.appendChild(l)}let a=0;for(;a(en(e,n,C),r.onResult?.(u),u),O=()=>(e.innerHTML=Zt(t,n,{lang:s,theme:i,preClass:o,codeClass:c,lineClass:a,showLineNumbers:l,startingLineNumber:h,tokenCache:r.tokenCache,tokenCacheMaxEntries:r.tokenCacheMaxEntries,htmlCache:r.htmlCache,htmlCacheMaxEntries:r.htmlCacheMaxEntries,tokenLines:d,styleRoot:w,tokenStyleMode:m}),E("full")),I=e.querySelector("code");if(I&&Q(w,m),!I||!ot(e,I,{preClass:o,codeClass:c,backgroundColor:T})||ye.get(e)!==C)return O();const y=it.get(e);if(typeof y!="string"||(I.textContent??"").replace(/\r/g,"")!==y.replace(/\r/g,""))return O();const x=ir(I,a);if(!cr(I,x,y,a))return O();const L=d?Nt(d,n,!0):Nt(zt(t,n,s,i,{tokenCache:r.tokenCache,tokenCacheMaxEntries:r.tokenCacheMaxEntries}),n),H=L.length,b=x.length;if(r.appendOnlyFastPath===!0&&typeof y=="string"&&y.length>0&&n.startsWith(y)&&n!==y&&b>0&&st(y)===b){const u=b-1,M=l?h+u:void 0,R=N==="signature"?se(L[u],l,M,m):void 0,_=ae(L[u],l,M,a,m,S,R);for(x[u].innerHTML="";_.firstChild;)x[u].appendChild(_.firstChild);if(R&&we(x[u],R),H>b){const P=S.createDocumentFragment();let F=h+b;for(let $=b;$b){const u=S.createDocumentFragment();let M=h+b;for(let R=b;R=b-1){const u=l?h+A:void 0,M=N==="signature"?se(L[A],l,u,m):void 0,R=ae(L[A],l,u,a,m,S,M);for(x[A].innerHTML="";R.firstChild;)x[A].appendChild(R.firstChild);if(M&&we(x[A],M),H>b){const _=S.createDocumentFragment();let P=h+b;for(let F=b;F{if(!r||!s)return"noop";const g=l!==void 0;if(!g&&!o&&n.skipSameCode!==!1&&i===a){const w=s.querySelector("code"),m=_e(n,s),T=Fe(n,m),C=n.preClass??"shiki",E=n.codeClass??"",O=n.lineClass??"line",I=n.showLineNumbers??!1,y=Ae(t,n.theme),x=Oe(n.startingLineNumber??1),L=He({lang:n.lang,theme:n.theme,backgroundColor:y,highlighterRevision:W(t),tokenStyleMode:T,preClass:C,codeClass:E,lineClass:O,showLineNumbers:I,startingLineNumber:x});if(w&&ot(s,w,{preClass:C,codeClass:E,backgroundColor:y})&&ye.get(s)===L&&tn(s,w)&&(w.textContent??"").replace(/\r/g,"")===a.replace(/\r/g,""))return Q(m,T),n.onResult?.("noop"),"noop"}let d;const h={...n,...g?{tokenLines:l}:{},onResult:w=>{try{n.onResult?.(w)}catch(m){d=m}}},N=++c,S=nn(s,t,a,h);if(N===c&&(i=a,o=g),d!==void 0)throw d;return S},reset:()=>{!r||!s||(s.innerHTML="",Xt(s),i=null,o=!1,c++)},cancel:()=>{},dispose:()=>{r=!1,s=null,i=null,o=!1,c++}}}function ar(e){const t=e?.ownerDocument?.defaultView;if(typeof t?.IntersectionObserver=="function")return t.IntersectionObserver;const n=typeof window<"u"?window:null;if(typeof n?.IntersectionObserver=="function")return n.IntersectionObserver;const r=globalThis;return typeof r.IntersectionObserver=="function"?r.IntersectionObserver:null}var ur=class{constructor(){this.queue=[],this.byContainer=new WeakMap,this.visible=new WeakMap,this.io=null,this.idleScheduled=!1,this.idleHandle=null,this.idleCancel=null,this.idleToken=0,this.nextId=1}ensureIntersectionObserver(e){if(!this.io)try{const t=ar(e);t?this.io=new t(n=>{for(const r of n)this.visible.set(r.target,r.isIntersecting)},{root:null,threshold:0}):this.io=null}catch{this.io=null}}schedule(e,t,n,r,s,i){const o=this.byContainer.get(e);if(o)return o.id=this.nextId++,o.code=n,o.highlighter=t,o.opts=r,o.tokenLines=Ye(s),o.estNodes=Rt(n),o.shouldRun=i,o.id;const c={id:this.nextId++,container:e,highlighter:t,code:n,opts:r,tokenLines:Ye(s),estNodes:Rt(n),shouldRun:i};if(this.queue.push(c),this.byContainer.set(e,c),this.ensureIntersectionObserver(e),this.io)try{this.io.observe(e)}catch{}return this.ensureProcessing(),c.id}cancelIdle(){if(!this.idleScheduled)return;const e=this.idleHandle,t=this.idleCancel;if(this.idleToken++,this.idleScheduled=!1,this.idleHandle=null,this.idleCancel=null,e!==null&&t)try{t(e)}catch{}}ensureProcessing(){if(this.idleScheduled||this.queue.length===0)return;const e=globalThis,t=this.queue[0]?.container.ownerDocument?.defaultView,n=t&&typeof t.requestIdleCallback=="function"?t:typeof e.requestIdleCallback=="function"?e:null,r=n?.requestIdleCallback;this.idleScheduled=!0;const s=++this.idleToken;let i=!1;const o=l=>{s===this.idleToken&&(i=!0,this.idleScheduled=!1,this.idleHandle=null,this.idleCancel=null,this.process(l))};if(r)try{const l=r.call(n,o,{timeout:100});if(i)return;this.idleHandle=l,this.idleCancel=typeof n.cancelIdleCallback=="function"?g=>n.cancelIdleCallback(g):null;return}catch{if(i)return}const c=++this.idleToken,a=l=>{c===this.idleToken&&(i=!0,this.idleScheduled=!1,this.idleHandle=null,this.idleCancel=null,this.process(l))};this.idleHandle=setTimeout(()=>a({timeRemaining:()=>50,didTimeout:!0}),50),this.idleCancel=l=>clearTimeout(l)}stopObserving(e){if(this.io)try{this.io.unobserve(e)}catch{}this.visible.delete(e)}process(e){const t=vt(e),n=Math.min(2e3,Math.max(100,Math.floor(t*6)));let r=0;for(;this.queue.length&&!(r>=n);){let s=this.queue.findIndex(o=>this.visible.get(o.container)===!0);s===-1&&(s=0);const i=this.queue.splice(s,1)[0];if(this.byContainer.delete(i.container),i.shouldRun&&!i.shouldRun()){this.byContainer.has(i.container)||this.stopObserving(i.container);continue}if(typeof i.estNodes=="number"&&r+i.estNodes>n&&r!==0){this.queue.push(i),this.byContainer.set(i.container,i);break}try{nn(i.container,i.highlighter,i.code,i.tokenLines?{...i.opts,tokenLines:i.tokenLines}:i.opts)}catch{try{const o=_e(i.opts,i.container),c=Fe(i.opts,o);i.container.innerHTML=Zt(i.highlighter,i.code,{lang:i.opts.lang,theme:i.opts.theme,preClass:i.opts.preClass,codeClass:i.opts.codeClass,lineClass:i.opts.lineClass,showLineNumbers:i.opts.showLineNumbers,startingLineNumber:i.opts.startingLineNumber,tokenCache:i.opts.tokenCache,tokenCacheMaxEntries:i.opts.tokenCacheMaxEntries,htmlCache:i.opts.htmlCache,htmlCacheMaxEntries:i.opts.htmlCacheMaxEntries,tokenLines:i.tokenLines,styleRoot:o,tokenStyleMode:c}),en(i.container,i.code,He({lang:i.opts.lang,theme:i.opts.theme,backgroundColor:Ae(i.highlighter,i.opts.theme),highlighterRevision:W(i.highlighter),tokenStyleMode:c,preClass:i.opts.preClass??"shiki",codeClass:i.opts.codeClass??"",lineClass:i.opts.lineClass??"line",showLineNumbers:i.opts.showLineNumbers??!1,startingLineNumber:Oe(i.opts.startingLineNumber??1)})),ve(i.opts.onResult,"full")}catch{ve(i.opts.onResult,"noop")}}if(typeof i.estNodes=="number"?r+=i.estNodes:r+=50,this.byContainer.has(i.container)||this.stopObserving(i.container),vt(e)<6)break}this.queue.length&&this.ensureProcessing()}cancelFor(e,t){const n=this.byContainer.get(e);if(n){if(t!==void 0&&n.id!==t)return;this.byContainer.delete(e);const r=this.queue.findIndex(s=>s.id===n.id);r!==-1&&this.queue.splice(r,1)}this.queue.length===0&&this.cancelIdle(),this.stopObserving(e)}};const Ht=new ur;function sn(e,t,n){let r=!0,s=e,i=null,o=null,c,a=null,l=0,g=null,d=!1;const h=(T,C)=>{if(!s||C||d||n.skipSameCode===!1||g!==T)return!1;const E=s.querySelector("code");if(!E)return!1;const O=n.preClass??"shiki",I=n.codeClass??"",y=Ae(t,n.theme);if(!ot(s,E,{preClass:O,codeClass:I,backgroundColor:y}))return!1;const x=_e(n,s),L=Fe(n,x),H=n.lineClass??"line",b=n.showLineNumbers??!1,A=Oe(n.startingLineNumber??1),D=He({lang:n.lang,theme:n.theme,backgroundColor:y,highlighterRevision:W(t),tokenStyleMode:L,preClass:O,codeClass:I,lineClass:H,showLineNumbers:b,startingLineNumber:A});return ye.get(s)!==D||!tn(s,E)||(E.textContent??"").replace(/\r/g,"")!==T.replace(/\r/g,"")?!1:(Q(x,L),!0)},N=()=>{if(!s||i==null)return;const T=i;i=null,Ht.cancelFor(s,T)},S=()=>{l++,a!==null&&(clearTimeout(a),a=null),o=null,c=void 0,N()},w=()=>{if(a=null,!r||!s||o==null)return;const T=o,C=s,E=c,O=E!==void 0;o=null,c=void 0;const I=n.onResult,y=l;let x=-1,L=!1;const H={...n,appendOnlyFastPath:n.appendOnlyFastPath??!1,onResult:b=>{L=!0,l===y&&i===x&&(i=null),l===y&&(g=T,d=O),ve(I,b)}};x=Ht.schedule(C,t,T,H,E,()=>r&&s===C&&l===y),L||(i=x)},m=()=>{const T=Xn(n.throttleMs);if(a!==null&&(clearTimeout(a),a=null),T<=0){w();return}a=setTimeout(w,T)};return{update:(T,C)=>!r||!s?"noop":h(T,C!==void 0)?(S(),ve(n.onResult,"noop"),"noop"):(l++,N(),o=T,c=Ye(C),m(),"noop"),reset:()=>{!r||!s||(S(),s.innerHTML="",Xt(s),g=null,d=!1)},cancel:S,dispose:()=>{r=!1,S(),s=null,g=null,d=!1}}}const ne=[],re=[];let X=null,ue=0,me=null,G=!1,lt=8;function on(e){typeof e=="number"&&Number.isFinite(e)&&e>=0&&(lt=e)}function xr(){return lt}function Nr(){return G}function Rr(){return ne.length+re.length}function fr(){G=!0,Pe()}function hr(){G&&(G=!1,ct())}function Ze(){return globalThis.performance?.now?globalThis.performance.now():Date.now()}function pe(){return ne.length>0||re.length>0}function ln(){return ne.shift()??re.shift()}function dr(e){let t=ne.indexOf(e);return t>=0?(ne.splice(t,1),!0):(t=re.indexOf(e),t>=0?(re.splice(t,1),!0):!1)}function gr(){ne.length=0,re.length=0}function mr(){const e=[globalThis,typeof window<"u"?window:null].filter(Boolean);for(const t of e)if(typeof t.requestAnimationFrame=="function"&&typeof t.cancelAnimationFrame=="function")return{request:n=>t.requestAnimationFrame(n),cancel:n=>t.cancelAnimationFrame(n)};return{request:t=>setTimeout(()=>t(Ze()),16),cancel:t=>clearTimeout(t)}}function Pe(){if(X==null)return;const e=X,t=me;X=null,ue++,me=null;try{t?.(e)}catch{}}function ct(){if(X!=null||G||!pe())return;const e=mr(),t=++ue;let n=!1;const r=()=>{t===ue&&(n=!0,At())};try{me=e.cancel;const s=e.request(r);if(n)return;X=s}catch{if(n)return;const s=++ue;X=setTimeout(()=>{s===ue&&(n=!0,At())},16),me=o=>clearTimeout(o)}}function At(){if(X=null,me=null,G)return;const e=Ze();for(;pe();){const t=ln();try{t()}catch(n){console.error("render-scheduler job error",n)}if(G||Ze()-e>=lt)break}!G&&pe()&&ct()}function Ee(e,t){const n=t?.priority??"normal";let r=!1;const s=()=>{r||e()};return n==="high"?ne.push(s):re.push(s),ct(),()=>{r||(r=!0,dr(s)&&(pe()||Pe()))}}function vr(e){e()}function pr(){for(Pe();pe();){const e=ln();try{e()}catch{}}}function Er(){gr(),Pe()}function Ir(e,t={}){const n=Math.max(1,t.batchSize??6),r=Math.max(1,t.staggerMs??30),s=[],i=[];for(const a of e){const l=a.el.getBoundingClientRect(),g=globalThis.innerHeight??0;l.bottom>=0&&l.top<=g?s.push(a):i.push(a)}fr();for(const a of s)Ee(()=>{try{a.render()}catch{}},{priority:"high"});hr(),t.drainVisible&&pr();let o=!1;const c=[];for(let a=0;a{if(!o)for(const h of l)Ee(()=>{try{h.render()}catch{}},{priority:"normal"})},g);c.push(d)}return()=>{o=!0;for(const a of c)clearTimeout(a)}}const Xe=new WeakMap;let Se=null;function Cr(){return Se||(typeof window>"u"||!window.IntersectionObserver?null:(Se=new IntersectionObserver(e=>{for(const t of e){const n=Xe.get(t.target);if(n)try{n(!!t.isIntersecting,t)}catch{}}},{root:null,threshold:0}),Se))}function cn(e,t){const n=Cr();return Xe.set(e,t),n&&n.observe(e),()=>{Xe.delete(e),n&&n.unobserve(e)}}let De=null;function yr(){return De??=_t(()=>import("./index-Cm9Q4xVi.js"),[]).then(e=>e.ShikiStreamTokenizer).catch(e=>{throw De=null,e}),De}function br(e){const t=[[]];let n=!1;const r=(s,i)=>{i&&t[t.length-1].push(i===s.content?s:{...s,content:i})};for(const s of e){let i=s.content;if(!i||n&&(n=!1,i.charCodeAt(0)===10&&(t.push([]),i=i.slice(1),!i)))continue;let o=0;for(let c=0;c{const k=t.langs?.length?t.langs:void 0,v=k??Le;return!f||f==="plaintext"||v.includes(f)?k:[...v,f]},x=async(f=r)=>{if(C)return;const k=await Z({langs:y(f),themes:t.themes});C||(i=k)},L=f=>{if(!i)return!1;const k=i;if(typeof k.getTheme!="function")return!1;try{return!!k.getTheme(f)}catch{return!1}},H=async(f,k=r)=>{if(!f||C||(i||await x(k),C||!i)||L(f))return;const v=await Z({langs:y(k),themes:[f]});C||(i=v)},b=()=>i?W(i):-1,A=async()=>{if(i||await x(r),C||!i)return;const f=b(),k=r??"plaintext",v=s;if(o&&l===f&&g===k&&d===v)return;o?.clear(),o=null,l=-1,g=void 0,d=void 0;const j=await yr();if(C||!i)return;const B=b();o=new j({highlighter:i,lang:k,theme:v}),l=B,g=k,d=v},D=f=>{const k=I.then(f,f);return I=k.then(()=>{},()=>{}),k},p=()=>{c=[],a=b()},u=()=>{o?.clear(),o=null,l=-1,g=void 0,d=void 0},M=(f,k)=>C||o!==f||l!==k||b()!==k,R=()=>{m++,w&&(w(),w=null),S=!1,T=null,h?.cancel?.()},_=(f,k)=>{const v=++m;let j=!1;const B=Ee(()=>{m===v&&(j=!0,w=null,f())},{priority:k});m===v&&(w=j?null:B)};typeof window<"u"&&e&&(E=cn(e,f=>{O=f})),typeof t.timeBudget=="number"&&Number.isFinite(t.timeBudget)&&t.timeBudget>=0&&on(t.timeBudget);const P=()=>({lang:r??"plaintext",theme:s,preClass:t.preClass,codeClass:t.codeClass,lineClass:t.lineClass,showLineNumbers:t.showLineNumbers,startingLineNumber:t.startingLineNumber,tokenCache:t.tokenCache,tokenCacheMaxEntries:t.tokenCacheMaxEntries,htmlCache:t.htmlCache,htmlCacheMaxEntries:t.htmlCacheMaxEntries,styleRoot:t.styleRoot,tokenStyleMode:t.tokenStyleMode,compareMode:t.compareMode,skipSameCode:t.skipSameCode,appendOnlyFastPath:!1,throttleMs:t.throttleMs,onResult:t.onResult}),F=()=>{h?.dispose(),!(C||!i)&&(h=(N?sn:rn)(e,i,P()))},$=(f,k)=>{if(!C){if(T={code:f,tokenLines:k},!N){if(!h)return;const v=T;T=null,v&&h.update(v.code,v.tokenLines);return}S||(S=!0,_(()=>{if(S=!1,C||!h||!T)return;const v=T;T=null,h.update(v.code,v.tokenLines)},O?"high":"normal"))}},V=f=>{C||(u(),p(),$(f))},ie=f=>f.replace(/\r/g,""),qe=()=>{let f="";for(const k of c)f+=k.content;return f},at=f=>!i||a!==W(i)?!1:ie(qe())===ie(f),be=f=>{if(!at(f)){p(),$(f);return}$(f,br(c))};return{updateCode:(f,k)=>D(async()=>{if(C)return;const v=k??r,j=v!==r;if(f===n&&!j&&h){R(),be(f);return}const B=n;if(n=f,R(),!i||j){if(r=v,await x(v),await H(s,v),C)return;u(),p(),F()}else h||F();if(await A(),C||!o||!h)return;const ke=!j&&t.useGrammarState!==!1&&at(B)&&!!B&&f.startsWith(B);ke||(o.clear(),p());const an=ke?f.slice(B.length):f,ut=o,ft=l,{stable:un,unstable:fn,recall:ht}=await ut.enqueue(an);if(M(ut,ft)){V(f);return}ke&&ht>0?c.splice(Math.max(0,c.length-ht)):ke||p(),c.push(...un??[],...fn??[]),a=ft,be(f)}),setTheme:f=>D(async()=>{if(C||!f||f===s||(R(),await H(f,r),C))return;if(s=f,u(),p(),F(),!n){be(n);return}await A();const k=o;if(C||!k||!h)return;const v=l,{stable:j,unstable:B}=await k.enqueue(n);if(M(k,v)){V(n);return}c=[...j??[],...B??[]],a=v,be(n)}),dispose:()=>{C=!0,R(),h?.dispose(),h=null,u(),c=[],a=-1,E&&(E(),E=null)},getState:()=>({code:n,lang:r,theme:s,tokenCount:c.length})}}function Hr(e,t){let n="",r=t.lang,s=t.theme??"vitesse-dark",i=null,o=null;const c=t.scheduleInRaf??!0;let a=!1,l=null,g=0,d=!1,h=null,N=!1,S=Promise.resolve();const w=(p=r)=>{const u=t.langs?.length?t.langs:void 0,M=u??Le;return!p||p==="plaintext"||M.includes(p)?u:[...M,p]},m=()=>{g++,l&&(l(),l=null),a=!1,o?.cancel?.()},T=(p,u)=>{const M=++g;let R=!1;const _=Ee(()=>{g===M&&(R=!0,l=null,p())},{priority:u});g===M&&(l=R?null:_)},C=async(p=r)=>{if(d)return;const u=await Z({langs:w(p),themes:t.themes});d||(i=u)},E=p=>{if(!i)return!1;const u=i;if(typeof u.getTheme!="function")return!1;try{return!!u.getTheme(p)}catch{return!1}},O=async(p,u=r)=>{if(!p||d||(i||await C(u),d||!i)||E(p))return;const M=await Z({langs:w(u),themes:[p]});d||(i=M)},I=p=>{const u=S.then(p,p);return S=u.then(()=>{},()=>{}),u};typeof window<"u"&&e&&(h=cn(e,p=>{N=p})),typeof t.timeBudget=="number"&&Number.isFinite(t.timeBudget)&&t.timeBudget>=0&&on(t.timeBudget);const y=()=>({lang:r??"plaintext",theme:s,preClass:t.preClass,codeClass:t.codeClass,lineClass:t.lineClass,showLineNumbers:t.showLineNumbers,startingLineNumber:t.startingLineNumber,tokenCache:t.tokenCache,tokenCacheMaxEntries:t.tokenCacheMaxEntries,htmlCache:t.htmlCache,htmlCacheMaxEntries:t.htmlCacheMaxEntries,styleRoot:t.styleRoot,tokenStyleMode:t.tokenStyleMode,compareMode:t.compareMode,skipSameCode:t.skipSameCode,appendOnlyFastPath:!1,throttleMs:t.throttleMs,onResult:t.onResult}),x=()=>{o?.dispose(),!(d||!i)&&(o=(c?sn:rn)(e,i,y()))},L=()=>{if(!d){if(!c){if(!o)return;o.update(n);return}a||(a=!0,T(()=>{a=!1,!(d||!o)&&o.update(n)},N?"high":"normal"))}};return{updateCode:(p,u)=>I(async()=>{if(d)return;const M=u??r,R=M!==r;if(n=p,m(),!i||R){if(r=M,await C(M),await O(s,M),d)return;x()}else o||x();L()}),setTheme:p=>I(async()=>{d||!p||p===s||(m(),await O(p,r),!d&&(s=p,x(),L()))}),dispose:()=>{d=!0,m(),o?.dispose(),o=null,h&&(h(),h=null)},getState:()=>({code:n,lang:r,theme:s})}}export{Er as clearAll,sn as createScheduledTokenIncrementalUpdater,Or as createShikiStreamCachedRenderer,Hr as createShikiStreamRenderer,rn as createTokenIncrementalUpdater,Le as defaultLanguages,dt as defaultThemes,Mr as disposeHighlighter,pr as drain,Rr as getQueueLength,xr as getTimeBudget,Nr as isPaused,fr as pause,Z as registerHighlight,Zt as renderCodeWithTokens,Ir as restoreWithVisibilityPriority,hr as resume,vr as runImmediate,Ee as scheduleRenderJob,on as setTimeBudget,nn as updateCodeTokensIncremental}; diff --git a/apps/kimi-code/dist-web/assets/index-ByWw02oy.css b/apps/kimi-code/dist-web/assets/index-ByWw02oy.css new file mode 100644 index 0000000000..b75d5dced5 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-ByWw02oy.css @@ -0,0 +1 @@ +.ui-icon-button[data-v-c9e67023]{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:0;border:1px solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--color-text-muted);cursor:pointer;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.ui-icon-button[data-v-c9e67023]:hover:not(:disabled){background:color-mix(in srgb,var(--color-text) 8%,transparent);color:var(--color-text)}.ui-icon-button[data-v-c9e67023]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ui-icon-button[data-v-c9e67023]:disabled{opacity:.5;cursor:not-allowed}.ui-icon-button--sm[data-v-c9e67023]{width:26px;height:26px;border-radius:var(--radius-sm)}.ui-icon-button--md[data-v-c9e67023]{width:32px;height:32px}.ui-icon-button--lg[data-v-c9e67023]{width:44px;height:44px}.ui-icon-button[data-v-c9e67023] svg{width:var(--p-ic-md);height:var(--p-ic-md)}.ui-icon-button--sm[data-v-c9e67023] svg{width:var(--p-ic-md);height:var(--p-ic-md)}.ui-icon-button--lg[data-v-c9e67023] svg{width:var(--p-ic-lg);height:var(--p-ic-lg)}.ui-dialog__overlay[data-v-3dce23a4]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:var(--space-6);background:#0d111773;animation:kimi-dialog-overlay-in-3dce23a4 var(--duration-base) var(--ease-out)}@keyframes kimi-dialog-overlay-in-3dce23a4{0%{opacity:0}to{opacity:1}}.ui-dialog[data-v-3dce23a4]{max-height:calc(100vh - var(--space-8) * 2);display:flex;flex-direction:column;background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-xl);box-shadow:var(--shadow-xl);outline:none;overflow:hidden;animation:kimi-card-in var(--duration-slow) var(--ease-out)}.ui-dialog--md[data-v-3dce23a4]{width:min(440px,100%)}.ui-dialog--lg[data-v-3dce23a4]{width:min(640px,100%)}.ui-dialog--xl[data-v-3dce23a4]{width:min(var(--p-content-max),100%)}.ui-dialog--fixed-height[data-v-3dce23a4]{height:min(680px,calc(100vh - var(--space-8) * 2))}.ui-dialog--flush .ui-dialog__body[data-v-3dce23a4]{padding:0}.ui-dialog__head[data-v-3dce23a4]{display:flex;align-items:flex-start;gap:var(--space-3);padding:20px 22px 14px}.ui-dialog__titles[data-v-3dce23a4]{flex:1;min-width:0}.ui-dialog__title[data-v-3dce23a4]{font-size:var(--text-lg);font-weight:500;color:var(--color-text);line-height:var(--leading-tight)}.ui-dialog__desc[data-v-3dce23a4]{margin-top:4px;font-size:var(--text-base);color:var(--color-text-muted)}.ui-dialog__close[data-v-3dce23a4]{flex:none;margin-top:-2px}.ui-dialog__body[data-v-3dce23a4]{flex:1;min-height:0;padding:4px 22px 18px;color:var(--color-text);overflow:auto}.ui-dialog__foot[data-v-3dce23a4]{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 22px 20px}.sd-head[data-v-a678f802]{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-2)}.sd-search-icon[data-v-a678f802]{flex:none;color:var(--color-text-muted)}.sd-input[data-v-a678f802]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-lg);color:var(--color-text);background:none;border:none;outline:none;padding:var(--space-1) 0}.sd-input[data-v-a678f802]::placeholder{color:var(--color-text-muted)}.sd-list[data-v-a678f802]{height:420px;overflow-y:auto;padding:var(--space-1) var(--space-2)}.sd-row[data-v-a678f802]{display:flex;flex-direction:column;gap:2px;width:100%;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:none;cursor:pointer;text-align:left;font-family:var(--font-ui);color:var(--color-text)}.sd-row[data-v-a678f802]:hover,.sd-row.on[data-v-a678f802]{background:var(--color-surface-sunken)}.sd-row.active .sd-title[data-v-a678f802]{color:var(--color-accent-hover)}.sd-meta[data-v-a678f802]{display:flex;align-items:center;gap:var(--space-1);min-width:0;font-size:var(--text-xs);color:var(--color-text-muted)}.sd-folder[data-v-a678f802]{flex:none;color:var(--color-text-muted)}.sd-ws[data-v-a678f802]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-time[data-v-a678f802]{flex:none;font-family:var(--font-mono);color:var(--color-text-faint)}.sd-title[data-v-a678f802]{min-width:0;font-size:var(--text-base);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-snippet[data-v-a678f802]{min-width:0;font-size:var(--text-sm);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-title[data-v-a678f802] mark,.sd-snippet[data-v-a678f802] mark{background:var(--color-accent);color:var(--color-bg);font-weight:600;border-radius:var(--radius-xs);padding:0 2px}.sd-empty[data-v-a678f802]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}.sd-hint[data-v-a678f802]{font-size:var(--text-xs);color:var(--color-text-muted)}.ui-spinner[data-v-e5c5b17d]{display:inline-flex;flex:none;color:var(--color-accent)}.ui-spinner--sm[data-v-e5c5b17d]{width:14px;height:14px}.ui-spinner--md[data-v-e5c5b17d]{width:18px;height:18px}.ui-spinner--lg[data-v-e5c5b17d]{width:28px;height:28px}.ui-spinner__svg[data-v-e5c5b17d]{width:100%;height:100%;animation:ui-spinner-rotate-e5c5b17d .85s linear infinite}.ui-spinner__track[data-v-e5c5b17d]{fill:none;stroke:var(--color-line);stroke-width:2.2}.ui-spinner__arc[data-v-e5c5b17d]{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-dasharray:56 56;stroke-dashoffset:38}@keyframes ui-spinner-rotate-e5c5b17d{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.ui-spinner__svg[data-v-e5c5b17d]{animation-duration:1.8s}}.ui-badge[data-v-5bc5cd6d]{display:inline-flex;align-items:center;gap:6px;border-radius:var(--radius-full);font-family:var(--font-ui);font-weight:var(--weight-medium);line-height:1;white-space:nowrap;border:1px solid transparent}.ui-badge--md[data-v-5bc5cd6d]{height:22px;padding:0 9px;font-size:var(--text-xs)}.ui-badge--sm[data-v-5bc5cd6d]{height:18px;padding:0 7px;font-size:11px}.ui-badge__dot[data-v-5bc5cd6d]{width:6px;height:6px;border-radius:var(--radius-full);background:currentColor;flex:none}.ui-badge--neutral[data-v-5bc5cd6d]{background:var(--color-surface-sunken);color:var(--color-text-muted);border-color:var(--color-line)}.ui-badge--info[data-v-5bc5cd6d]{background:var(--color-accent-soft);color:var(--color-accent-hover);border-color:var(--color-accent-bd)}.ui-badge--success[data-v-5bc5cd6d]{background:var(--color-success-soft);color:var(--color-success);border-color:var(--color-success-bd)}.ui-badge--warning[data-v-5bc5cd6d]{background:var(--color-warning-soft);color:var(--color-warning);border-color:var(--color-warning-bd)}.ui-badge--danger[data-v-5bc5cd6d]{background:var(--color-danger-soft);color:var(--color-danger);border-color:var(--color-danger-bd)}.ui-badge--solid[data-v-5bc5cd6d]{background:var(--color-text);color:var(--color-bg)}.ui-menu[data-v-60e6cd8d]{min-width:180px;padding:var(--space-1);background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);display:flex;flex-direction:column}.ui-menu-item[data-v-f940771a]{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:6px 10px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);text-align:left;cursor:pointer;transition:background var(--duration-base),color var(--duration-base)}.ui-menu-item[data-v-f940771a]:hover:not(:disabled){background:var(--color-surface-sunken)}.ui-menu-item[data-v-f940771a]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ui-menu-item[data-v-f940771a]:disabled{opacity:.5;cursor:not-allowed}.ui-menu-item.is-active[data-v-f940771a]{background:var(--color-accent-soft);color:var(--color-accent-hover)}.ui-menu-item.is-danger[data-v-f940771a]{color:var(--color-danger)}.ui-menu-item.is-danger[data-v-f940771a]:hover:not(:disabled){background:var(--color-danger-soft)}.ui-menu-item[data-v-f940771a] svg{width:14px;height:14px;flex:none}.ui-menu-item--lg[data-v-f940771a]{min-height:44px;padding:12px 14px;font-size:var(--text-base)}.ui-menu-sep[data-v-f940771a]{height:1px;margin:4px 0;background:var(--color-line)}.ui-tip[data-v-4c261eb6]{display:contents}.ui-tip__bubble[data-v-4c261eb6]{position:fixed;z-index:var(--z-tooltip);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--tip-lines);max-width:280px;padding:4px 8px;border-radius:var(--radius-sm);background:var(--color-text);color:var(--color-bg);font-family:var(--font-ui);font-size:var(--text-xs);line-height:1.35;overflow:hidden;overflow-wrap:anywhere;pointer-events:none;opacity:0;transition:opacity var(--duration-fast) var(--ease-out)}.ui-tip__bubble.positioned[data-v-4c261eb6]{opacity:1}.se[data-v-c1a3c877]{display:block;margin:0;padding:8px var(--space-2);border-radius:var(--radius-sm);font-family:var(--font-ui);color:var(--color-text);cursor:pointer;position:relative}.se[data-v-c1a3c877]:hover{background:var(--sb-hover, var(--color-surface-sunken));color:var(--color-text)}.se.on[data-v-c1a3c877]{background:var(--color-selected);color:var(--color-text)}.row[data-v-c1a3c877]{display:flex;align-items:center;gap:var(--sb-gap, 6px);min-width:0}.left[data-v-c1a3c877]{display:flex;align-items:center;flex:1;min-width:0}.lead[data-v-c1a3c877]{width:var(--sb-gutter, 16px);flex:none;display:inline-flex;align-items:center;justify-content:center}.unread-dot[data-v-c1a3c877]{width:7px;height:7px;border-radius:var(--radius-full);background:var(--color-accent)}.t[data-v-c1a3c877]{color:inherit;font-size:var(--ui-font-size-sm);font-weight:450;line-height:var(--leading-tight);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ts[data-v-c1a3c877]{color:var(--color-text-faint);font-size:var(--text-xs);font-family:var(--font-ui);font-weight:475;line-height:var(--leading-tight);font-variant-numeric:tabular-nums;text-align:right}.act[data-v-c1a3c877]{position:relative;flex:none;display:inline-flex;align-items:center;justify-content:flex-end;min-width:26px}.act .kebab[data-v-c1a3c877]{position:absolute;right:0;top:50%;transform:translateY(-50%);visibility:hidden}.se:hover .act .kebab[data-v-c1a3c877],.act:has(.kebab.open) .kebab[data-v-c1a3c877]{visibility:visible}.se:hover .act .ts[data-v-c1a3c877],.act:has(.kebab.open) .ts[data-v-c1a3c877]{visibility:hidden}.kebab.open[data-v-c1a3c877]{color:var(--color-text);background:var(--sb-hover, var(--color-surface-sunken))}.menu[data-v-c1a3c877]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.menu-time[data-v-c1a3c877]{padding:6px 10px;color:var(--color-text-faint);font-family:var(--font-mono);font-size:var(--text-xs);cursor:default;user-select:text}.rename-input[data-v-c1a3c877]{flex:1;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-accent);border-radius:var(--radius-xs);padding:1px 4px;outline:none;min-width:0}.sessions .se[data-v-c1a3c877]{margin:0;border-radius:var(--radius-sm);padding:8px calc(var(--sb-pad-x, 20px) - var(--sb-inset, 12px))}.sessions .se .rename-input[data-v-c1a3c877]{border-radius:var(--radius-sm);font-family:var(--sans)}.sessions .se .kebab[data-v-c1a3c877]{border-radius:var(--radius-sm)}.group.dragging[data-v-cdac739a]{opacity:.45}.group-sessions[data-v-cdac739a]{height:auto;overflow:hidden;transition:height var(--duration-base) var(--ease-out)}.group-sessions.collapsed[data-v-cdac739a]{height:0}.gh[data-v-cdac739a]{display:flex;flex-direction:column;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text);user-select:none;position:relative;cursor:grab}.gh[data-v-cdac739a]:active{cursor:grabbing}.gh[data-v-cdac739a]:hover{background:var(--sb-hover, var(--color-surface-sunken))}.gh-top[data-v-cdac739a]{position:relative;display:flex;align-items:center;gap:var(--sb-gap)}.gh-folder[data-v-cdac739a]{flex:none;color:var(--color-text-muted)}.gh-name[data-v-cdac739a]{font-size:var(--ui-font-size-sm);line-height:var(--leading-tight);color:var(--color-text-muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.gh-actions[data-v-cdac739a]{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:var(--space-1);padding-left:var(--space-1);border-radius:var(--radius-sm);isolation:isolate;background:var(--color-sidebar-bg);opacity:0;pointer-events:none}.gh-actions[data-v-cdac739a]:after{content:"";position:absolute;inset:0;z-index:0;border-radius:var(--radius-sm);background:transparent}.gh:hover .gh-actions[data-v-cdac739a]:after{background:var(--sb-hover, var(--color-surface-sunken))}.gh-actions[data-v-cdac739a]>*{position:relative;z-index:1}.gh:hover .gh-actions[data-v-cdac739a],.gh:focus-within .gh-actions[data-v-cdac739a],.gh-actions.open[data-v-cdac739a]{opacity:1;pointer-events:auto}.gh-more.open[data-v-cdac739a]{color:var(--color-text);background:var(--color-line)}.group-empty[data-v-cdac739a]{padding:var(--space-1) var(--space-2) var(--space-1) calc(var(--sb-pad-x) - var(--sb-inset) + var(--sb-gutter) + var(--sb-gap));font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-ui)}.show-more[data-v-cdac739a]{display:flex;align-items:center;gap:var(--sb-gap);width:100%;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);text-align:left;cursor:pointer}.show-more[data-v-cdac739a]:hover{background:var(--sb-hover, var(--color-surface-sunken))}.show-more[data-v-cdac739a]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.show-more-lead[data-v-cdac739a]{width:var(--sb-gutter);flex:none}.show-more-label[data-v-cdac739a]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gh-rename[data-v-cdac739a]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-regular);color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none}.gh-rename[data-v-cdac739a]{border-radius:var(--radius-sm);font-family:var(--sans)}.gh-add[data-v-cdac739a]{color:var(--faint)}.gh-add[data-v-cdac739a]:hover{color:var(--dim)}.ui-kbd[data-v-32292ed8]{display:inline-flex;align-items:center;gap:3px;flex:none}.ui-kbd__key[data-v-32292ed8]{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border:1px solid var(--color-line);border-bottom-width:2px;border-radius:var(--radius-xs);background:var(--color-surface-sunken);color:var(--color-text-muted);font-family:var(--font-ui);font-size:11px;line-height:1}.ui-pill[data-v-317ace1a]{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid transparent;border-radius:var(--radius-md);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);line-height:1;white-space:nowrap;cursor:default;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}button.ui-pill[data-v-317ace1a]{cursor:pointer}button.ui-pill[data-v-317ace1a]:hover:not(:disabled){background:var(--color-surface-sunken);color:var(--color-text)}button.ui-pill[data-v-317ace1a]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}button.ui-pill[data-v-317ace1a]:disabled{opacity:.5;cursor:not-allowed}.ui-pill.is-active[data-v-317ace1a]{background:var(--color-accent-soft);color:var(--color-accent)}.ui-pill[data-v-317ace1a] svg{width:var(--p-ic-sm);height:var(--p-ic-sm);flex:none;color:var(--color-text-faint)}.side[data-v-1b04ce05]{background:var(--color-sidebar-bg);display:flex;flex-direction:row;justify-content:flex-end;overflow:hidden;min-width:0;height:100%;transition:width .28s cubic-bezier(.4,0,.2,1),visibility .28s;--sb-inset: var(--space-3);--sb-pad-x: var(--space-5);--sb-gutter: 16px;--sb-gap: var(--space-2);--sb-hover: var(--color-hover)}.side.no-anim[data-v-1b04ce05]{transition:none}.side.collapsed[data-v-1b04ce05]{visibility:hidden}.col[data-v-1b04ce05]{flex:none;min-width:0;display:flex;flex-direction:column;min-height:0;width:100%;box-sizing:border-box;border-right:1px solid var(--line);container-type:inline-size;container-name:sidebar-col}.ch[data-v-1b04ce05]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:var(--space-3);min-height:calc(26px + 2 * var(--space-3));width:100%;box-sizing:border-box}.side.macos-desktop .ch[data-v-1b04ce05]{padding-left:80px;-webkit-app-region:drag}.side.macos-desktop .ch-brand[data-v-1b04ce05]{display:none}.ch-logo[data-v-1b04ce05]{height:22px;width:32px;flex:none;display:block;cursor:pointer;user-select:none;touch-action:none;transition:transform .18s ease}.ch-logo[data-v-1b04ce05]:hover{transform:scale(1.08)}.ch-logo.is-dev[data-v-1b04ce05]{--logo: var(--color-logo-dev)}.ch-brand[data-v-1b04ce05]{display:flex;align-items:center;gap:8px;min-width:0;flex:1;user-select:none;touch-action:none}.ch-name[data-v-1b04ce05]{font-size:var(--ui-font-size);font-weight:500;line-height:22px;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ch-backend[data-v-1b04ce05]{flex:none;min-width:0}.ch-backend-kind[data-v-1b04ce05]{font-family:var(--mono);font-weight:500;color:var(--color-text-muted)}.ch-backend-kind.is-v2[data-v-1b04ce05]{color:var(--color-accent)}.ch-backend-ep[data-v-1b04ce05]{font-family:var(--mono);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis}@container sidebar-col (max-width: 320px){.ch-backend-ep[data-v-1b04ce05]{display:none}}@container sidebar-col (max-width: 250px){.ch-name[data-v-1b04ce05]{display:none}}.btn-wrap[data-v-1b04ce05]{display:flex;align-items:center;gap:8px;padding:0 var(--sb-inset)}.btn-new-chat[data-v-1b04ce05]{display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:var(--leading-tight);cursor:pointer;text-align:left}.btn-new-chat[data-v-1b04ce05]:hover{background:var(--sb-hover)}.btn-new-chat[data-v-1b04ce05]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.btn-new-chat svg[data-v-1b04ce05]{flex:none}.btn-new-chat span[data-v-1b04ce05]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-wrap[data-v-1b04ce05]{padding:0 var(--sb-inset);position:relative;z-index:1;background:var(--color-sidebar-bg);border-bottom:1px solid transparent;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.search-wrap--scrolled[data-v-1b04ce05]{border-bottom-color:var(--line);box-shadow:var(--shadow-sm)}.search[data-v-1b04ce05]{display:flex;align-items:center;gap:12px;width:100%;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.search[data-v-1b04ce05]:hover{background:var(--sb-hover)}.search[data-v-1b04ce05]:focus-visible{background:var(--sb-hover);color:var(--color-text);outline:2px solid var(--color-accent-bd);outline-offset:-2px}.search-icon[data-v-1b04ce05]{flex:none}.search-input[data-v-1b04ce05]{flex:1;min-width:0;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sessions[data-v-1b04ce05]{flex:1;overflow-y:auto;padding:var(--space-3) var(--sb-inset);min-height:0}.sessions[data-v-1b04ce05]::-webkit-scrollbar{width:4px}.sessions[data-v-1b04ce05]::-webkit-scrollbar-track{background:transparent}.sessions[data-v-1b04ce05]::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent);border-radius:var(--radius-full)}.sessions[data-v-1b04ce05]::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.side-footer[data-v-1b04ce05]{flex:none;padding:var(--space-2) var(--sb-inset);border-top:1px solid var(--line)}.btn-settings[data-v-1b04ce05]{display:flex;align-items:center;gap:12px;width:100%;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:var(--leading-tight);cursor:pointer;text-align:left}.btn-settings[data-v-1b04ce05]:hover{background:var(--sb-hover)}.btn-settings[data-v-1b04ce05]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.btn-settings svg[data-v-1b04ce05]{flex:none}.btn-settings span[data-v-1b04ce05]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-section-label[data-v-1b04ce05]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 var(--space-3) var(--space-1) var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-regular);text-transform:uppercase;color:var(--faint);user-select:none}.side-section-title[data-v-1b04ce05]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-section-toggle[data-v-1b04ce05]{color:var(--faint);opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.side-section-label:hover .side-section-toggle[data-v-1b04ce05],.side-section-label:focus-within .side-section-toggle[data-v-1b04ce05]{opacity:1}.side-section-toggle[data-v-1b04ce05]:hover{color:var(--dim)}.side-section-toggle svg[data-v-1b04ce05]{width:13px;height:13px}.side-section-actions[data-v-1b04ce05]{display:flex;align-items:center;gap:2px}.ws-drop-target.drop-before[data-v-1b04ce05]{box-shadow:inset 0 2px 0 var(--color-accent)}.ws-drop-target.drop-after[data-v-1b04ce05]{box-shadow:inset 0 -2px 0 var(--color-accent)}.empty[data-v-1b04ce05]{padding:var(--space-6) var(--space-3);text-align:center;color:var(--faint);font-size:calc(var(--ui-font-size) - 3px);line-height:1.6}.ws-menu[data-v-1b04ce05],.gh-menu[data-v-1b04ce05],.section-menu[data-v-1b04ce05],.backend-menu[data-v-1b04ce05]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.section-menu-check[data-v-1b04ce05]{display:inline-flex;flex:none;width:14px}.backend-menu-name[data-v-1b04ce05]{font-family:var(--mono);font-weight:500}.backend-menu-url[data-v-1b04ce05]{margin-left:8px;font-family:var(--mono);color:var(--color-text-muted)}.rh[data-v-48fd0a6d]{width:4px;flex:none;cursor:col-resize;position:relative;align-self:stretch;background:transparent;touch-action:none;margin:0 -2px;z-index:var(--z-dropdown)}.rh-bar[data-v-48fd0a6d]{position:absolute;inset:0;background:transparent;transition:background .12s}.rh:hover .rh-bar[data-v-48fd0a6d],.rh.dragging .rh-bar[data-v-48fd0a6d]{background:var(--color-accent)}.kw-dot[data-v-e36198e5]{width:7px;height:7px;border-radius:var(--radius-full);background:var(--color-text-faint);flex:none}.kw-dot--ok[data-v-e36198e5]{background:var(--color-success)}.kw-dot--error[data-v-e36198e5]{background:var(--color-danger)}.kw-dot--suspended[data-v-e36198e5]{background:var(--color-warning)}.kw-dot--running[data-v-e36198e5]{background:var(--color-accent);animation:kw-dot-pulse-e36198e5 1.4s var(--ease-out) infinite}@keyframes kw-dot-pulse-e36198e5{0%{box-shadow:0 0 color-mix(in srgb,var(--color-accent) 40%,transparent)}to{box-shadow:0 0 0 6px transparent}}.box[data-v-fef8aad2]{margin:0;background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.box.err[data-v-fef8aad2]{border-color:color-mix(in srgb,var(--color-danger) 25%,var(--bg))}.box.stacked[data-v-fef8aad2]{border:none;border-radius:0}.box.stacked .bh[data-v-fef8aad2]{border-radius:0}.box.stack-middle[data-v-fef8aad2],.box.stack-last[data-v-fef8aad2]{border-top:1px solid var(--color-line)}.bh[data-v-fef8aad2]{display:flex;align-items:center;gap:8px;min-height:30px;padding:0 11px;cursor:pointer;font:var(--text-sm) var(--font-mono);color:var(--color-text)}.box.open .bh[data-v-fef8aad2],.bh[data-v-fef8aad2]:hover{background:var(--color-surface-sunken)}.box.err .bh[data-v-fef8aad2]{background:color-mix(in srgb,var(--color-danger) 4%,var(--bg))}.box.err .bh[data-v-fef8aad2]:hover{background:color-mix(in srgb,var(--color-danger) 7%,var(--bg))}.gl[data-v-fef8aad2]{display:inline-flex;align-items:center;color:var(--color-text-faint);flex:none}.bh-text[data-v-fef8aad2]{display:flex;align-items:baseline;gap:inherit;flex:1;min-width:0}.a[data-v-fef8aad2]{color:var(--color-text);font-weight:var(--weight-medium);flex:none}.p[data-v-fef8aad2]{color:var(--color-text-muted);font-size:var(--text-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.rt[data-v-fef8aad2]{margin-left:auto;color:var(--color-text-muted);font-size:var(--text-xs);display:flex;align-items:center;gap:6px;flex:none}.tm[data-v-fef8aad2]{color:var(--color-text-faint)}.chip[data-v-fef8aad2-s]{color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);flex:none}.status[data-v-fef8aad2]{display:inline-flex;align-items:center;flex:none}.status.ok[data-v-fef8aad2]{color:var(--color-success)}.status.error[data-v-fef8aad2]{color:var(--color-danger)}.bb[data-v-fef8aad2]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.bb.open[data-v-fef8aad2]{grid-template-rows:minmax(0,1fr)}.bb-pad[data-v-fef8aad2]{min-height:0;overflow:hidden;padding:var(--space-2) var(--space-3) var(--space-3);background:var(--color-surface-sunken);border-top:1px solid var(--color-line);color:var(--color-text);font:var(--text-sm)/1.65 var(--font-mono);white-space:pre-wrap;word-break:break-word}.box.mob[data-v-fef8aad2]{margin:0}.at-open[data-v-14ef8750]{flex:none;background:none;border:1px solid var(--color-line);border-radius:var(--radius-xs);color:var(--color-text-muted);font:var(--text-xs) var(--font-ui);padding:1px 7px;cursor:pointer}.at-open[data-v-14ef8750]:hover{color:var(--color-text);background:var(--color-surface-sunken)}.at-type[data-v-14ef8750]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);margin-bottom:6px}.at-task[data-v-14ef8750]{color:var(--color-text);white-space:pre-wrap;word-break:break-word}.at-task+.bb-code[data-v-14ef8750]{margin-top:10px}.bb-code[data-v-14ef8750]{padding:11px 13px;border:1px solid var(--color-line);border-radius:var(--radius-md)}.chip[data-v-a9a0f259]{color:var(--color-text-muted);font-size:var(--text-xs);flex:none}.au-dismissed[data-v-a9a0f259]{color:var(--color-text-muted);font:italic var(--text-sm)/var(--leading-normal) var(--font-ui)}.au-list[data-v-a9a0f259]{display:flex;flex-direction:column;font:var(--text-sm)/var(--leading-normal) var(--font-ui)}.au-block[data-v-a9a0f259]{padding:4px 0}.au-block+.au-block[data-v-a9a0f259]{margin-top:4px;padding-top:10px;border-top:1px dashed var(--color-line)}.au-q[data-v-a9a0f259]{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}.au-hdr[data-v-a9a0f259]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-sm);padding:0 6px;flex:none}.au-qtext[data-v-a9a0f259]{color:var(--color-text);font-weight:var(--weight-medium)}.au-opts[data-v-a9a0f259]{display:flex;flex-direction:column;gap:4px}.au-opt[data-v-a9a0f259]{display:flex;align-items:center;gap:8px;padding:5px 10px;border:1px solid var(--color-line);border-radius:var(--radius-md);color:var(--color-text-faint)}.au-opt.sel[data-v-a9a0f259]{border-color:var(--color-accent-bd);background:var(--color-accent-soft);color:var(--color-text)}.au-glyph[data-v-a9a0f259]{font:var(--text-base) var(--font-mono);color:var(--color-text-faint);width:14px;text-align:center;flex:none}.au-opt.sel .au-glyph[data-v-a9a0f259]{color:var(--color-accent-hover)}.au-label[data-v-a9a0f259]{color:inherit}.au-desc[data-v-a9a0f259]{color:var(--color-text-faint);font-size:var(--text-xs);margin-left:2px}.au-opt.sel .au-desc[data-v-a9a0f259]{color:var(--color-text-muted)}.au-raw[data-v-a9a0f259]{padding:11px 13px;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-raised);font:var(--text-sm)/1.65 var(--font-mono);white-space:pre-wrap;word-break:break-word}.tool-output-block[data-v-262bbea0]{margin-top:var(--space-2);padding:var(--space-3);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-raised)}.tool-output-block.scroll[data-v-262bbea0]{max-height:calc(var(--tool-output-visible-lines) * 1lh);overflow-y:auto;scrollbar-gutter:stable}.bb-empty[data-v-262bbea0]{color:var(--color-text-muted);font-style:italic}.chip[data-v-74e1da99]{color:var(--color-text-muted);font-size:var(--text-xs);flex:none}.bb-summary[data-v-74e1da99],.bb-summary[data-v-aa4edcb0]{color:var(--color-text);border-bottom:1px dashed var(--color-line);padding-bottom:6px;margin-bottom:6px;word-break:break-all}.chip[data-v-aa4edcb0]{color:var(--color-text-muted);font-size:var(--text-xs);flex:none}.media-tool[data-v-c05c114a]{display:inline-flex;flex-direction:column;gap:6px;max-width:320px}.media-title[data-v-c05c114a]{font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-image-button[data-v-c05c114a]{padding:0;border:none;background:transparent;cursor:pointer;border-radius:var(--radius-md);overflow:hidden}.media-image[data-v-c05c114a]{display:block;max-width:100%;border-radius:var(--radius-md);background:var(--media-alpha-canvas)}.media-video[data-v-c05c114a],.media-audio[data-v-c05c114a]{max-width:100%;border-radius:var(--radius-md)}.swarm-card[data-v-4b58e128]{margin:0;background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.swarm-card.err[data-v-4b58e128]{border-color:color-mix(in srgb,var(--color-danger) 25%,var(--bg))}.head[data-v-4b58e128]{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:0 11px;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;user-select:none}.head[data-v-4b58e128]:hover,.swarm-card.open>.head[data-v-4b58e128]{background:var(--color-surface-sunken);color:var(--color-text)}.swarm-card.err>.head[data-v-4b58e128]{background:color-mix(in srgb,var(--color-danger) 4%,var(--bg))}.swarm-card.err>.head[data-v-4b58e128]:hover{background:color-mix(in srgb,var(--color-danger) 7%,var(--bg))}.head[data-v-4b58e128]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.ic[data-v-4b58e128]{color:var(--color-text-faint);flex:none}.title[data-v-4b58e128]{font-weight:var(--weight-medium);color:var(--color-text);flex:none}.meta[data-v-4b58e128]{color:var(--color-text-faint);flex:none}.sum-txt[data-v-4b58e128]{color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.rt[data-v-4b58e128]{margin-left:auto;display:flex;align-items:center;gap:8px;flex:none;color:var(--color-text-muted);font-size:var(--text-xs)}.status[data-v-4b58e128]{display:inline-flex;align-items:center;flex:none}.status[data-v-4b58e128]:has(>svg){color:var(--color-success)}.err .status[data-v-4b58e128]:has(>svg){color:var(--color-danger)}.chip[data-v-4b58e128]{color:var(--color-text-muted);font-family:var(--font-mono)}.tm[data-v-4b58e128]{color:var(--color-text-faint);font-family:var(--font-mono)}.car[data-v-4b58e128]{margin-left:2px;color:var(--color-text-faint);flex:none}.body[data-v-4b58e128]{border-top:1px solid var(--color-line);background:var(--color-surface-sunken)}.overview[data-v-4b58e128]{padding:9px 11px 8px;border-bottom:1px solid color-mix(in srgb,var(--color-line) 70%,transparent)}.overview-line[data-v-4b58e128]{display:flex;align-items:baseline;gap:8px}.big[data-v-4b58e128]{font-family:var(--font-mono);font-weight:var(--weight-medium);color:var(--color-text);font-size:15px}.lbl[data-v-4b58e128]{color:var(--color-text-muted);font-size:var(--text-xs)}.seg[data-v-4b58e128]{display:flex;height:5px;border-radius:var(--radius-full);overflow:hidden;margin:8px 0 4px;gap:2px}.seg>span[data-v-4b58e128]{height:100%;border-radius:var(--radius-full);min-width:3px}.s-ok[data-v-4b58e128]{background:var(--color-success)}.s-run[data-v-4b58e128]{background:var(--color-accent)}.s-warn[data-v-4b58e128]{background:var(--color-warning)}.s-fail[data-v-4b58e128]{background:var(--color-danger)}.s-queue[data-v-4b58e128]{background:var(--color-line)}.legend[data-v-4b58e128]{display:flex;flex-wrap:wrap;gap:10px}.legend span[data-v-4b58e128]{display:inline-flex;align-items:center;gap:5px;font:var(--text-xs) var(--font-mono);color:var(--color-text-muted)}.lg-dot[data-v-4b58e128]{width:6px;height:6px;border-radius:var(--radius-full)}.member[data-v-4b58e128]{border-bottom:1px solid color-mix(in srgb,var(--color-line) 70%,transparent)}.member[data-v-4b58e128]:last-child{border-bottom:none}.member-head[data-v-4b58e128]{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:0 11px;border:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;user-select:none}.member-head[data-v-4b58e128]:hover,.member.open .member-head[data-v-4b58e128]{background:color-mix(in srgb,var(--color-surface) 55%,var(--bg))}.member-head[data-v-4b58e128]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.row-dot[data-v-4b58e128]{flex:none}.mname[data-v-4b58e128]{flex:none;min-width:0;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-medium);color:var(--color-text)}.mact[data-v-4b58e128]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font-size:var(--text-xs)}.mphase[data-v-4b58e128]{flex:none;margin-left:auto;font:var(--text-xs) var(--font-mono);color:var(--color-text-faint)}.phase-completed .mphase[data-v-4b58e128]{color:var(--color-success)}.phase-failed .mphase[data-v-4b58e128]{color:var(--color-danger)}.phase-working .mphase[data-v-4b58e128]{color:var(--color-accent)}.phase-suspended .mphase[data-v-4b58e128]{color:var(--color-warning)}.mcar[data-v-4b58e128]{margin-left:4px;color:var(--color-text-faint);flex:none}.member-body[data-v-4b58e128]{padding:4px 11px 10px 31px;color:var(--color-text-muted);font-size:var(--text-xs);line-height:1.65;white-space:pre-wrap;word-break:break-word}.waiting[data-v-4b58e128]{padding:6px 11px 10px;color:var(--color-text-muted);font-size:var(--text-xs)}.fallback-output[data-v-4b58e128]{padding:9px 11px 10px;color:var(--color-text);font:var(--text-xs)/1.6 var(--font-mono);white-space:pre-wrap;word-break:break-word}.tool-group[data-v-37eb334f]{display:flex;flex-direction:column;background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden}.tool-group-head[data-v-37eb334f]{display:flex;align-items:center;gap:8px;width:100%;height:32px;padding:0 11px;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;user-select:none}.tool-group-head[data-v-37eb334f]:hover{background:var(--color-surface-sunken);color:var(--color-text)}.tool-group-head[data-v-37eb334f]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.tg-ic[data-v-37eb334f]{color:var(--color-text-faint);flex:none}.tg-title[data-v-37eb334f]{font-weight:var(--weight-medium);color:var(--color-text)}.tg-meta[data-v-37eb334f]{color:var(--color-text-faint)}.tg-car[data-v-37eb334f]{margin-left:auto;color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.tool-group.open .tg-car[data-v-37eb334f]{transform:rotate(90deg)}.tool-group-body[data-v-37eb334f]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.tool-group-body.open[data-v-37eb334f]{grid-template-rows:minmax(0,1fr)}.tool-group-body-inner[data-v-37eb334f]{min-height:0;overflow:hidden;display:flex;flex-direction:column}:where(.markstream-vue) button{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:transparent;border:0;font:inherit;color:inherit}.markstream-vue li:has(.checkbox-node){list-style-type:none;margin-left:calc(-1 * var(--ms-flow-list-indent))}.markstream-vue .text-node{white-space:pre-wrap;overflow-wrap:break-word}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.markstream-vue .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.markstream-vue .pointer-events-none{pointer-events:none}.markstream-vue .\!visible{visibility:visible!important}.markstream-vue .visible{visibility:visible}.markstream-vue .collapse{visibility:collapse}.markstream-vue .static{position:static}.markstream-vue .fixed{position:fixed}.markstream-vue .absolute{position:absolute}.markstream-vue .relative{position:relative}.markstream-vue .inset-0{inset:0}.markstream-vue .right-2{right:8px}.markstream-vue .right-6{right:24px}.markstream-vue .top-2{top:8px}.markstream-vue .top-6{top:24px}.markstream-vue .z-10{z-index:10}.markstream-vue .z-50{z-index:50}.markstream-vue .m-0{margin:0}.markstream-vue .mx-0\.5{margin-left:2px;margin-right:2px}.markstream-vue .mr-2{margin-right:8px}.markstream-vue .mt-2{margin-top:8px}.markstream-vue .block{display:block}.markstream-vue .inline{display:inline}.markstream-vue .flex{display:flex}.markstream-vue .inline-flex{display:inline-flex}.markstream-vue .table{display:table}.markstream-vue .grid{display:grid}.markstream-vue .contents{display:contents}.markstream-vue .list-item{display:list-item}.markstream-vue .hidden{display:none}.markstream-vue .h-4{height:16px}.markstream-vue .h-full{height:100%}.markstream-vue .max-h-full{max-height:100%}.markstream-vue .min-h-full{min-height:100%}.markstream-vue .w-2\/3{width:66.666667%}.markstream-vue .w-4{width:16px}.markstream-vue .w-4\/5{width:80%}.markstream-vue .w-full{width:100%}.markstream-vue .min-w-\[160px\]{min-width:160px}.markstream-vue .max-w-full{max-width:100%}.markstream-vue .flex-1{flex:1 1 0%}.markstream-vue .flex-shrink{flex-shrink:1}.markstream-vue .flex-shrink-0{flex-shrink:0}.markstream-vue .shrink{flex-shrink:1}.markstream-vue .shrink-0{flex-shrink:0}.markstream-vue .border-collapse{border-collapse:collapse}.markstream-vue .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.markstream-vue .animate-spin{animation:spin 1s linear infinite}.markstream-vue .cursor-grab{cursor:grab}.markstream-vue .cursor-grabbing{cursor:grabbing}.markstream-vue .cursor-not-allowed{cursor:not-allowed}.markstream-vue .cursor-pointer{cursor:pointer}.markstream-vue .resize{resize:both}.markstream-vue .list-decimal{list-style-type:decimal}.markstream-vue .list-disc{list-style-type:disc}.markstream-vue .flex-wrap{flex-wrap:wrap}.markstream-vue .items-center{align-items:center}.markstream-vue .items-baseline{align-items:baseline}.markstream-vue .justify-center{justify-content:center}.markstream-vue .justify-between{justify-content:space-between}.markstream-vue .gap-0\.5{gap:2px}.markstream-vue .gap-1\.5{gap:6px}.markstream-vue .gap-2{gap:8px}.markstream-vue .gap-\[var\(--ms-gap-header-actions\)\]{gap:var(--ms-gap-header-actions)}.markstream-vue .gap-x-1{-moz-column-gap:4px;column-gap:4px}.markstream-vue .gap-x-2{-moz-column-gap:8px;column-gap:8px}.markstream-vue .overflow-hidden{overflow:hidden}.markstream-vue .overflow-x-auto{overflow-x:auto}.markstream-vue .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.markstream-vue .whitespace-nowrap{white-space:nowrap}.markstream-vue .whitespace-pre-wrap{white-space:pre-wrap}.markstream-vue .rounded{border-radius:calc(var(--ms-radius) * .5)}.markstream-vue .rounded-lg{border-radius:var(--ms-radius)}.markstream-vue .rounded-md{border-radius:calc(var(--ms-radius) * .75)}.markstream-vue .border{border-width:1px}.markstream-vue .border-b{border-bottom-width:1px}.markstream-vue .border-t{border-top-width:1px}.markstream-vue .border-\[var\(--code-border\)\]{border-color:var(--code-border)}.markstream-vue .border-\[var\(--footnote-border\)\]{border-color:var(--footnote-border)}.markstream-vue .border-\[var\(--hr-border\)\]{border-color:var(--hr-border)}.markstream-vue .bg-\[hsl\(var\(--ms-popover\)\)\]{background-color:hsl(var(--ms-popover))}.markstream-vue .bg-\[var\(--code-header-bg\)\]{background-color:var(--code-header-bg)}.markstream-vue .p-0{padding:0}.markstream-vue .p-1{padding:4px}.markstream-vue .p-4{padding:16px}.markstream-vue .p-\[var\(--ms-action-btn-padding\)\]{padding:var(--ms-action-btn-padding)}.markstream-vue .px-1\.5{padding-left:6px;padding-right:6px}.markstream-vue .px-2{padding-left:8px;padding-right:8px}.markstream-vue .px-4{padding-left:16px;padding-right:16px}.markstream-vue .px-\[var\(--ms-inset-panel-x\)\]{padding-left:var(--ms-inset-panel-x);padding-right:var(--ms-inset-panel-x)}.markstream-vue .py-0\.5{padding-top:2px;padding-bottom:2px}.markstream-vue .py-1\.5{padding-top:6px;padding-bottom:6px}.markstream-vue .py-\[var\(--ms-inset-panel-y\)\]{padding-top:var(--ms-inset-panel-y);padding-bottom:var(--ms-inset-panel-y)}.markstream-vue .pb-3{padding-bottom:12px}.markstream-vue .pt-2{padding-top:8px}.markstream-vue .text-left{text-align:left}.markstream-vue .text-center{text-align:center}.markstream-vue .text-right{text-align:right}.markstream-vue .font-mono{font-family:var(--ms-font-mono)}.markstream-vue .text-\[length\:var\(--ms-text-label\)\]{font-size:var(--ms-text-label)}.markstream-vue .text-sm{font-size:14px;line-height:20px}.markstream-vue .text-xs{font-size:12px;line-height:16px}.markstream-vue .font-medium{font-weight:500}.markstream-vue .font-semibold{font-weight:600}.markstream-vue .uppercase{text-transform:uppercase}.markstream-vue .lowercase{text-transform:lowercase}.markstream-vue .italic{font-style:italic}.markstream-vue .leading-\[normal\]{line-height:normal}.markstream-vue .leading-none{line-height:1}.markstream-vue .leading-relaxed{line-height:1.625}.markstream-vue .text-\[\#0366d6\]{--tw-text-opacity: 1;color:rgb(3 102 214 / var(--tw-text-opacity, 1))}.markstream-vue .text-\[hsl\(var\(--ms-popover-foreground\)\)\]{color:hsl(var(--ms-popover-foreground))}.markstream-vue .text-\[var\(--code-action-fg\)\]{color:var(--code-action-fg)}.markstream-vue .text-\[var\(--code-fg\)\]{color:var(--code-fg)}.markstream-vue .underline{text-decoration-line:underline}.markstream-vue .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.markstream-vue .opacity-0{opacity:0}.markstream-vue .opacity-50{opacity:.5}.markstream-vue .shadow-\[var\(--ms-shadow-popover\)\]{--tw-shadow-color: var(--ms-shadow-popover);--tw-shadow: var(--tw-shadow-colored)}.markstream-vue .outline{outline-style:solid}.markstream-vue .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.markstream-vue .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.markstream-vue .backdrop-blur{--tw-backdrop-blur: blur(8px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.markstream-vue .backdrop-filter{backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.markstream-vue .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.markstream-vue .transition-\[height\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.markstream-vue .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.markstream-vue .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.markstream-vue .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.markstream-vue .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.markstream-vue{--ms-background: 0 0% 100%;--ms-foreground: 0 0% 10%;--ms-muted: 0 0% 96.5%;--ms-muted-foreground: 0 0% 43%;--ms-secondary: 0 0% 93.5%;--ms-secondary-foreground: 0 0% 10%;--ms-accent: 0 0% 91%;--ms-accent-foreground: 0 0% 10%;--ms-primary: 0 0% 10%;--ms-primary-foreground: 0 0% 100%;--ms-destructive: 0 62% 52%;--ms-destructive-foreground: 0 0% 100%;--ms-border: 0 0% 87%;--ms-ring: 0 0% 10%;--ms-popover: 0 0% 100%;--ms-popover-foreground: 0 0% 10%;--ms-radius: 8px;--ms-info: 215 60% 50%;--ms-info-foreground: 0 0% 100%;--ms-success: 152 56% 39%;--ms-success-foreground: 0 0% 100%;--ms-warning: 38 64% 46%;--ms-warning-foreground: 0 0% 9%;--ms-diff-added: 152 50% 36%;--ms-diff-removed: 0 58% 48%;--ms-highlight: 50 60% 72%;--ms-highlight-foreground: 0 0% 0%;--ms-font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";--ms-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace}.dark .markstream-vue,.markstream-vue.dark{--ms-background: 0 0% 7%;--ms-foreground: 0 0% 93%;--ms-muted: 0 0% 12%;--ms-muted-foreground: 0 0% 60%;--ms-secondary: 0 0% 16%;--ms-secondary-foreground: 0 0% 93%;--ms-accent: 0 0% 24%;--ms-accent-foreground: 0 0% 93%;--ms-primary: 0 0% 93%;--ms-primary-foreground: 0 0% 10%;--ms-destructive: 0 60% 50%;--ms-destructive-foreground: 0 0% 93%;--ms-border: 0 0% 20%;--ms-ring: 0 0% 80%;--ms-popover: 0 0% 9%;--ms-popover-foreground: 0 0% 93%;--ms-info: 215 55% 62%;--ms-info-foreground: 0 0% 100%;--ms-success: 152 48% 55%;--ms-success-foreground: 0 0% 100%;--ms-warning: 32 65% 58%;--ms-warning-foreground: 0 0% 9%;--ms-diff-added: 152 42% 60%;--ms-diff-removed: 0 58% 58%;--ms-highlight: 48 65% 50%;--ms-highlight-foreground: 0 0% 0%;--ms-shadow-subtle: 0 1px 3px 0 hsl(0 0% 0% / .25);--ms-shadow-popover: 0 4px 6px -1px hsl(0 0% 0% / .2), 0 2px 4px -2px hsl(0 0% 0% / .15);--ms-shadow-modal: 0 10px 15px -3px hsl(0 0% 0% / .5), 0 4px 6px -4px hsl(0 0% 0% / .4);--ms-shadow-preview: 0 10px 40px hsl(0 0% 0% / .6);--tooltip-bg: hsl(0 0% 12%);--tooltip-fg: hsl(0 0% 72%);--code-header-bg: hsl(var(--ms-muted));--admonition-note-header-bg: color-mix(in srgb, hsl(var(--ms-info)) 12%, transparent);--admonition-tip-header-bg: color-mix(in srgb, hsl(var(--ms-success)) 12%, transparent);--admonition-warn-header-bg: color-mix(in srgb, hsl(var(--ms-warning)) 12%, transparent);--admonition-danger-header-bg: color-mix(in srgb, hsl(var(--ms-destructive)) 12%, transparent)}.markstream-vue{font-family:var(--ms-font-sans);font-size:var(--ms-text-body);line-height:var(--ms-leading-body);--inline-code-bg: hsl(var(--ms-secondary));--inline-code-fg: hsl(var(--ms-foreground) / .75);--inline-code-border: hsl(var(--ms-border) / .9);--code-bg: hsl(var(--ms-muted));--code-fg: hsl(var(--ms-foreground));--code-border: hsl(var(--ms-border));--code-header-bg: hsl(var(--ms-secondary));--code-selection-bg: hsl(var(--ms-accent) / .3);--code-line-number: hsl(var(--ms-muted-foreground));--markstream-code-line-number-align: right;--code-action-fg: hsl(var(--ms-muted-foreground));--code-action-hover-bg: hsl(var(--ms-accent));--code-action-hover-fg: hsl(var(--ms-accent-foreground));--code-action-active-bg: hsl(var(--ms-primary));--code-action-active-fg: hsl(var(--ms-primary-foreground));--diff-added-fg: hsl(var(--ms-diff-added));--diff-removed-fg: hsl(var(--ms-diff-removed));--diff-added-bg: hsl(var(--ms-diff-added) / .1);--diff-added-inline-bg: hsl(var(--ms-diff-added) / .2);--diff-removed-bg: hsl(var(--ms-diff-removed) / .1);--diff-removed-inline-bg: hsl(var(--ms-diff-removed) / .2);--blockquote-border: hsl(var(--ms-muted-foreground) / .2);--admonition-bg: hsl(var(--ms-muted));--admonition-border: hsl(var(--ms-border));--admonition-fg: hsl(var(--ms-foreground));--admonition-muted: hsl(var(--ms-muted-foreground));--admonition-header-bg: hsl(var(--ms-muted) / .5);--admonition-note: hsl(var(--ms-info));--admonition-tip: hsl(var(--ms-success));--admonition-warning: hsl(var(--ms-warning));--admonition-danger: hsl(var(--ms-destructive));--admonition-note-header-bg: color-mix(in srgb, hsl(var(--ms-info)) 6%, transparent);--admonition-tip-header-bg: color-mix(in srgb, hsl(var(--ms-success)) 6%, transparent);--admonition-warn-header-bg: color-mix(in srgb, hsl(var(--ms-warning)) 6%, transparent);--admonition-danger-header-bg: color-mix(in srgb, hsl(var(--ms-destructive)) 6%, transparent);--table-border: hsl(var(--ms-border));--table-header-bg: hsl(var(--ms-muted));--link-color: hsl(var(--ms-info));--list-marker: hsl(var(--ms-muted-foreground) / .5);--list-counter-marker: hsl(var(--ms-muted-foreground));--hr-border: hsl(var(--ms-border));--highlight-bg: hsl(var(--ms-highlight));--footnote-border: hsl(var(--ms-border));--tooltip-bg: hsl(0 0% 18%);--tooltip-fg: hsl(0 0% 88%);--tooltip-border: hsl(var(--ms-border));--modal-overlay: hsl(0 0% 0% / .7);--modal-bg: hsl(var(--ms-popover));--modal-fg: hsl(var(--ms-popover-foreground));--diagram-bg: hsl(var(--ms-muted));--diagram-border: hsl(var(--ms-border));--diagram-header-bg: hsl(var(--ms-muted));--loading-spinner: hsl(var(--ms-muted-foreground));--loading-shimmer: hsl(var(--ms-muted) / .5);--image-placeholder-bg: hsl(var(--ms-muted));--focus-ring: hsl(var(--ms-ring));--ms-space-1: 4px;--ms-space-1_5: 6px;--ms-space-2: 8px;--ms-space-2_5: 10px;--ms-space-3: 12px;--ms-space-4: 16px;--ms-space-5: 20px;--ms-space-6: 24px;--ms-space-8: 32px;--ms-space-12: 48px;--ms-flow-paragraph-y: 1.5em;--ms-flow-list-y: 1em;--ms-flow-list-item-y: .25em;--ms-flow-list-indent: 1.625em ;--ms-flow-list-indent-mobile: calc(14 / 9 * 1em);--ms-flow-table-y: 2em;--ms-flow-table-cell: .5em .75em;--ms-flow-blockquote-y: 1.25em;--ms-flow-blockquote-indent: 1.25em;--ms-flow-admonition-y: 1.25em;--ms-flow-footnote-y: .5em;--ms-flow-hr-y: 2.5em;--ms-flow-diagram-y: 1.5em;--ms-flow-codeblock-y: 1.5em;--ms-flow-definition-term-mt: .75em;--ms-flow-definition-desc-ml: 1.25em;--ms-flow-definition-desc-mb: .5em;--ms-flow-heading-1-mt: 0;--ms-flow-heading-1-mb: 1em;--ms-flow-heading-2-mt: 2em;--ms-flow-heading-2-mb: .75em;--ms-flow-heading-3-mt: 1.5em;--ms-flow-heading-3-mb: .6em;--ms-flow-heading-4-mt: 1.25em;--ms-flow-heading-4-mb: .4em;--ms-flow-heading-5-mt: 1em;--ms-flow-heading-5-mb: .25em;--ms-flow-heading-6-mt: 1em;--ms-flow-heading-6-mb: .25em;--ms-text-body: 16px;--ms-leading-body: 1.75;--ms-text-h1: 36px;--ms-text-h2: 24px;--ms-text-h3: 20px;--ms-text-h4: 16px;--ms-text-h5: 16px;--ms-text-h6: 16px;--ms-leading-h1: 1.2;--ms-leading-h2: 1.35;--ms-leading-h3: 1.5;--ms-weight-h1: 700;--ms-weight-h2: 600;--ms-weight-h3: 600;--ms-weight-h4: 600;--ms-text-label: 12px;--ms-action-btn-padding: 6px;--ms-action-btn-icon: 14px;--ms-inset-panel-x: 10px;--ms-inset-panel-y: 6px;--ms-inset-panel-body-sm: 8px;--ms-inset-panel-body: 16px;--ms-inset-admonition-body-top: 8px;--ms-inset-admonition-body-bottom: 12px;--ms-gap-header: var(--ms-space-4);--ms-gap-header-main: var(--ms-space-2_5);--ms-gap-header-actions: var(--ms-space-2);--ms-shadow-subtle: 0 1px 3px 0 hsl(var(--ms-foreground) / .06);--ms-shadow-popover: 0 4px 6px -1px hsl(var(--ms-foreground) / .1), 0 2px 4px -2px hsl(var(--ms-foreground) / .1);--ms-shadow-modal: 0 10px 15px -3px hsl(var(--ms-foreground) / .1), 0 4px 6px -4px hsl(var(--ms-foreground) / .1);--ms-shadow-preview: 0 10px 40px hsl(var(--ms-foreground) / .25);--ms-duration-fast: .12s;--ms-duration-standard: .18s;--ms-duration-overlay: .2s;--ms-duration-emphasis: .22s;--ms-duration-slow: .3s;--ms-duration-stream: .28s;--ms-ease-linear: linear;--ms-ease-standard: ease;--ms-ease-out: ease-out;--ms-ease-in-out: ease-in-out;--ms-ease-spring: cubic-bezier(.16, 1, .3, 1);--ms-border-width: 1px;--ms-border-width-strong: 4px;--ms-focus-ring-width: 2px;--ms-focus-ring-offset: 2px;--ms-size-diagram-min-height: 360px;--ms-size-code-max-height: 500px;--ms-size-image-max-width: 384px;--ms-size-image-min-width: 128px;--ms-size-image-min-height: 1.5em;--ms-size-math-min-height: 40px;--ms-size-skeleton-min-height: 120px}body>div[id^=dmermaid-]{position:fixed;top:-10000px;left:0;width:100%;visibility:hidden;pointer-events:none}.markstream-vue .hover\:bg-\[var\(--code-action-hover-bg\)\]:hover{background-color:var(--code-action-hover-bg)}.markstream-vue .hover\:text-\[var\(--code-action-hover-fg\)\]:hover{color:var(--code-action-hover-fg)}.markstream-vue .hover\:underline:hover{text-decoration-line:underline}.markstream-vue .active\:scale-\[0\.96\]:active{--tw-scale-x: .96;--tw-scale-y: .96;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.markstream-vue .disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.markstream-vue .disabled\:opacity-40:disabled{opacity:.4}.checkbox-node[data-v-be21ab83]{display:inline-flex;align-items:center;margin-right:.5em;vertical-align:-.15em}.checkbox-icon[data-v-be21ab83]{flex-shrink:0}.checkbox-unchecked[data-v-be21ab83]{color:hsl(var(--ms-muted-foreground) / .5)}.checkbox-checked[data-v-be21ab83]{color:hsl(var(--ms-info))}.emoji-node[data-v-de55dc97]{display:inline-block}.footnote-reference[data-v-c1463a29]{font-size:.75em;line-height:0}.footnote-link[data-v-c1463a29]{color:var(--link-color);text-decoration:none}.footnote-link[data-v-c1463a29]:hover{text-decoration:underline}.html-inline-node[data-v-d17f12b0]{display:inline}.html-inline-node--loading[data-v-d17f12b0]{opacity:.85}.inline-code[data-v-1b73ee4e]{display:inline;font-family:var(--ms-font-mono);font-size:.8125em;line-height:inherit;color:var(--inline-code-fg);background-color:var(--inline-code-bg);padding:.15em .35em;border-radius:.25em;white-space:normal;word-break:break-word;max-width:100%;-webkit-box-decoration-break:clone;box-decoration-break:clone}.inline-code-stream-delta[data-v-1b73ee4e]{animation-duration:var(--stream-update-fade-duration, var(--fade-duration, .28s));animation-timing-function:var(--stream-update-fade-ease, var(--fade-ease, cubic-bezier(.33, 0, .67, 1)));animation-fill-mode:both;will-change:opacity}.inline-code-stream-delta--a[data-v-1b73ee4e]{animation-name:inline-code-stream-update-fade-a-1b73ee4e}.inline-code-stream-delta--b[data-v-1b73ee4e]{animation-name:inline-code-stream-update-fade-b-1b73ee4e}@keyframes inline-code-stream-update-fade-a-1b73ee4e{0%{opacity:0}to{opacity:1}}@keyframes inline-code-stream-update-fade-b-1b73ee4e{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.inline-code-stream-delta[data-v-1b73ee4e]{animation:none!important}}.image-node-container[data-v-cbb5c63e]{display:inline-block;position:relative;vertical-align:middle;max-width:var(--ms-size-image-max-width)}.image-node__img[data-v-cbb5c63e]{display:inline-block;max-width:100%;min-width:var(--ms-size-image-min-width);min-height:var(--ms-size-image-min-height);height:auto;vertical-align:middle;transition:opacity var(--ms-duration-emphasis) var(--ms-ease-standard)}.image-node__img.is-loading[data-v-cbb5c63e]{opacity:0}.image-node__img.is-loaded[data-v-cbb5c63e]{opacity:1}.image-node__img.has-natural-size[data-v-cbb5c63e]{min-width:0;min-height:0}.image-placeholder[data-v-cbb5c63e]{display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:var(--ms-size-image-min-width);min-height:128px;max-width:var(--ms-size-image-max-width);background:hsl(var(--ms-muted));overflow:hidden;vertical-align:middle}.image-shimmer-overlay[data-v-cbb5c63e]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:hsl(var(--ms-muted));overflow:hidden}.image-shimmer-overlay .image-shimmer[data-v-cbb5c63e]{width:100%;height:100%}.image-shimmer[data-v-cbb5c63e]{display:block;width:100%;height:100%;min-height:128px;background:linear-gradient(90deg,hsl(var(--ms-muted)),hsl(var(--ms-muted-foreground) / .06),hsl(var(--ms-muted)));background-size:200% 100%;animation:image-shimmer-cbb5c63e 1.5s ease-in-out infinite}@keyframes image-shimmer-cbb5c63e{0%{background-position:100% 0}to{background-position:-100% 0}}.image-error[data-v-cbb5c63e]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:16px 24px;min-height:64px;max-width:var(--ms-size-image-max-width);background:hsl(var(--ms-muted));color:hsl(var(--ms-muted-foreground));font-size:var(--ms-text-label);vertical-align:middle}.image-node__raw-text[data-v-cbb5c63e]{font-size:var(--ms-text-label);color:hsl(var(--ms-muted-foreground))}.shimmer-fade-leave-active[data-v-cbb5c63e]{transition:opacity var(--ms-duration-emphasis) var(--ms-ease-standard)}.shimmer-fade-leave-to[data-v-cbb5c63e]{opacity:0}@media(prefers-reduced-motion:reduce){.image-shimmer[data-v-cbb5c63e]{animation:none!important}.shimmer-fade-leave-active[data-v-cbb5c63e]{transition:none!important}}.markstream-vue pre[class^=language-],.markstream-vue pre[class*=" language-"]{white-space:pre;overflow:auto;-moz-tab-size:2;-o-tab-size:2;tab-size:2;font-variant-ligatures:none;contain:content;backface-visibility:hidden;transform:translateZ(0);-webkit-font-smoothing:antialiased}.markstream-vue pre[class^=language-]>code,.markstream-vue pre[class*=" language-"]>code{display:block}.markstream-vue pre.markstream-pre--line-numbers{position:relative}.markstream-vue pre.markstream-pre--line-numbers>.markstream-pre__line-numbers{position:absolute;top:var(--markstream-pre-line-number-top, 0);left:0;box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-end;width:var( --markstream-pre-line-number-width, calc(var(--markstream-code-padding-left, 52px) - var(--markstream-code-padding-x, 12px)) );padding-right:var(--markstream-pre-line-number-gap, 12px);color:var(--code-line-number);font:inherit;font-variant-numeric:tabular-nums;line-height:inherit;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.markstream-vue pre.markstream-pre--line-numbers>.markstream-pre__line-numbers>.markstream-pre__line-number{display:block;min-height:1lh}.markstream-vue pre.markstream-pre--diff-preview{box-sizing:border-box;padding-left:0;padding-right:0;width:100%;--markstream-pre-diff-gutter-marker-width: var(--stream-monaco-gutter-marker-width, 4px);--markstream-pre-diff-gutter-gap: var(--stream-monaco-gutter-gap, 8px);--markstream-pre-diff-line-number-width: var(--stream-monaco-line-number-width, 28px);--markstream-pre-diff-scrollable-left: var( --stream-monaco-original-scrollable-left, calc( var(--markstream-pre-diff-gutter-marker-width) + (var(--markstream-pre-diff-gutter-gap) * 2) + var(--markstream-pre-diff-line-number-width) ) );--markstream-pre-diff-line-number-gap-to-code: var( --stream-monaco-original-line-number-gap-to-code, var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-gutter-gap)) );--markstream-pre-diff-line-number-left: calc( var(--markstream-pre-diff-scrollable-left) - var(--markstream-pre-diff-line-number-gap-to-code) - var(--markstream-pre-diff-line-number-width) );--markstream-pre-diff-line-number-align: var(--markstream-diff-line-number-align, right)}.markstream-vue pre.markstream-pre--diff-preview.is-wrap{white-space:pre-wrap;overflow-wrap:anywhere}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline{--markstream-pre-diff-scrollable-left: var( --stream-monaco-modified-scrollable-left, var(--stream-monaco-original-scrollable-left) );--markstream-pre-diff-line-number-gap-to-code: var( --stream-monaco-modified-line-number-gap-to-code, var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-gutter-gap)) );--markstream-pre-diff-line-number-left: calc( var(--markstream-pre-diff-scrollable-left) - var(--markstream-pre-diff-line-number-gap-to-code) - var(--markstream-pre-diff-line-number-width) )}.markstream-vue pre.markstream-pre--diff-preview>.markstream-pre__diff-code{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);font:inherit;line-height:inherit;min-width:100%;width:100%}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline>.markstream-pre__diff-code{grid-template-columns:minmax(0,1fr)}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline:not(.is-wrap)>.markstream-pre__diff-code{grid-template-columns:max-content;width:-moz-max-content;width:max-content}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-pane{min-width:0;overflow:hidden}.markstream-vue pre.markstream-pre--diff-preview:not(.is-wrap):not(.markstream-pre--diff-inline) .markstream-pre__diff-pane{overflow-x:auto;overflow-y:hidden}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline:not(.is-wrap) .markstream-pre__diff-pane{min-width:-moz-max-content;min-width:max-content;overflow:visible}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-pane--modified{--markstream-pre-diff-scrollable-left: var( --stream-monaco-modified-scrollable-left, var(--stream-monaco-original-scrollable-left) );--markstream-pre-diff-line-number-gap-to-code: var( --stream-monaco-modified-line-number-gap-to-code, var(--stream-monaco-line-number-gap-to-code, var(--markstream-pre-diff-gutter-gap)) );--markstream-pre-diff-line-number-left: calc( var(--markstream-pre-diff-scrollable-left) - var(--markstream-pre-diff-line-number-gap-to-code) - var(--markstream-pre-diff-line-number-width) );box-shadow:inset 1px 0 var(--markstream-diff-pane-divider, hsl(var(--ms-border)))}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline .markstream-pre__diff-pane--modified{box-shadow:none}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line{position:relative;display:block;box-sizing:border-box;min-height:var( --markstream-pre-diff-synced-row-height, var(--markstream-pre-diff-line-height, 18px) );padding-left:var(--markstream-pre-diff-scrollable-left);line-height:var(--markstream-pre-diff-line-height, 18px)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line:before{content:"";position:absolute;inset-inline:0;top:0;height:var( --markstream-pre-diff-content-height, var(--markstream-pre-diff-line-height, 18px) );z-index:0;pointer-events:none;background:transparent}.markstream-vue pre.markstream-pre--diff-preview.markstream-pre--diff-inline .markstream-pre__diff-line:after{content:"";position:absolute;top:0;left:var(--markstream-pre-diff-scrollable-left);width:1px;height:var( --markstream-pre-diff-content-height, var(--markstream-pre-diff-line-height, 18px) );z-index:1;pointer-events:none;background:var(--stream-monaco-pane-divider, var(--markstream-diff-pane-divider, hsl(var(--ms-border))))}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-rail{position:absolute;z-index:2;top:0;left:0;height:var( --markstream-pre-diff-content-height, var(--markstream-pre-diff-line-height, 18px) );width:var(--markstream-pre-diff-gutter-marker-width, 4px);min-width:var(--markstream-pre-diff-gutter-marker-width, 4px)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-number{position:absolute;z-index:1;top:0;left:var(--markstream-pre-diff-line-number-left);width:var(--markstream-pre-diff-line-number-width);color:var(--code-line-number);font-variant-numeric:tabular-nums;line-height:var(--markstream-pre-diff-line-height, 18px);text-align:var(--markstream-pre-diff-line-number-align, right);-webkit-user-select:none;-moz-user-select:none;user-select:none}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-content{position:relative;z-index:1;display:block;min-width:-moz-max-content;min-width:max-content;line-height:var(--markstream-pre-diff-line-height, 18px);white-space:inherit;overflow-wrap:normal;word-break:normal;line-break:auto}.markstream-vue pre.markstream-pre--diff-preview.is-wrap .markstream-pre__diff-content{min-width:0;overflow-wrap:inherit}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-content-inner{white-space:inherit;overflow-wrap:inherit;word-break:inherit;line-break:inherit;-webkit-box-decoration-break:clone;box-decoration-break:clone}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--added{color:var(--stream-monaco-added-fg, inherit)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--removed{color:var(--stream-monaco-removed-fg, inherit)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--hunk{color:var(--stream-monaco-unchanged-fg, var(--code-line-number))}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--hunk:before{background:var(--stream-monaco-unchanged-bg, transparent)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--added:before{background:var(--stream-monaco-added-line-fill, transparent)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--removed:before{background:var(--stream-monaco-removed-line-fill, transparent)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--added>.markstream-pre__diff-rail{background:var(--stream-monaco-added-gutter, currentColor)}.markstream-vue pre.markstream-pre--diff-preview .markstream-pre__diff-line--removed>.markstream-pre__diff-rail{background:var(--stream-monaco-removed-gutter, currentColor)}.markstream-vue pre[class^=language-]:focus,.markstream-vue pre[class*=" language-"]:focus{outline:var(--ms-focus-ring-width) solid var(--focus-ring);outline-offset:var(--ms-focus-ring-offset)}.text-node[data-v-aae85f13]{display:inline;font-weight:inherit;vertical-align:baseline}.text-node-center[data-v-aae85f13]{display:inline-flex;justify-content:center;width:100%}.text-node-stream-delta[data-v-aae85f13]{animation-duration:var(--stream-update-fade-duration, var(--fade-duration, .28s));animation-timing-function:var(--stream-update-fade-ease, var(--fade-ease, cubic-bezier(.33, 0, .67, 1)));animation-fill-mode:both;will-change:opacity}.text-node-stream-delta--a[data-v-aae85f13]{animation-name:text-node-stream-update-fade-a-aae85f13}.text-node-stream-delta--b[data-v-aae85f13]{animation-name:text-node-stream-update-fade-b-aae85f13}@keyframes text-node-stream-update-fade-a-aae85f13{0%{opacity:0}to{opacity:1}}@keyframes text-node-stream-update-fade-b-aae85f13{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.text-node-stream-delta[data-v-aae85f13]{animation:none!important}}.reference-node[data-v-775c65e4]{background-color:hsl(var(--ms-muted));color:hsl(var(--ms-muted-foreground))}.reference-node[data-v-775c65e4]:hover{background-color:hsl(var(--ms-secondary))}.superscript-node[data-v-24160b22]{font-size:.8em;vertical-align:super}.subscript-node[data-v-197fa13b]{font-size:.8em;vertical-align:sub}.strong-node[data-v-a8647104]{font-weight:700}.strikethrough-node[data-v-b7a531fa]{text-decoration:line-through}.link-node[data-v-367e6ca4]{color:var(--link-color);text-decoration:none}.link-node[data-v-367e6ca4]:hover{text-decoration:underline;text-underline-offset:3.2px}.link-loading .link-text-wrapper[data-v-367e6ca4]{position:relative}.link-loading[data-v-367e6ca4]{color:var(--link-color)}.link-loading .link-text[data-v-367e6ca4]{position:relative;z-index:2}.link-loading-indicator[data-v-367e6ca4]{position:absolute;left:0;right:0;height:var(--underline-height, 2px);bottom:var(--underline-bottom, -3px);background:currentColor;border-radius:999px;will-change:opacity;opacity:var(--underline-rest-opacity, .18);animation:underlinePulse-367e6ca4 var(--underline-duration, 1.6s) var(--underline-timing, ease-in-out) var(--underline-iteration, infinite)}@keyframes underlinePulse-367e6ca4{0%,to{opacity:var(--underline-rest-opacity, .18)}50%{opacity:var(--underline-opacity, .35)}}@media(prefers-reduced-motion:reduce){.link-loading-indicator[data-v-367e6ca4]{animation:none;opacity:var(--underline-rest-opacity, .18)}}.insert-node[data-v-1e2c29d4]{text-decoration:underline}.highlight-node[data-v-7a62982a]{background-color:var(--highlight-bg);padding:0 3.2px;border-radius:.2em}.emphasis-node[data-v-2a5aafbf]{font-style:italic}.hard-break[data-v-50c58f70]{display:block}.blockquote[data-v-abfecebc]{font-weight:400;font-style:normal;color:var(--blockquote-fg, hsl(var(--ms-muted-foreground)));border-left:3px solid var(--blockquote-border);margin-top:var(--ms-flow-blockquote-y);margin-bottom:var(--ms-flow-blockquote-y);padding-left:var(--ms-flow-blockquote-indent)}.blockquote>.paragraph-node[data-v-abfecebc]{font-size:var(--ms-text-body);line-height:var(--ms-leading-body);margin:var(--ms-flow-paragraph-y) 0}.blockquote>.paragraph-node[data-v-abfecebc]:first-child{margin-top:0}.blockquote>.paragraph-node[data-v-abfecebc]:last-child{margin-bottom:0}.blockquote[data-v-abfecebc] .markdown-renderer{content-visibility:visible;contain:content;contain-intrinsic-size:0px 0px}.definition-list[data-v-4e103b30]{margin:0 0 16px}.definition-term[data-v-4e103b30]{font-weight:600;margin-top:var(--ms-flow-definition-term-mt)}.definition-desc[data-v-4e103b30]{margin-left:var(--ms-flow-definition-desc-ml);margin-bottom:var(--ms-flow-definition-desc-mb)}.definition-list[data-v-4e103b30] .markdown-renderer{content-visibility:visible;contain:content;contain-intrinsic-size:0px 0px}.footnote-anchor[data-v-e1eb37b6]{margin-left:8px;color:var(--link-color)}.footnote-node{margin-top:var(--ms-flow-footnote-y);margin-bottom:var(--ms-flow-footnote-y)}.markstream-vue [class*=footnote-] .markdown-renderer,.markstream-vue .flex-1 .markdown-renderer{content-visibility:visible;contain:content;contain-intrinsic-size:0px 0px}.heading-node[data-v-7122dbe1]{font-weight:500;line-height:1.25}hr+.heading-node[data-v-7122dbe1]{margin-top:0}.heading-1[data-v-7122dbe1]{font-size:var(--ms-text-h1);line-height:var(--ms-leading-h1);font-weight:var(--ms-weight-h1);margin-top:var(--ms-flow-heading-1-mt);margin-bottom:var(--ms-flow-heading-1-mb)}.heading-2[data-v-7122dbe1]{font-size:var(--ms-text-h2);line-height:var(--ms-leading-h2);font-weight:var(--ms-weight-h2);margin-top:var(--ms-flow-heading-2-mt);margin-bottom:var(--ms-flow-heading-2-mb)}.heading-3[data-v-7122dbe1]{font-size:var(--ms-text-h3);line-height:var(--ms-leading-h3);font-weight:var(--ms-weight-h3);margin-top:var(--ms-flow-heading-3-mt);margin-bottom:var(--ms-flow-heading-3-mb)}.heading-4[data-v-7122dbe1]{font-size:var(--ms-text-h4);font-weight:var(--ms-weight-h4);margin-top:var(--ms-flow-heading-4-mt);margin-bottom:var(--ms-flow-heading-4-mb)}.heading-5[data-v-7122dbe1]{font-size:var(--ms-text-h5);margin-top:var(--ms-flow-heading-5-mt);margin-bottom:var(--ms-flow-heading-5-mb)}.heading-6[data-v-7122dbe1]{font-size:var(--ms-text-h6);margin-top:var(--ms-flow-heading-6-mt);margin-bottom:var(--ms-flow-heading-6-mb)}.list-item[data-v-617214f9]{margin:var(--ms-flow-list-item-y) 0;padding-left:var(--ms-space-1_5)}ol>.list-item[data-v-617214f9]::marker{color:var(--list-counter-marker);line-height:1.6}ul>.list-item[data-v-617214f9]::marker{color:var(--list-marker)}.list-item>.paragraph-node[data-v-617214f9]{font-size:var(--ms-text-body);line-height:var(--ms-leading-body);margin:0}.list-item[data-v-617214f9] .markdown-renderer{content-visibility:visible;contain-intrinsic-size:0px 0px;contain:content}.list-node[data-v-99cb95e0]{margin-top:var(--ms-flow-list-y);margin-bottom:var(--ms-flow-list-y);padding-left:var(--ms-flow-list-indent)}.list-decimal[data-v-99cb95e0]{list-style-type:decimal}.list-disc[data-v-99cb95e0]{list-style-type:disc}@media(max-width:1023px){.list-disc[data-v-99cb95e0]{margin-top:calc(4/3*1em);margin-bottom:calc(4/3*1em);padding-left:var(--ms-flow-list-indent-mobile)}}.html-block-node__raw[data-v-f1744dfb]{white-space:pre-wrap;overflow-wrap:anywhere;opacity:.85}.html-block-node__placeholder[data-v-f1744dfb]{display:flex;flex-direction:column;gap:5.6px;padding:8px 0}.html-block-node__placeholder-bar[data-v-f1744dfb]{display:block;height:12.8px;border-radius:9999px;background-image:linear-gradient(90deg,var(--loading-shimmer),transparent,var(--loading-shimmer));background-size:200% 100%;animation:html-block-node-shimmer-f1744dfb 1.2s ease infinite}@keyframes html-block-node-shimmer-f1744dfb{0%{background-position:0% 0%}to{background-position:200% 0%}}.paragraph-node[data-v-c59ff506]{font-size:var(--ms-text-body);line-height:var(--ms-leading-body);margin:var(--ms-flow-paragraph-y) 0}li .paragraph-node[data-v-c59ff506]{margin:0}.table-node-wrapper[data-v-39f87b5d]{position:relative;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;overscroll-behavior-y:auto;scrollbar-gutter:stable}.table-node[data-v-39f87b5d]{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;margin:var(--ms-flow-table-y) 0;font-size:inherit;border:1px solid var(--table-border);border-radius:var(--ms-radius);overflow:hidden;box-shadow:var(--ms-shadow-subtle)}.table-node[data-v-39f87b5d] th,.table-node[data-v-39f87b5d] td{border-bottom:1px solid var(--table-border);border-right:1px solid var(--table-border);padding:var(--ms-flow-table-cell);white-space:normal;overflow-wrap:break-word;word-break:normal}.table-node[data-v-39f87b5d] th:last-child,.table-node[data-v-39f87b5d] td:last-child{border-right:none}.table-node[data-v-39f87b5d] tbody tr:last-child td{border-bottom:none}.table-node[data-v-39f87b5d] thead th{position:relative;font-weight:600;background-color:var(--table-header-bg);border-bottom-width:2px}.table-node__resize-handle[data-v-39f87b5d]{position:absolute;top:0;right:-4px;bottom:0;z-index:1;width:8px;padding:0;border:0;background:transparent;cursor:col-resize;touch-action:none}.table-node__resize-handle[data-v-39f87b5d]:after{content:"";position:absolute;top:.35em;bottom:.35em;left:50%;width:2px;border-radius:9999px;background:color-mix(in srgb,var(--table-border) 45%,hsl(var(--ms-foreground)));opacity:0;transform:translate(-50%);transition:opacity var(--ms-duration-fast) var(--ms-ease-standard)}.table-node__resize-handle[data-v-39f87b5d]:hover:after,.table-node__resize-handle[data-v-39f87b5d]:focus-visible:after{opacity:1}.table-node[data-v-39f87b5d] tbody tr:nth-child(2n){background-color:hsl(var(--ms-muted) / .35)}.table-node[data-v-39f87b5d] tbody tr:hover{background-color:var(--code-action-hover-bg)}.table-node--loading tbody td[data-v-39f87b5d]{position:relative;overflow:hidden}.table-node--loading tbody td[data-v-39f87b5d]>*{visibility:hidden}.table-node--loading tbody td[data-v-39f87b5d]:after{content:"";position:absolute;inset:0;border-radius:calc(var(--ms-radius) * .5);background:linear-gradient(90deg,var(--loading-shimmer) 25%,var(--loading-shimmer) 50%,var(--loading-shimmer) 75%);background-size:200% 100%;animation:table-node-shimmer-39f87b5d 1.2s linear infinite;will-change:background-position}.table-node__loading[data-v-39f87b5d]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}.table-node__spinner[data-v-39f87b5d]{width:40px;height:40px;border-radius:9999px;border:2px solid color-mix(in srgb,var(--loading-spinner) 25%,transparent);border-top-color:color-mix(in srgb,var(--loading-spinner) 80%,transparent);will-change:transform}.table-node-fade-enter-active[data-v-39f87b5d],.table-node-fade-leave-active[data-v-39f87b5d]{transition:opacity var(--ms-duration-standard) var(--ms-ease-standard)}.table-node-fade-enter-from[data-v-39f87b5d],.table-node-fade-leave-to[data-v-39f87b5d]{opacity:0}[data-v-39f87b5d] .table-node .markdown-renderer{display:contents;content-visibility:visible;contain:content;contain-intrinsic-size:0px 0px}[data-v-39f87b5d] .table-node .markdown-renderer .node-slot,[data-v-39f87b5d] .table-node .markdown-renderer .node-content,[data-v-39f87b5d] .table-node .markdown-renderer .node-space{display:contents}[data-v-39f87b5d] .table-node .text-node,[data-v-39f87b5d] .table-node code{white-space:inherit;overflow-wrap:inherit;word-break:inherit;max-width:none}@keyframes table-node-shimmer-39f87b5d{0%{background-position:0% 0%}50%{background-position:100% 0%}to{background-position:200% 0%}}.hr+.table-node-wrapper[data-v-39f87b5d]{margin-top:0}.hr+.table-node-wrapper .table-node[data-v-39f87b5d]{margin-top:0}.sr-only[data-v-39f87b5d]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.hr-node[data-v-39b2349c]{border-top-width:1px;border-color:var(--hr-border);margin:var(--ms-flow-hr-y) 0}.vmr-container[data-v-911e41c4]{margin-top:16px;margin-bottom:16px;border-radius:var(--ms-radius);border-width:1px;padding:16px;border-left-width:var(--ms-border-width-strong)}.markdown-renderer[data-v-2e8e6e17]{position:relative;contain:layout;content-visibility:auto;contain-intrinsic-size:800px 600px}.markdown-renderer.virtualized[data-v-2e8e6e17],.markdown-renderer.virtual-scroll-coordinated[data-v-2e8e6e17]{content-visibility:visible;contain-intrinsic-size:auto}.height-estimation-probes[data-v-2e8e6e17]{position:absolute;left:-100000px;top:0;visibility:hidden;pointer-events:none;overflow:hidden;z-index:-1}.node-slot[data-v-2e8e6e17],.node-content[data-v-2e8e6e17]{width:100%}.markdown-renderer.virtualized .node-slot[data-v-2e8e6e17],.markdown-renderer.virtualized .node-content[data-v-2e8e6e17],.markdown-renderer.virtual-scroll-coordinated .node-slot[data-v-2e8e6e17],.markdown-renderer.virtual-scroll-coordinated .node-content[data-v-2e8e6e17]{display:flow-root}.node-placeholder[data-v-2e8e6e17]{width:100%;min-height:16px;margin:4px 0;border-radius:var(--ms-radius);background-image:linear-gradient(90deg,var(--loading-shimmer),transparent,var(--loading-shimmer));background-size:200% 100%;animation:node-placeholder-shimmer-2e8e6e17 1.1s ease-in-out infinite}.node-placeholder[data-v-2e8e6e17]:first-child{margin-top:0}@keyframes node-placeholder-shimmer-2e8e6e17{0%{background-position:200% 0%}to{background-position:-200% 0%}}.node-spacer[data-v-2e8e6e17]{width:100%}.unknown-node[data-v-2e8e6e17]{color:hsl(var(--ms-muted-foreground));font-style:italic;margin:var(--ms-flow-paragraph-y) 0}.typewriter-cursor[data-v-2e8e6e17]{position:absolute;left:0;top:0;display:inline-block;width:.55em;height:1em;margin-left:.08em;vertical-align:-.12em;border-right:2px solid currentColor;pointer-events:none;visibility:hidden;animation:typewriter-cursor-blink-2e8e6e17 1s steps(1,end) infinite}@keyframes typewriter-cursor-blink-2e8e6e17{0%,49%{opacity:1}50%,to{opacity:0}}.markstream-vue .fade-enter-from{opacity:0}.markstream-vue .fade-enter-active{transition:opacity var(--fade-duration, .28s) var(--fade-ease, cubic-bezier(.33, 0, .67, 1));will-change:opacity}.markstream-vue .fade-enter-to{opacity:1}.admonition[data-v-a83480e1]{position:relative;margin:var(--ms-flow-admonition-y) 0;padding:.25em .75em .375em;border:1px solid var(--admonition-border);border-radius:var(--ms-radius);color:var(--admonition-fg)}.admonition-legend[data-v-a83480e1]{position:absolute;top:0;left:.75em;transform:translateY(-50%);display:inline-flex;align-items:center;gap:.35em;padding:0 .5em;background-color:hsl(var(--ms-background));font-size:13px;font-weight:600;line-height:1}.admonition-icon[data-v-a83480e1]{flex-shrink:0}.admonition-title[data-v-a83480e1]{white-space:nowrap}.admonition-content[data-v-a83480e1]{padding-top:.25em;color:var(--admonition-fg)}.admonition-note[data-v-a83480e1],.admonition-info[data-v-a83480e1]{border-color:hsl(var(--ms-info) / .3);background-color:hsl(var(--ms-info) / .04)}.admonition-note .admonition-legend[data-v-a83480e1],.admonition-info .admonition-legend[data-v-a83480e1]{color:var(--admonition-note)}.admonition-tip[data-v-a83480e1]{border-color:hsl(var(--ms-success) / .3);background-color:hsl(var(--ms-success) / .04)}.admonition-tip .admonition-legend[data-v-a83480e1]{color:var(--admonition-tip)}.admonition-warning[data-v-a83480e1],.admonition-caution[data-v-a83480e1]{border-color:hsl(var(--ms-warning) / .3);background-color:hsl(var(--ms-warning) / .04)}.admonition-warning .admonition-legend[data-v-a83480e1],.admonition-caution .admonition-legend[data-v-a83480e1]{color:var(--admonition-warning)}.admonition-danger[data-v-a83480e1],.admonition-error[data-v-a83480e1]{border-color:hsl(var(--ms-destructive) / .3);background-color:hsl(var(--ms-destructive) / .04)}.admonition-danger .admonition-legend[data-v-a83480e1],.admonition-error .admonition-legend[data-v-a83480e1]{color:var(--admonition-danger)}.admonition-toggle[data-v-a83480e1]{margin-left:.25em;background:transparent;border:none;color:inherit;cursor:pointer;padding:2px;border-radius:calc(var(--ms-radius) * .5);display:inline-flex;align-items:center;transition:background-color var(--ms-duration-fast) var(--ms-ease-standard)}.admonition-toggle[data-v-a83480e1]:hover{background-color:hsl(var(--ms-accent))}.admonition-toggle[data-v-a83480e1]:focus-visible{outline:var(--ms-focus-ring-width) solid var(--focus-ring);outline-offset:var(--ms-focus-ring-offset)}.admonition-content[data-v-a83480e1] .markdown-renderer{content-visibility:visible;contain:content;contain-intrinsic-size:0px 0px}.tooltip-element[data-v-c606ee4c]{z-index:9999;display:inline-block;max-width:320px;padding:4px 8px;border-radius:calc(var(--ms-radius) * .75);font-size:12px;line-height:1.4;white-space:normal;word-break:break-word;pointer-events:none;background-color:var(--tooltip-bg);color:var(--tooltip-fg);box-shadow:inset 0 1px #ffffff26,0 0 0 1px #0000001f,var(--ms-shadow-popover);transition:transform var(--ms-duration-emphasis) var(--ms-ease-spring),box-shadow var(--ms-duration-emphasis) var(--ms-ease-spring)}.tooltip-arrow[data-v-c606ee4c]{position:absolute;width:6px;height:6px;background:inherit;transform:rotate(45deg)}.tooltip-arrow[data-placement^=top][data-v-c606ee4c]{bottom:-3px}.tooltip-arrow[data-placement^=bottom][data-v-c606ee4c]{top:-3px}.tooltip-arrow[data-placement^=left][data-v-c606ee4c]{right:-3px}.tooltip-arrow[data-placement^=right][data-v-c606ee4c]{left:-3px}.tooltip-enter-active[data-v-c606ee4c]{transition:opacity .18s cubic-bezier(.16,1,.3,1),transform .18s cubic-bezier(.16,1,.3,1)}.tooltip-leave-active[data-v-c606ee4c]{transition:opacity .12s ease-in,transform .12s ease-in}.tooltip-enter-from[data-v-c606ee4c]{opacity:0;transform:scale(.96)}.tooltip-enter-to[data-v-c606ee4c],.tooltip-leave-from[data-v-c606ee4c]{opacity:1;transform:scale(1)}.tooltip-leave-to[data-v-c606ee4c]{opacity:0;transform:scale(.97)}.code-block-container{margin:var(--ms-flow-codeblock-y) 0;contain:layout style;container-type:inline-size;background:var(--code-bg);border-color:var(--code-border);color:var(--code-fg);box-shadow:var(--ms-shadow-subtle)}.code-block-header{position:relative;z-index:1;gap:var(--ms-gap-header);border-radius:var(--ms-radius) var(--ms-radius) 0 0;overflow:visible}.code-block-header .code-header-main{min-width:0;flex:1 1 auto;display:flex;align-items:center;gap:var(--ms-gap-header-main);overflow:hidden}.code-block-header .code-header-copy{min-width:0;display:grid;gap:2px}.code-block-header .code-header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ms-text-label);font-weight:500;color:var(--code-action-fg)}.code-block-header .code-header-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--code-line-number)}.code-block-header .code-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--ms-gap-header-actions);flex-wrap:wrap}.code-block-header .icon-slot{display:inline-flex;align-items:center;justify-content:center}.code-block-header .icon-slot svg,.code-block-header .icon-slot img{display:block;width:100%;height:100%}.code-diff-stats{display:inline-flex;align-items:center;gap:var(--ms-space-1_5);margin-right:var(--ms-space-1);font-size:var(--ms-text-label);font-weight:600;line-height:1;font-variant-numeric:tabular-nums}.code-diff-stat{display:inline-flex;align-items:center;padding:2px 6px;border-radius:var(--ms-radius);line-height:1}.code-diff-stat.removed{color:var(--diff-removed-fg);background:hsl(var(--ms-diff-removed) / .1)}.code-diff-stat.added{color:var(--diff-added-fg);background:hsl(var(--ms-diff-added) / .1)}.code-more-menu{position:absolute;top:100%;right:0;margin-top:4px;z-index:50;border-radius:var(--ms-radius)}.code-block-shell-content,.code-loading-placeholder{overflow:hidden;border-radius:0 0 var(--ms-radius) var(--ms-radius);contain:content}.code-menu-enter-active,.code-menu-leave-active{transform-origin:top right}.code-menu-enter-active{transition:opacity .22s cubic-bezier(.16,1,.3,1),transform .22s cubic-bezier(.16,1,.3,1)}.code-menu-leave-active{transition:opacity .14s ease-in,transform .14s ease-in}.code-menu-enter-from{opacity:0;transform:scale(.9) translateY(-4px)}.code-menu-leave-to{opacity:0;transform:scale(.95) translateY(-2px)}.html-preview-frame__backdrop[data-v-24e66176]{position:fixed;inset:0;background-color:var(--modal-overlay);display:flex;align-items:center;justify-content:center;z-index:50}.html-preview-frame[data-v-24e66176]{width:80vw;max-width:960px;height:70vh;background-color:var(--modal-bg);color:var(--modal-fg);border-radius:calc(var(--ms-radius) * 2);overflow:hidden;box-shadow:var(--ms-shadow-preview);display:flex;flex-direction:column}.html-preview-frame__header[data-v-24e66176]{display:flex;justify-content:space-between;align-items:center;padding:6.4px 12px;border-bottom:1px solid var(--code-border)}.html-preview-frame__title[data-v-24e66176]{display:inline-flex;align-items:center;gap:6.4px;font-size:12px;font-weight:500;letter-spacing:.02em;text-transform:uppercase;opacity:.85}.html-preview-frame__dot[data-v-24e66176]{width:8px;height:8px;border-radius:999px;background-color:hsl(var(--ms-success))}.html-preview-frame__label[data-v-24e66176]{white-space:nowrap}.html-preview-frame__close[data-v-24e66176]{border:none;background:transparent;font-size:20px;line-height:1;cursor:pointer;color:var(--modal-fg)}.html-preview-frame__iframe[data-v-24e66176]{width:100%;height:100%;border:none;display:block}@media(max-width:640px){.html-preview-frame[data-v-24e66176]{width:100vw;height:80vh;border-radius:0}}.code-block-container[data-v-4ece510f]{--markstream-code-fallback-bg: var(--code-bg);--markstream-code-fallback-fg: var(--code-fg);--markstream-code-border-color: var(--code-border);--vscode-editor-selectionBackground: var(--markstream-code-fallback-selection-bg);--markstream-code-fallback-selection-bg: var(--code-selection-bg);--markstream-diff-frame-border: var(--code-border);--markstream-diff-frame-shadow: 0 16px 40px -32px hsl(var(--ms-foreground) / .18);--markstream-diff-shell-fg: hsl(var(--ms-foreground));--markstream-diff-shell-muted: hsl(var(--ms-muted-foreground));--markstream-diff-shell-border: var(--code-border);--markstream-diff-shell-shadow: var(--ms-shadow-subtle);--markstream-diff-shell-bg: var(--code-bg);--markstream-diff-header-border: hsl(var(--ms-border) / .92);--markstream-diff-editor-bg: hsl(var(--ms-background));--markstream-diff-editor-fg: hsl(var(--ms-foreground));--markstream-diff-unchanged-fg: hsl(var(--ms-foreground));--markstream-diff-unchanged-bg: hsl(var(--ms-muted));--markstream-diff-unchanged-divider: hsl(var(--ms-background) / .94);--markstream-diff-focus: var(--focus-ring);--markstream-diff-widget-shadow: hsl(var(--ms-foreground) / .26);--markstream-diff-action-hover: var(--code-action-hover-bg);--markstream-diff-panel-bg: linear-gradient(180deg, var(--code-bg) 0%, hsl(var(--ms-muted)) 100%);--markstream-diff-panel-bg-soft: var(--code-bg);--markstream-diff-panel-bg-strong: var(--code-bg);--markstream-diff-panel-border: hsl(var(--ms-border) / .3);--markstream-diff-pane-divider: hsl(var(--ms-border) / .42);--markstream-diff-gutter-bg: transparent;--markstream-diff-gutter-guide: transparent;--markstream-diff-gutter-gap: 8px;--markstream-diff-line-number: var(--code-line-number);--markstream-diff-line-number-active: var(--code-line-number);--markstream-diff-added-fg: var(--diff-added-fg);--markstream-diff-removed-fg: var(--diff-removed-fg);--markstream-diff-added-line: var(--diff-added-bg);--markstream-diff-removed-line: var(--diff-removed-bg);--markstream-diff-added-inline: var(--diff-added-inline-bg);--markstream-diff-removed-inline: var(--diff-removed-inline-bg);--markstream-diff-added-inline-border: transparent;--markstream-diff-removed-inline-border: transparent;--markstream-diff-added-gutter: linear-gradient( 90deg, var(--markstream-diff-added-fg) 0 var(--stream-monaco-gutter-marker-width, 4px), hsl(var(--ms-diff-added) / .08) var(--stream-monaco-gutter-marker-width, 4px) 100% );--markstream-diff-removed-gutter: repeating-linear-gradient( 180deg, var(--markstream-diff-removed-fg) 0 2px, transparent 2px 4px ) left / var(--stream-monaco-gutter-marker-width, 4px) 100% no-repeat, linear-gradient(90deg, hsl(var(--ms-diff-removed) / .08) 0 100%);--markstream-diff-added-line-fill: var(--diff-added-bg);--markstream-diff-removed-line-fill: var(--diff-removed-bg)}.code-block-container.is-dark[data-v-4ece510f]{--markstream-code-fallback-bg: var(--code-bg);--markstream-code-fallback-fg: var(--code-fg);--markstream-code-border-color: var(--code-border);--markstream-code-fallback-selection-bg: var(--code-selection-bg);--markstream-diff-frame-border: var(--code-border);--markstream-diff-frame-shadow: 0 18px 40px -30px hsl(var(--ms-foreground) / .84);--markstream-diff-shell-fg: hsl(var(--ms-foreground));--markstream-diff-shell-muted: hsl(var(--ms-muted-foreground));--markstream-diff-shell-border: var(--code-border);--markstream-diff-shell-shadow: var(--ms-shadow-subtle);--markstream-diff-shell-bg: var(--code-bg);--markstream-diff-header-border: hsl(var(--ms-border) / .82);--markstream-diff-editor-bg: #121212;--markstream-diff-editor-fg: #e5e5e5;--markstream-diff-unchanged-fg: #d4d4d4;--markstream-diff-unchanged-bg: #262626;--markstream-diff-unchanged-divider: hsl(0 0% 100% / .08);--markstream-diff-focus: var(--focus-ring);--markstream-diff-widget-shadow: hsl(var(--ms-foreground) / .72);--markstream-diff-action-hover: var(--code-action-hover-bg);--markstream-diff-panel-bg: #121212;--markstream-diff-panel-bg-soft: #121212;--markstream-diff-panel-bg-strong: #121212;--markstream-diff-panel-border: hsl(var(--ms-border) / .3);--markstream-diff-pane-divider: hsl(var(--ms-border) / .34);--markstream-diff-gutter-bg: linear-gradient( 180deg, hsl(0 0% 7% / .94) 0%, hsl(0 0% 7% / .98) 100% );--markstream-diff-gutter-guide: hsl(var(--ms-muted-foreground) / .08);--markstream-diff-gutter-gap: 8px;--markstream-diff-line-number: var(--code-line-number);--markstream-diff-line-number-active: var(--code-line-number);--markstream-diff-added-fg: hsl(152 42% 60%);--markstream-diff-removed-fg: hsl(0 58% 58%);--markstream-diff-added-line: hsl(152 42% 60% / .18);--markstream-diff-removed-line: hsl(0 58% 58% / .18);--markstream-diff-added-inline: hsl(152 42% 60% / .28);--markstream-diff-removed-inline: hsl(0 58% 58% / .28);--markstream-diff-added-inline-border: transparent;--markstream-diff-removed-inline-border: transparent;--markstream-diff-added-gutter: linear-gradient( 90deg, var(--markstream-diff-added-fg) 0 var(--stream-monaco-gutter-marker-width, 4px), hsl(var(--ms-diff-added) / .2) var(--stream-monaco-gutter-marker-width, 4px) 100% );--markstream-diff-removed-gutter: repeating-linear-gradient( 180deg, var(--markstream-diff-removed-fg) 0 2px, transparent 2px 4px ) left / var(--stream-monaco-gutter-marker-width, 4px) 100% no-repeat, linear-gradient(90deg, hsl(var(--ms-diff-removed) / .18) 0 100%);--markstream-diff-added-line-fill: hsl(152 42% 60% / .18);--markstream-diff-removed-line-fill: hsl(0 58% 58% / .18)}.code-editor-container[data-v-4ece510f]{transition:none;box-sizing:border-box;min-width:0;width:100%}.code-block-container.is-diff .code-editor-container[data-v-4ece510f]{transition:none}.code-editor-layer[data-v-4ece510f]{display:grid;min-width:0;position:relative}.code-editor-layer>.code-editor-container[data-v-4ece510f]{grid-area:1 / 1;z-index:1}[data-v-4ece510f] .code-editor-layer>pre.code-pre-fallback{grid-area:1 / 1;position:relative;z-index:2}.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .monaco-editor-background,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .margin,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .lines-content{background:var(--vscode-editor-background, var(--markstream-code-fallback-bg))!important}.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .margin,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .view-lines,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .view-line,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .view-line span,.code-block-container.is-plain-text[data-v-4ece510f]:not(.is-diff) .monaco-editor .line-numbers{color:var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))!important}.code-block-container.is-diff[data-v-4ece510f]{color:var(--markstream-diff-shell-fg);border-color:var(--markstream-diff-shell-border);background:var(--markstream-diff-shell-bg);box-shadow:var(--markstream-diff-shell-shadow);--vscode-editor-selectionBackground: var(--markstream-diff-action-hover);--code-fg: var(--markstream-diff-shell-fg);--code-header-bg: transparent;--code-border: var(--markstream-diff-header-border);--code-line-number: var(--markstream-diff-shell-muted);--code-action-fg: var(--markstream-diff-shell-muted)}.code-block-container.is-diff .code-editor-layer[data-v-4ece510f]{background:transparent;--vscode-editor-background: var(--markstream-diff-editor-bg);--vscode-editor-foreground: var(--markstream-diff-editor-fg);--vscode-diffEditor-unchangedRegionForeground: var(--markstream-diff-unchanged-fg);--vscode-diffEditor-unchangedRegionBackground: var(--markstream-diff-unchanged-bg);--vscode-focusBorder: var(--markstream-diff-focus);--vscode-widget-shadow: var(--markstream-diff-widget-shadow);--vscode-editor-selectionBackground: color-mix( in srgb, var(--markstream-diff-editor-bg) 90%, var(--markstream-diff-editor-fg) 10% );--stream-monaco-editor-bg: var(--markstream-diff-editor-bg);--stream-monaco-editor-fg: var(--markstream-diff-editor-fg);--stream-monaco-unchanged-fg: var(--markstream-diff-unchanged-fg);--stream-monaco-unchanged-bg: var(--markstream-diff-unchanged-bg);--stream-monaco-frame-radius: 0;--stream-monaco-fixed-editor-bg: var(--markstream-diff-editor-bg);--stream-monaco-frame-border: transparent;--stream-monaco-frame-shadow: none;--stream-monaco-panel-bg: var(--markstream-diff-editor-bg);--stream-monaco-panel-bg-soft: var(--markstream-diff-editor-bg);--stream-monaco-panel-bg-strong: var(--markstream-diff-editor-bg);--stream-monaco-panel-border: transparent;--stream-monaco-pane-divider: var(--markstream-diff-pane-divider);--stream-monaco-gutter-bg: var(--markstream-diff-gutter-bg);--stream-monaco-gutter-guide: var(--markstream-diff-gutter-guide);--stream-monaco-gutter-marker-width: 4px;--stream-monaco-gutter-gap: 8px;--stream-monaco-line-number-gap-to-code: var(--stream-monaco-gutter-gap);--stream-monaco-line-number: var(--markstream-diff-line-number);--stream-monaco-line-number-active: var(--markstream-diff-line-number-active);--stream-monaco-line-number-left: 4px;--stream-monaco-line-number-width: 36px;--stream-monaco-line-number-align: var( --markstream-diff-line-number-align, var(--markstream-code-line-number-align, right) );--stream-monaco-original-margin-width: calc( var(--stream-monaco-line-number-left) + var(--stream-monaco-line-number-width) + var(--stream-monaco-line-number-gap-to-code) );--stream-monaco-original-scrollable-left: var(--stream-monaco-original-margin-width);--stream-monaco-original-scrollable-width: calc( 100% - var(--stream-monaco-original-margin-width) );--stream-monaco-modified-margin-width: calc( var(--stream-monaco-line-number-left) + var(--stream-monaco-line-number-width) + var(--stream-monaco-line-number-gap-to-code) );--stream-monaco-modified-scrollable-left: var(--stream-monaco-modified-margin-width);--stream-monaco-modified-scrollable-width: calc( 100% - var(--stream-monaco-modified-margin-width) );--stream-monaco-added-fg: var(--markstream-diff-added-fg);--stream-monaco-removed-fg: var(--markstream-diff-removed-fg);--stream-monaco-added-line: var(--markstream-diff-added-line);--stream-monaco-removed-line: var(--markstream-diff-removed-line);--stream-monaco-added-inline: var(--markstream-diff-added-inline);--stream-monaco-removed-inline: var(--markstream-diff-removed-inline);--stream-monaco-added-outline: transparent;--stream-monaco-removed-outline: transparent;--stream-monaco-added-inline-border: var(--markstream-diff-added-inline-border);--stream-monaco-removed-inline-border: var(--markstream-diff-removed-inline-border);--stream-monaco-added-line-shadow: none;--stream-monaco-removed-line-shadow: none;--stream-monaco-added-gutter: var(--markstream-diff-added-gutter);--stream-monaco-removed-gutter: var(--markstream-diff-removed-gutter);--stream-monaco-added-line-fill: var(--markstream-diff-added-line-fill);--stream-monaco-removed-line-fill: var(--markstream-diff-removed-line-fill);--stream-monaco-added-border: hsl(var(--ms-diff-added) / .25);--stream-monaco-removed-border: hsl(var(--ms-diff-removed) / .25);--stream-monaco-widget-shadow: var(--markstream-diff-widget-shadow)}.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .editor.original .margin-view-overlays .line-numbers{left:calc(var(--stream-monaco-original-scrollable-left) - var(--stream-monaco-line-number-gap-to-code) - var(--stream-monaco-line-number-width))!important;width:var(--stream-monaco-line-number-width)!important;padding:0!important;text-align:var( --markstream-diff-line-number-align, var(--markstream-code-line-number-align, right) )!important;font-variant-numeric:tabular-nums}.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .editor.modified .margin-view-overlays .line-numbers{left:calc(var(--stream-monaco-modified-scrollable-left) - var(--stream-monaco-modified-line-number-gap-to-code, var(--stream-monaco-line-number-gap-to-code)) - var(--stream-monaco-line-number-width))!important;width:var(--stream-monaco-line-number-width)!important;padding:0!important;text-align:var( --markstream-diff-line-number-align, var(--markstream-code-line-number-align, right) )!important;font-variant-numeric:tabular-nums}.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .margin-view-overlays .line-numbers,.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .margin-view-overlays .line-numbers *{text-align:var( --markstream-diff-line-number-align, var(--markstream-code-line-number-align, right) )!important;font-variant-numeric:tabular-nums}.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor,.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .monaco-editor,.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .margin,.code-block-container.is-diff[data-v-4ece510f] .monaco-diff-editor .margin-view-overlays{--stream-monaco-line-number-align: var( --markstream-diff-line-number-align, var(--markstream-code-line-number-align, right) ) !important}.code-editor-container.is-hidden[data-v-4ece510f]{position:absolute;inset:0;width:100%;height:100%!important;min-height:0!important;max-height:none!important;overflow:hidden;visibility:hidden;pointer-events:none}[data-v-4ece510f] pre.code-pre-fallback{margin:0;box-sizing:border-box;width:100%;padding:var(--markstream-code-padding-y, 8px) var(--markstream-code-padding-x, 12px);padding-left:var(--markstream-code-padding-left, 52px);background:transparent;color:var(--vscode-editor-foreground, inherit);backface-visibility:visible;transform:none;-webkit-font-smoothing:auto;font-size:var(--vscode-editor-font-size, 12px);line-height:var(--vscode-editor-line-height, 18px);font-weight:400;font-family:var( --markstream-code-font-family, Menlo, Monaco, Courier New, monospace )}[data-v-4ece510f] pre.code-pre-fallback>code{font-size:inherit;font-weight:inherit;line-height:inherit;font-family:inherit}[data-v-4ece510f] pre.code-pre-fallback.is-wrap{white-space:pre-wrap;overflow-wrap:anywhere}[data-v-4ece510f] pre.code-pre-fallback.markstream-pre--diff-preview{padding-left:0;padding-right:0}.code-block-container.is-diff[data-v-4ece510f] pre.code-pre-fallback.markstream-pre--diff-preview{background:var(--markstream-diff-editor-bg);transition:opacity .12s ease-out}.code-block-container.is-diff[data-v-4ece510f] pre.code-pre-fallback.markstream-pre--diff-preview .markstream-pre__diff-pane{box-sizing:border-box;padding-bottom:var(--markstream-pre-diff-pane-bottom-padding, 10px)}[data-v-4ece510f] pre.code-pre-fallback.is-fading-out{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.code-block-container.is-diff[data-v-4ece510f] pre.code-pre-fallback.markstream-pre--diff-preview{transition:none}}.code-block-container.is-rendering .code-height-placeholder[data-v-4ece510f]{background-size:400% 100%;animation:code-skeleton-shimmer-4ece510f 1.2s ease-in-out infinite;min-height:var(--ms-size-skeleton-min-height);background:linear-gradient(90deg,var(--loading-shimmer) 25%,hsl(var(--ms-muted) / .7) 37%,var(--loading-shimmer) 63%)}.code-loading-placeholder[data-v-4ece510f]{padding:16px;min-height:var(--ms-size-skeleton-min-height)}.loading-skeleton[data-v-4ece510f]{display:flex;flex-direction:column;gap:12px}.skeleton-line[data-v-4ece510f]{height:16px;background:linear-gradient(90deg,var(--loading-shimmer) 25%,hsl(var(--ms-muted) / .7) 37%,var(--loading-shimmer) 63%);background-size:400% 100%;animation:code-skeleton-shimmer-4ece510f 1.2s ease-in-out infinite;border-radius:calc(var(--ms-radius) * .5)}.skeleton-line.short[data-v-4ece510f]{width:60%}@keyframes code-skeleton-shimmer-4ece510f{0%{background-position:100% 0}to{background-position:0 0}}[data-v-4ece510f] .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center{border-radius:var(--ms-radius)!important;background:transparent!important;border:1px solid transparent!important;box-shadow:none!important;min-height:28px!important;transition:background-color .14s ease,border-color .14s ease!important}[data-v-4ece510f] .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:hover,[data-v-4ece510f] .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-focus-within{background:color-mix(in srgb,var(--stream-monaco-editor-fg) 4%,transparent)!important;border-color:color-mix(in srgb,var(--stream-monaco-editor-fg) 10%,transparent)!important;box-shadow:none!important}[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center{background:transparent!important;border-color:transparent!important;box-shadow:none!important}[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center:hover,[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center.stream-monaco-focus-within{background:color-mix(in srgb,var(--stream-monaco-editor-fg) 6%,transparent)!important;border-color:color-mix(in srgb,var(--stream-monaco-editor-fg) 12%,transparent)!important;box-shadow:none!important}[data-v-4ece510f] .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-count:before{content:"";display:inline-block;width:14px;height:14px;margin-right:4px;flex-shrink:0;background:currentColor;mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");mask-size:contain;-webkit-mask-size:contain;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat}[data-v-4ece510f] .monaco-diff-editor .diffOverview{background-color:var(--vscode-editor-background)}[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor .diffOverview,[data-v-4ece510f] .stream-monaco-diff-root .decorationsOverviewRuler{display:none!important;width:0!important;min-width:0!important;max-width:0!important;border:0!important;background:transparent!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}[data-v-4ece510f] .code-block-container .stream-monaco-diff-root .monaco-diff-editor{border:0!important;border-radius:0!important;box-shadow:none!important}[data-v-4ece510f] .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:not(.stream-monaco-clickable)>*:not(a){visibility:hidden!important}[data-v-4ece510f] .code-block-container .stream-monaco-diff-root .monaco-editor .diff-hidden-lines-compact .text{opacity:0!important}[data-v-4ece510f] .stream-monaco-diff-root{--stream-monaco-gutter-gap: var(--markstream-diff-gutter-gap) !important;--stream-monaco-line-number: var(--markstream-diff-line-number) !important;--stream-monaco-line-number-active: var(--markstream-diff-line-number-active) !important;--stream-monaco-added-fg: var(--markstream-diff-added-fg) !important;--stream-monaco-removed-fg: var(--markstream-diff-removed-fg) !important;--stream-monaco-added-line: var(--markstream-diff-added-line) !important;--stream-monaco-removed-line: var(--markstream-diff-removed-line) !important;--stream-monaco-added-inline: var(--markstream-diff-added-inline) !important;--stream-monaco-removed-inline: var(--markstream-diff-removed-inline) !important;--stream-monaco-added-inline-border: var(--markstream-diff-added-inline-border) !important;--stream-monaco-removed-inline-border: var(--markstream-diff-removed-inline-border) !important;--stream-monaco-added-line-fill: var(--markstream-diff-added-line-fill) !important;--stream-monaco-removed-line-fill: var(--markstream-diff-removed-line-fill) !important;--stream-monaco-added-gutter: var(--markstream-diff-added-gutter) !important;--stream-monaco-removed-gutter: var(--markstream-diff-removed-gutter) !important;--stream-monaco-added-line-shadow: none !important;--stream-monaco-removed-line-shadow: none !important;--stream-monaco-unchanged-bg: var(--markstream-diff-unchanged-bg) !important;--stream-monaco-unchanged-fg: var(--markstream-diff-unchanged-fg) !important;box-sizing:border-box;min-width:0;width:100%}[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor,[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.modified,[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.modified .monaco-editor,[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.modified .overflow-guard,[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side),[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side) .editor.modified,[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side) .editor.modified .monaco-editor,[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side) .editor.modified .overflow-guard{min-width:0!important;width:100%!important}[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.modified .monaco-scrollable-element.editor-scrollable,[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side) .editor.modified .monaco-scrollable-element.editor-scrollable{left:var(--stream-monaco-modified-scrollable-left, var(--stream-monaco-modified-margin-width))!important;width:calc(100% - var(--stream-monaco-modified-scrollable-left, var(--stream-monaco-modified-margin-width)))!important}[data-v-4ece510f] .stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .scrollbar.horizontal,[data-v-4ece510f] .stream-monaco-diff-root .monaco-diff-editor:not(.side-by-side) .scrollbar.horizontal{display:none!important;height:0!important}[data-v-4ece510f] .stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:not(.stream-monaco-unchanged-bridge-source),[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge{--stream-monaco-unchanged-bg: var(--markstream-diff-unchanged-bg) !important;--stream-monaco-unchanged-fg: var(--markstream-diff-unchanged-fg) !important;background:var(--stream-monaco-unchanged-bg)!important;color:var(--stream-monaco-unchanged-fg)!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge{right:calc(var(--stream-monaco-gutter-marker-width) - var(--stream-monaco-unchanged-rail-width) / 2 + (var(--stream-monaco-gutter-gap) * 2))!important;width:auto!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:hover,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:focus-visible,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-focus-visible{background:var(--stream-monaco-unchanged-bg)!important;color:var(--markstream-diff-unchanged-fg)!important;padding-left:calc(var(--stream-monaco-gutter-marker-width) + (var(--stream-monaco-gutter-gap) * 2))!important;padding-right:calc(var(--stream-monaco-gutter-marker-width) + (var(--stream-monaco-gutter-gap) * 2))!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-rail,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible{background:var(--stream-monaco-unchanged-bg)!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail{border-right-color:var(--markstream-diff-unchanged-divider)!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal{border-bottom-color:transparent!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-both .stream-monaco-unchanged-reveal:first-child{border-bottom-color:var(--markstream-diff-unchanged-divider)!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-top-only .stream-monaco-unchanged-reveal,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail.stream-monaco-unchanged-rail-bottom-only .stream-monaco-unchanged-reveal{border-bottom:0!important}[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-count,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-metadata-label,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,[data-v-4ece510f] .stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible{color:var(--markstream-diff-unchanged-fg)!important}[data-v-4ece510f] .monaco-diff-editor:not(.side-by-side) .editor.original .diff-hidden-lines .center{align-items:center;justify-content:center}[data-v-4ece510f] .monaco-diff-editor:not(.side-by-side) .editor.modified .diff-hidden-lines .center{align-items:center;justify-content:center!important;position:relative}[data-v-4ece510f] .monaco-diff-editor:not(.side-by-side) .editor.modified .diff-hidden-lines .center:not(.stream-monaco-clickable){opacity:0!important;pointer-events:none!important}[data-v-4ece510f] .monaco-diff-editor:not(.side-by-side) .editor.modified .diff-hidden-lines .center .stream-monaco-unchanged-meta{justify-content:center!important;padding:0 28px!important}[data-v-4ece510f] .monaco-diff-editor:not(.side-by-side) .editor.original .diff-hidden-lines .center>div:first-child{align-items:center;display:flex;justify-content:center!important;min-width:100%;width:100%!important}[data-v-4ece510f] .markstream-inline-fold-proxy{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:calc(var(--ms-radius) * .5);box-shadow:none;cursor:pointer;inset:0;padding:0;pointer-events:auto;position:absolute;z-index:2}[data-v-4ece510f] .markstream-inline-fold-proxy:hover,[data-v-4ece510f] .markstream-inline-fold-proxy:focus-visible{background:transparent}[data-v-4ece510f] .markstream-inline-fold-proxy:focus-visible{outline:1px solid var(--vscode-focusBorder, currentColor);outline-offset:-1px}.math-inline-wrapper[data-v-7b64afc7]{position:relative;display:inline-block}.math-inline[data-v-7b64afc7]{display:inline-block;vertical-align:middle}.math-inline--fallback[data-v-7b64afc7]{white-space:pre-wrap}.math-inline__loading[data-v-7b64afc7]{display:inline-flex;align-items:center;justify-content:center;pointer-events:none}.math-inline__spinner[data-v-7b64afc7]{width:16px;height:16px;border-radius:9999px;border:2px solid color-mix(in srgb,var(--loading-spinner) 25%,transparent);border-top-color:color-mix(in srgb,var(--loading-spinner) 80%,transparent);will-change:transform}.table-node-fade-enter-active[data-v-7b64afc7],.table-node-fade-leave-active[data-v-7b64afc7]{transition:opacity var(--ms-duration-standard) var(--ms-ease-standard)}.table-node-fade-enter-from[data-v-7b64afc7],.table-node-fade-leave-to[data-v-7b64afc7]{opacity:0}.sr-only[data-v-7b64afc7]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.math-block[data-v-38e7acf6]{min-height:var(--ms-size-math-min-height);transition:min-height var(--ms-duration-overlay) var(--ms-ease-standard)}.math-loading-overlay[data-v-38e7acf6]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(2px);min-height:var(--ms-size-math-min-height)}.math-loading-spinner[data-v-38e7acf6]{width:20px;height:20px;border:2px solid color-mix(in srgb,var(--loading-spinner) 15%,transparent);border-top-color:color-mix(in srgb,var(--loading-spinner) 80%,transparent);border-radius:50%;animation:math-spin-38e7acf6 .8s linear infinite}@keyframes math-spin-38e7acf6{to{transform:rotate(360deg)}}.math-rendering[data-v-38e7acf6]{opacity:.3;transition:opacity var(--ms-duration-overlay) var(--ms-ease-standard)}.math-block__fallback[data-v-38e7acf6]{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.math-fade-enter-active[data-v-38e7acf6],.math-fade-leave-active[data-v-38e7acf6]{transition:all var(--ms-duration-slow) var(--ms-ease-standard)}.math-fade-enter-from[data-v-38e7acf6],.math-fade-leave-to[data-v-38e7acf6]{opacity:0}.code-block-content[data-v-e45dd78e]{position:relative;display:grid;max-height:min(70vh,var(--ms-size-code-max-height));overflow:auto;transition:max-height var(--ms-duration-slow) var(--ms-ease-standard);font-family:var( --markstream-code-font-family, ui-monospace, SFMono-Regular, SF Mono, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace );font-size:var(--vscode-editor-font-size, 14px);line-height:var(--vscode-editor-line-height, 1.5)}.code-block-render[data-v-e45dd78e],.code-fallback-plain[data-v-e45dd78e]{grid-area:1 / 1;min-width:0}.code-block-render[data-v-e45dd78e]{min-height:1px}[data-v-e45dd78e] .code-block-render pre,[data-v-e45dd78e] .code-block-content .shiki{font-family:inherit;font-size:inherit;line-height:inherit}[data-v-e45dd78e] .code-block-content pre{box-sizing:border-box;margin:0;padding:16px;font-family:inherit;font-size:inherit;line-height:inherit}[data-v-e45dd78e] .code-block-content .shiki-fallback{background:var(--vscode-editor-background, hsl(var(--ms-background, 0 0% 100%)));color:var(--vscode-editor-foreground, inherit);white-space:pre}.code-block-container.dark[data-v-e45dd78e] .code-block-content .shiki-fallback{background:var(--vscode-editor-background, #111827);color:var(--vscode-editor-foreground, #e5e7eb)}.code-fallback-plain[data-v-e45dd78e]{position:relative;z-index:1;white-space:pre;overflow:auto;background:var(--vscode-editor-background, hsl(var(--ms-background, 0 0% 100%)));color:var(--vscode-editor-foreground, inherit);font-size:inherit;line-height:inherit;font-family:inherit}.code-block-container.dark .code-fallback-plain[data-v-e45dd78e]{background:var(--vscode-editor-background, #111827);color:var(--vscode-editor-foreground, #e5e7eb)}.code-loading-placeholder[data-v-e45dd78e]{padding:16px;min-height:var(--ms-size-skeleton-min-height)}.loading-skeleton[data-v-e45dd78e]{display:flex;flex-direction:column;gap:12px}.skeleton-line[data-v-e45dd78e]{height:16px;background:linear-gradient(90deg,var(--loading-shimmer) 25%,hsl(var(--ms-muted-foreground) / .12) 37%,var(--loading-shimmer) 63%);background-size:400% 100%;animation:code-skeleton-shimmer-e45dd78e 1.2s ease-in-out infinite;border-radius:calc(var(--ms-radius) * .5)}.skeleton-line.short[data-v-e45dd78e]{width:60%}@keyframes code-skeleton-shimmer-e45dd78e{0%{background-position:100% 0}to{background-position:0 0}}.action-icon{width:var(--ms-action-btn-icon);height:var(--ms-action-btn-icon)}.icon-slot{display:inline-flex;align-items:center;justify-content:center}.icon-slot svg{display:block;width:100%;height:100%}.mermaid-block-container[data-v-07b7ab60]{margin:var(--ms-flow-diagram-y) 0;border-color:var(--diagram-border)}.mermaid-block-header[data-v-07b7ab60]{padding:var(--ms-inset-panel-y) var(--ms-inset-panel-x);background:var(--diagram-header-bg);border-color:var(--diagram-border)}.mermaid-label-text[data-v-07b7ab60]{color:var(--code-action-fg)}.mermaid-mode-toggle-group[data-v-07b7ab60]{background:transparent}.mermaid-mode-btn[data-v-07b7ab60]{font-size:var(--ms-text-label);color:var(--code-action-fg);opacity:.6}.mermaid-mode-btn[data-v-07b7ab60]:hover{opacity:.9}.mermaid-mode-btn.is-active[data-v-07b7ab60]{background:hsl(var(--ms-foreground) / .08);color:var(--code-fg);opacity:1}.mermaid-header-actions[data-v-07b7ab60]{gap:var(--ms-gap-header-actions)}.mermaid-action-btn[data-v-07b7ab60]{font-family:inherit;font-size:var(--ms-text-label);color:var(--code-action-fg)}.mermaid-action-btn[data-v-07b7ab60]:hover{background:var(--code-action-hover-bg);color:var(--code-action-hover-fg)}.mermaid-action-btn[data-v-07b7ab60]:active{transform:scale(.98)}.mermaid-source-panel[data-v-07b7ab60]{padding:var(--ms-inset-panel-body);background:var(--diagram-bg)}.mermaid-source-code[data-v-07b7ab60]{color:hsl(var(--ms-foreground))}.mermaid-preview-area[data-v-07b7ab60]{background:var(--diagram-bg);min-height:var(--ms-size-diagram-min-height);transition-duration:var(--ms-duration-standard)}.mermaid-modal-overlay[data-v-07b7ab60]{background:var(--modal-overlay)}.mermaid-modal-panel[data-v-07b7ab60]{background:var(--modal-bg);color:var(--modal-fg);box-shadow:var(--ms-shadow-modal)}._mermaid[data-v-07b7ab60]{position:relative;font-family:inherit;content-visibility:auto;contain:content;contain-intrinsic-size:var(--ms-size-diagram-min-height) 240px}._mermaid[data-v-07b7ab60] [data-mermaid-svg-layer]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;min-height:100%}._mermaid[data-v-07b7ab60] svg{width:100%;height:auto;display:block}.fullscreen[data-v-07b7ab60]{width:100%;max-height:100%!important;height:100%!important}.mermaid-dialog-enter-from[data-v-07b7ab60],.mermaid-dialog-leave-to[data-v-07b7ab60]{opacity:0}.mermaid-dialog-enter-active[data-v-07b7ab60],.mermaid-dialog-leave-active[data-v-07b7ab60]{transition:opacity var(--ms-duration-overlay) var(--ms-ease-standard)}.mermaid-dialog-enter-from .dialog-panel[data-v-07b7ab60],.mermaid-dialog-leave-to .dialog-panel[data-v-07b7ab60]{transform:translateY(8px) scale(.98);opacity:.98}.mermaid-dialog-enter-to .dialog-panel[data-v-07b7ab60],.mermaid-dialog-leave-from .dialog-panel[data-v-07b7ab60]{transform:translateY(0) scale(1);opacity:1}.mermaid-dialog-enter-active .dialog-panel[data-v-07b7ab60],.mermaid-dialog-leave-active .dialog-panel[data-v-07b7ab60]{transition:transform var(--ms-duration-overlay) var(--ms-ease-standard),opacity var(--ms-duration-overlay) var(--ms-ease-standard)}.infographic-block-container[data-v-3321af9c]{margin:var(--ms-flow-diagram-y) 0;background:var(--diagram-bg);border-color:var(--diagram-border);color:hsl(var(--ms-foreground));box-shadow:var(--ms-shadow-subtle)}.infographic-block-header[data-v-3321af9c]{padding:var(--ms-inset-panel-y) var(--ms-inset-panel-x);background:var(--diagram-header-bg);border-color:var(--diagram-border);color:hsl(var(--ms-foreground))}.infographic-label[data-v-3321af9c]{font-size:var(--ms-text-label);color:hsl(var(--ms-muted-foreground))}.action-icon[data-v-3321af9c]{width:var(--ms-action-btn-icon);height:var(--ms-action-btn-icon)}.icon-slot[data-v-3321af9c]{display:inline-flex;align-items:center;justify-content:center}.icon-slot[data-v-3321af9c] svg{display:block;width:100%;height:100%}.infographic-mode-toggle[data-v-3321af9c]{background:transparent}.infographic-mode-btn[data-v-3321af9c]{font-size:var(--ms-text-label);color:var(--code-action-fg);opacity:.6;transition:color .15s,background-color .15s,opacity .15s}.infographic-mode-btn[data-v-3321af9c]:hover{opacity:.9}.infographic-mode-btn.is-active[data-v-3321af9c]{background:hsl(var(--ms-foreground) / .08);color:var(--code-fg);opacity:1}.infographic-header-actions[data-v-3321af9c]{gap:var(--ms-gap-header-actions)}.infographic-action-btn[data-v-3321af9c]{font-family:inherit;color:var(--code-action-fg);transition:background-color .15s,color .15s}.infographic-action-btn[data-v-3321af9c]:hover{background:var(--code-action-hover-bg);color:var(--code-action-hover-fg)}.infographic-action-btn[data-v-3321af9c]:active{transform:scale(.98)}.infographic-source[data-v-3321af9c]{padding:var(--ms-inset-panel-body);background:var(--diagram-bg)}.infographic-source-code[data-v-3321af9c]{color:hsl(var(--ms-foreground))}.infographic-preview[data-v-3321af9c]{background:var(--diagram-bg);min-height:var(--ms-size-diagram-min-height);transition-duration:var(--ms-duration-fast)}.infographic-modal-overlay[data-v-3321af9c]{background:var(--modal-overlay)}.infographic-modal-panel[data-v-3321af9c]{background:var(--modal-bg);color:var(--modal-fg);box-shadow:var(--ms-shadow-modal)}.fullscreen[data-v-3321af9c]{width:100%;max-height:100%!important;height:100%!important}.infographic-dialog-enter-from[data-v-3321af9c],.infographic-dialog-leave-to[data-v-3321af9c]{opacity:0}.infographic-dialog-enter-active[data-v-3321af9c],.infographic-dialog-leave-active[data-v-3321af9c]{transition:opacity var(--ms-duration-overlay) var(--ms-ease-standard)}.infographic-dialog-enter-from .dialog-panel[data-v-3321af9c],.infographic-dialog-leave-to .dialog-panel[data-v-3321af9c]{transform:translateY(8px) scale(.98);opacity:.98}.infographic-dialog-enter-to .dialog-panel[data-v-3321af9c],.infographic-dialog-leave-from .dialog-panel[data-v-3321af9c]{transform:translateY(0) scale(1);opacity:1}.infographic-dialog-enter-active .dialog-panel[data-v-3321af9c],.infographic-dialog-leave-active .dialog-panel[data-v-3321af9c]{transition:transform var(--ms-duration-overlay) var(--ms-ease-standard),opacity var(--ms-duration-overlay) var(--ms-ease-standard)}.d2-block-container[data-v-f7ae4ae1]{margin:var(--ms-flow-diagram-y) 0;background:var(--diagram-bg);border-color:var(--diagram-border);color:hsl(var(--ms-foreground));box-shadow:var(--ms-shadow-subtle)}.d2-block-header[data-v-f7ae4ae1]{padding:var(--ms-inset-panel-y) var(--ms-inset-panel-x);background:var(--diagram-header-bg);border-color:var(--diagram-border);color:hsl(var(--ms-foreground))}.d2-mode-toggle[data-v-f7ae4ae1]{background:transparent}.mode-btn[data-v-f7ae4ae1]{font-size:var(--ms-text-label);color:var(--code-action-fg);opacity:.6;transition:opacity .2s,color .2s,background-color .2s}.mode-btn[data-v-f7ae4ae1]:hover{opacity:.9}.mode-btn.is-active[data-v-f7ae4ae1]{background:hsl(var(--ms-foreground) / .08);color:var(--code-fg);opacity:1}.d2-header-actions[data-v-f7ae4ae1]{gap:var(--ms-gap-header-actions)}.d2-action-btn[data-v-f7ae4ae1]{color:var(--code-action-fg);opacity:.7;transition:opacity .2s,background-color .15s,color .15s}.d2-action-btn[data-v-f7ae4ae1]:hover{opacity:1;background:var(--code-action-hover-bg);color:var(--code-action-hover-fg)}.d2-action-btn[data-v-f7ae4ae1]:disabled{opacity:.3;cursor:not-allowed}.d2-block-body[data-v-f7ae4ae1]{position:relative}.d2-source[data-v-f7ae4ae1]{padding:var(--ms-inset-panel-body) var(--ms-inset-panel-x);font-family:var(--vscode-editor-font-family, "Fira Code", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace)}.d2-code[data-v-f7ae4ae1]{white-space:pre;font-size:14px;line-height:1.5}.d2-render[data-v-f7ae4ae1]{max-height:var(--ms-size-code-max-height);overflow:auto}.d2-svg[data-v-f7ae4ae1] svg.markstream-d2-root-svg{width:100%;max-width:100%;height:auto;display:block}.d2-label[data-v-f7ae4ae1]{font-size:var(--ms-text-label)}.action-icon[data-v-f7ae4ae1]{width:var(--ms-action-btn-icon);height:var(--ms-action-btn-icon)}.d2-error[data-v-f7ae4ae1]{color:hsl(var(--ms-destructive))}.markstream-virtual-timeline[data-v-dff004bf]{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;overflow:auto;overflow-anchor:none}.markstream-virtual-timeline.is-restoring-thread>.markstream-virtual-timeline__spacer[data-v-dff004bf],.markstream-virtual-timeline.is-restoring-thread>.markstream-virtual-timeline__item[data-v-dff004bf]{opacity:0;visibility:hidden;pointer-events:none}.markstream-virtual-timeline__restore-loading[data-v-dff004bf]{position:absolute;top:0;left:0;right:0;z-index:10;display:grid;place-items:center;pointer-events:none;overflow:hidden;background:Canvas;contain:strict}.markstream-virtual-timeline__restore-loading-card[data-v-dff004bf]{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid rgb(148 163 184 / 32%);border-radius:999px;background:#ffffffeb;color:#334155;font-size:13px;box-shadow:0 8px 24px #0f172a14}.markstream-virtual-timeline__restore-spinner[data-v-dff004bf]{width:14px;height:14px;border:2px solid rgb(148 163 184 / 35%);border-top-color:#334155;border-radius:999px;animation:markstream-timeline-restore-spin-dff004bf .8s linear infinite}@keyframes markstream-timeline-restore-spin-dff004bf{to{transform:rotate(360deg)}}.markstream-virtual-timeline__spacer[data-v-dff004bf]{flex:0 0 auto;overflow-anchor:none}.markstream-virtual-timeline__item[data-v-dff004bf]{display:flow-root;flex:0 0 auto;overflow-anchor:none}.markstream-virtual-timeline__default-item[data-v-dff004bf]{margin:8px 0;padding:10px 12px;border:1px solid rgb(148 163 184 / 32%);border-radius:8px;background:#f8fafc;color:#0f172a;line-height:1.5;white-space:pre-wrap}.markstream-virtual-timeline__default-item--system-divider[data-v-dff004bf]{border:0;background:transparent;color:#64748b;font-size:12px;text-align:center}.markstream-virtual-timeline__default-item--error[data-v-dff004bf]{border-color:#f8717173;background:#fef2f2;color:#991b1b}.markstream-virtual-timeline__status[data-v-dff004bf]{display:inline-flex;margin-right:8px;color:#475569;font-size:12px;text-transform:uppercase}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.17.0"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.md[data-v-72f31a12]{font:400 15px/1.6 var(--font-ui);color:var(--color-text);word-break:break-word}.md[data-v-72f31a12] .markdown-renderer{font:400 15px/1.6 var(--font-ui);color:var(--color-text)}.md[data-v-72f31a12] .markstream-vue,.md[data-v-72f31a12] .markdown-renderer{--code-bg: var(--color-surface-sunken);--code-fg: var(--color-text);--code-border: var(--color-line);--code-header-bg: var(--color-surface);--code-action-fg: var(--color-text-muted);--code-action-hover-fg: var(--color-accent);--markstream-code-fallback-bg: var(--color-surface-sunken);--markstream-code-fallback-fg: var(--color-text);--markstream-code-border-color: var(--color-line);--inline-code-bg: var(--color-surface-sunken);--inline-code-fg: var(--color-fg);--inline-code-border: transparent}.md[data-v-72f31a12] .md-file-link{appearance:none;display:inline;border:0;padding:0;background:transparent;color:var(--color-accent-hover);font:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;cursor:pointer}.md[data-v-72f31a12] .md-file-link:hover{color:var(--color-accent)}.md[data-v-72f31a12] .markdown-renderer p,.md[data-v-72f31a12] .markdown-renderer li,.md[data-v-72f31a12] .markdown-renderer blockquote,.md[data-v-72f31a12] .markdown-renderer td,.md[data-v-72f31a12] .markdown-renderer th{font-size:var(--content-font-size)}.md[data-v-72f31a12] .markdown-renderer img{background:var(--media-alpha-canvas)}.md[data-v-72f31a12] strong{color:color-mix(in srgb,var(--color-text) 86%,var(--color-text-muted));font-weight:var(--weight-semibold)}.md[data-v-72f31a12] h1,.md[data-v-72f31a12] h2,.md[data-v-72f31a12] h3,.md[data-v-72f31a12] h4{color:var(--color-text);font-optical-sizing:auto;font-weight:600;margin:.85em 0 .35em;line-height:var(--leading-tight)}.md[data-v-72f31a12] h1{font-size:max(var(--text-xl),calc(var(--content-font-size) + 3px));border-bottom:1px solid var(--color-line);padding-bottom:4px}.md[data-v-72f31a12] h2{font-size:max(var(--text-lg),calc(var(--content-font-size) + 2px))}.md[data-v-72f31a12] h3{font-size:max(var(--text-lg),calc(var(--content-font-size) + 1px))}.md[data-v-72f31a12] h4{font-size:max(var(--text-base),calc(var(--content-font-size) + 1px));color:var(--color-text-muted)}.md[data-v-72f31a12] p{margin:.8rem 0}.md[data-v-72f31a12] .node-slot+.node-slot{margin-top:.8rem}.md[data-v-72f31a12] ul,.md[data-v-72f31a12] ol{padding-left:1.4em;margin:.6em 0}.md[data-v-72f31a12] li{margin:.3em 0}.md[data-v-72f31a12] :not(pre)>code,.md[data-v-72f31a12] .inline-code{font:.9em var(--font-mono);background:var(--color-surface-sunken);color:var(--color-fg);padding:0 4px;border-radius:var(--radius-sm)}.md[data-v-72f31a12] strong code,.md[data-v-72f31a12] strong .inline-code,.md[data-v-72f31a12] b code,.md[data-v-72f31a12] b .inline-code{font-weight:var(--weight-semibold)}.md[data-v-72f31a12] .code-block-container{margin:.6em 0;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-sunken);box-shadow:var(--shadow-xs);overflow:hidden;--vscode-editor-font-size: var(--text-sm);--vscode-editor-line-height: calc(var(--text-sm) * 1.65)}.md[data-v-72f31a12] .code-block-header{background:var(--color-surface);border-bottom:1px solid var(--color-line);padding:4px 12px;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono)}.md[data-v-72f31a12] .code-block-header *{color:var(--color-text-muted);font:var(--text-xs) var(--font-mono)}.md[data-v-72f31a12] .code-block-header .code-header-main{font-family:var(--font-ui)}.md[data-v-72f31a12] .code-block-header .copy-button,.md[data-v-72f31a12] .code-block-header .code-action-btn{color:var(--color-text-muted);background:transparent;border:none;border-radius:var(--radius-sm);cursor:pointer;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.md[data-v-72f31a12] .code-block-header .copy-button:hover,.md[data-v-72f31a12] .code-block-header .code-action-btn:hover{background:var(--color-surface-sunken);color:var(--color-text)}.md[data-v-72f31a12] .code-block-header .copy-button:focus-visible,.md[data-v-72f31a12] .code-block-header .code-action-btn:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.md[data-v-72f31a12] .code-block-header .copy-button *,.md[data-v-72f31a12] .code-block-header .code-action-btn *{pointer-events:none}.md[data-v-72f31a12] .code-block-content,.md[data-v-72f31a12] .markstream-pre{background:var(--color-surface-sunken)}.md[data-v-72f31a12] .code-block-container pre:not(.code-pre-fallback):not(.markstream-pre--line-numbers),.md[data-v-72f31a12] .markstream-pre:not(.code-pre-fallback):not(.markstream-pre--line-numbers){margin:0;padding:12px 14px;overflow-x:auto;font:var(--text-sm)/1.65 var(--font-mono)}.md[data-v-72f31a12] .code-block-container pre code{font:inherit;color:var(--color-text);background:none;border:none;padding:0;border-radius:0}.md[data-v-72f31a12] .markstream-pre,.md[data-v-72f31a12] .code-pre-fallback,.md[data-v-72f31a12] .code-block-content pre:not(.shiki),.md[data-v-72f31a12] .code-block-content pre:not(.shiki) code{color:var(--color-text)}.md[data-v-72f31a12] a{color:var(--color-accent);text-decoration:none}.md[data-v-72f31a12] a:hover{text-decoration:underline}.md[data-v-72f31a12] .katex-display{overflow-x:auto;overflow-y:hidden;padding:2px 0 6px;margin:.6em 0}.md[data-v-72f31a12] blockquote{margin:.5em 0;padding:4px 12px;border-left:3px solid var(--color-line);color:var(--color-text-muted)}.md[data-v-72f31a12] hr{border:none;border-top:1px solid var(--color-line);margin:.8em 0}.md[data-v-72f31a12] table:not(.table-node){border-collapse:collapse;font-size:var(--text-lg);margin:.5em 0}.md[data-v-72f31a12] table:not(.table-node) th,.md[data-v-72f31a12] table:not(.table-node) td{border:1px solid var(--color-line);padding:4px 10px;text-align:left}.md[data-v-72f31a12] table:not(.table-node) th{background:var(--color-surface);color:var(--color-text);font-weight:var(--weight-medium)}.md[data-v-72f31a12] .table-node-wrapper{width:100%;max-width:100%!important;min-width:0;overflow-x:auto!important}.md[data-v-72f31a12] .table-node{--table-border: var(--color-line);--table-header-bg: var(--color-surface);font-size:var(--text-lg);margin:.5em 0;width:max-content!important;min-width:100%;max-width:none!important;table-layout:auto!important}.md[data-v-72f31a12] .table-node th,.md[data-v-72f31a12] .table-node td{text-align:left;vertical-align:top;max-width:var(--p-table-cell-max)}.md[data-v-72f31a12] .table-node .text-node{display:inline-block;max-width:var(--p-table-cell-max);vertical-align:top}.md[data-v-72f31a12] .table-node tbody tr:hover{background-color:transparent!important}.diff-wrap[data-v-72f31a12]{margin:.6em 0;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-sunken);box-shadow:var(--shadow-xs);overflow:hidden}.diff-bar[data-v-72f31a12]{display:flex;align-items:center;gap:6px;padding:4px 12px;background:var(--color-surface);border-bottom:1px solid var(--color-line);color:var(--color-text-muted);font:var(--text-xs) var(--font-mono)}.diff-lang[data-v-72f31a12]{margin-right:auto}.diff-copy[data-v-72f31a12]{display:inline-flex;align-items:center;justify-content:center;color:var(--color-text-muted);background:transparent;border:none;border-radius:var(--radius-sm);cursor:pointer;padding:2px 6px;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.diff-copy[data-v-72f31a12]:hover{background:var(--color-surface-sunken);color:var(--color-text)}.diff-copy[data-v-72f31a12]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.diff-pre[data-v-72f31a12]{margin:0;padding:12px 0;overflow-x:auto;background:var(--color-surface-sunken)}.diff-pre code[data-v-72f31a12]{display:block;width:max-content;min-width:100%;font:var(--text-sm)/1.65 var(--font-mono);color:var(--color-text)}.diff-line[data-v-72f31a12]{display:block;width:100%;padding:0 14px}.diff-sign[data-v-72f31a12]{display:inline-block;width:14px;text-align:center;color:var(--color-text-muted);user-select:none}.diff-text[data-v-72f31a12]{color:var(--color-text)}.diff-add[data-v-72f31a12]{background:var(--color-success-soft);box-shadow:inset 2px 0 color-mix(in srgb,var(--color-success) 55%,transparent)}.diff-add .diff-sign[data-v-72f31a12]{color:var(--color-success)}.diff-del[data-v-72f31a12]{background:var(--color-danger-soft);box-shadow:inset 2px 0 color-mix(in srgb,var(--color-danger) 55%,transparent)}.diff-del .diff-sign[data-v-72f31a12]{color:var(--color-danger)}.diff-hunk[data-v-72f31a12]{background:var(--color-surface)}.diff-hunk .diff-text[data-v-72f31a12]{color:var(--color-text-muted)}.md[data-v-72f31a12],.md .markdown-renderer[data-v-72f31a12]{font-family:var(--sans)}.md .code-block-container[data-v-72f31a12],.md .diff-wrap[data-v-72f31a12]{border-radius:var(--radius-md)}.md :not(pre)>code[data-v-72f31a12],.md .inline-code[data-v-72f31a12]{border-radius:var(--radius-sm)}.think[data-v-fdc551ea]{margin:0}.tc-wrap[data-v-fdc551ea]{display:grid;grid-template-rows:1fr 0fr;transition:grid-template-rows var(--duration-slow) var(--ease-out);cursor:pointer}.tc-wrap.is-collapsed[data-v-fdc551ea]{grid-template-rows:0fr 1fr}.tc-anim[data-v-fdc551ea],.prev-anim[data-v-fdc551ea]{overflow:hidden;min-height:0}.tc-wrap.is-collapsed:hover .prev[data-v-fdc551ea]{color:var(--color-text)}.tc-wrap:not(.is-collapsed):hover .tc[data-v-fdc551ea]{color:var(--color-text-muted)}.prev[data-v-fdc551ea]{color:var(--color-text-faint);font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:425;white-space:pre-wrap;word-break:break-word;display:block}.tc[data-v-fdc551ea]{font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:425;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word;margin:0;max-height:calc(var(--leading-relaxed) * 1em * 5);overflow-y:auto}.mob[data-v-fdc551ea]{margin:0}.mob .tc[data-v-fdc551ea]{color:var(--color-text-faint);line-height:var(--leading-normal);max-height:calc(var(--leading-normal) * 1em * 5)}.mob .prev[data-v-fdc551ea]{color:var(--color-text-faint);line-height:var(--leading-normal)}.activity-notice[data-v-0d497074]{display:inline-flex;align-items:center;gap:9px;align-self:flex-start;margin:0;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.msg-time[data-v-9672fbd5]{display:inline-flex;align-items:center;min-height:22px;box-sizing:border-box;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;white-space:nowrap}.msg-time[data-v-9672fbd5]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.cn[data-v-a62a6587]{margin:0;align-self:flex-end;max-width:78%;display:flex;flex-direction:column;align-items:flex-end}.cn-bubble[data-v-a62a6587]{box-sizing:border-box;max-width:100%;padding:8px 14px;background:var(--color-accent-soft);border:1px solid var(--color-accent-bd);border-radius:var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl);box-shadow:var(--shadow-xs);color:var(--color-text);font-size:var(--content-font-size);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.cn-title[data-v-a62a6587]{font-weight:var(--weight-medium)}.cn-meta[data-v-a62a6587]{display:flex;align-items:center;gap:6px;margin-top:4px;padding:0 4px;color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal)}.cn-meta-ico[data-v-a62a6587]{flex:none;color:var(--color-text-faint)}.cn-meta-item[data-v-a62a6587]{white-space:nowrap}.cn-status[data-v-a62a6587]{display:inline-flex;align-items:center}.cn-status.ok[data-v-a62a6587]{color:var(--color-success)}.cn-status.error[data-v-a62a6587]{color:var(--color-danger)}.att-chip[data-v-12ec975b]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:4px 9px 4px 5px;background:var(--color-bg);border:1px solid var(--color-line);border-radius:999px;font-size:var(--ui-font-size-sm);transition:border-color var(--duration-fast) ease}.att-chip[data-v-12ec975b]:hover{border-color:var(--color-line-strong)}.att-activate[data-v-12ec975b]{display:inline-flex;align-items:center;gap:6px;min-width:0;padding:0;border:none;background:transparent;color:inherit;font:inherit;cursor:pointer}.att-activate[data-v-12ec975b]:focus-visible{outline:none;box-shadow:var(--p-focus-ring);border-radius:999px}.att-tile[data-v-12ec975b]{width:20px;height:20px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--color-text-muted);background:var(--color-surface-sunken)}.att-tile[data-v-12ec975b] .att-thumb{width:100%;height:100%;object-fit:cover;display:block}.att-name[data-v-12ec975b]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-weight:var(--weight-medium)}.att-chip.is-error[data-v-12ec975b]{border-color:var(--color-danger-bd)}.att-chip.is-error .att-err[data-v-12ec975b]{flex:none;display:flex;align-items:center;color:var(--color-danger)}.att-rm[data-v-12ec975b]{flex:none;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--color-text-faint);cursor:pointer}.att-rm[data-v-12ec975b]:hover{background:var(--color-hover);color:var(--color-text)}.att-rm[data-v-12ec975b]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ui-moon[data-v-a6b7ec07]{display:inline-block;position:relative;line-height:1;user-select:none;flex:none}.ui-moon--sm[data-v-a6b7ec07]{width:14px;height:14px;font-size:14px}.ui-moon--md[data-v-a6b7ec07]{width:18px;height:18px;font-size:18px}.ui-moon--lg[data-v-a6b7ec07]{width:24px;height:24px;font-size:24px}.ui-moon__frame[data-v-a6b7ec07]{position:absolute;inset:0;display:block;text-align:center;opacity:0;animation-name:ui-moon-frame-a6b7ec07;animation-duration:.96s;animation-timing-function:steps(1,end);animation-iteration-count:infinite;animation-delay:var(--moon-frame-delay)}.ui-moon--fast .ui-moon__frame[data-v-a6b7ec07]{animation-duration:.48s;animation-delay:var(--moon-frame-fast-delay)}@keyframes ui-moon-frame-a6b7ec07{0%,12.49%{opacity:1}12.5%,to{opacity:0}}@media(prefers-reduced-motion:reduce){.ui-moon__frame[data-v-a6b7ec07]{animation:none;opacity:0}.ui-moon__frame[data-v-a6b7ec07]:nth-child(4){opacity:1}}.chat-empty[data-v-d2cc4eff]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px 16px;color:var(--faint);text-align:center}.chat-empty-text[data-v-d2cc4eff]{font-size:var(--ui-font-size-sm)}.chat-loading[data-v-d2cc4eff]{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px 16px;color:var(--muted)}.chat-loading-text[data-v-d2cc4eff]{font-size:var(--ui-font-size-sm)}.chat[data-v-d2cc4eff]{--chat-turn-gap: 16px;--chat-block-gap: 10px;--chat-section-gap: 18px;display:flex;flex-direction:column;gap:0;padding:16px 14px 20px;flex:1;min-height:0;position:relative}.chat .chat-empty[data-v-d2cc4eff]{align-self:stretch}.open-unsupported[data-v-d2cc4eff]{position:absolute;bottom:16px;left:50%;transform:translate(-50%);max-width:min(90%,480px);padding:6px 12px;border-radius:var(--radius-md);border:1px solid var(--color-line);background:var(--color-surface-raised);color:var(--color-text-muted);font-size:var(--ui-font-size-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:2}.chat>.u-turn[data-v-d2cc4eff],.chat>.a-msg[data-v-d2cc4eff],.chat>.compact-divider[data-v-d2cc4eff],.chat>.cron-notice[data-v-d2cc4eff],.chat>.sending-placeholder[data-v-d2cc4eff],.chat[data-v-d2cc4eff]>.activity-notice{margin-top:var(--chat-turn-gap)}.chat>.a-msg[data-v-d2cc4eff]{margin-top:10px}.chat>.u-turn[data-v-d2cc4eff]:first-child,.chat>.a-msg[data-v-d2cc4eff]:first-child,.chat>.compact-divider[data-v-d2cc4eff]:first-child,.chat>.cron-notice[data-v-d2cc4eff]:first-child,.chat>.sending-placeholder[data-v-d2cc4eff]:first-child,.chat[data-v-d2cc4eff]>.activity-notice:first-child{margin-top:0}.u-turn[data-v-d2cc4eff]{display:flex;flex-direction:column;align-items:flex-end;align-self:flex-start;width:100%}.u-bub[data-v-d2cc4eff]{align-self:flex-end;max-width:78%;background:var(--color-accent-soft);border:1px solid var(--color-accent-bd);color:var(--color-text);border-radius:var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl);padding:11px 15px;font-size:var(--content-font-size);line-height:var(--leading-normal);box-shadow:var(--shadow-xs)}.u-meta[data-v-d2cc4eff]{align-self:flex-end;display:flex;justify-content:flex-end;align-items:center;max-width:78%;margin-top:2px;margin-right:4px}.u-meta .u-edit[data-v-d2cc4eff]{min-height:22px;box-sizing:border-box}.u-text[data-v-d2cc4eff]{white-space:pre-wrap;overflow-wrap:anywhere}.u-edit[data-v-d2cc4eff]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s}.u-edit svg[data-v-d2cc4eff]{display:block;flex:none}.u-edit[data-v-d2cc4eff]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-copy[data-v-d2cc4eff]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.u-copy svg[data-v-d2cc4eff]{display:block;flex:none}.u-copy[data-v-d2cc4eff]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-edit-wrap[data-v-d2cc4eff]{display:flex;justify-content:flex-end}.chat>.u-edit-wrap[data-v-d2cc4eff]{margin-top:4px}.chat>.u-edit-wrap+.a-msg[data-v-d2cc4eff]{margin-top:8px}.compact-divider[data-v-d2cc4eff]{display:flex;align-items:center;gap:10px;align-self:stretch;width:100%;margin:var(--chat-section-gap) 0 0}.chat>.compact-divider[data-v-d2cc4eff]:first-child{margin-top:0}.cd-line[data-v-d2cc4eff]{flex:1;height:1px;background:var(--line)}.cd-label[data-v-d2cc4eff]{flex:none;display:inline-flex;align-items:center;gap:8px;max-width:80%;font-size:var(--text-base);color:var(--muted);white-space:nowrap}.cd-btn[data-v-d2cc4eff]{background:none;border:none;padding:0;cursor:pointer;font:inherit;font-size:var(--text-base);color:var(--muted)}.cd-view[data-v-d2cc4eff]{color:var(--color-accent)}.cd-btn:hover .cd-view[data-v-d2cc4eff]{text-decoration:underline}.a-msg[data-v-d2cc4eff]{align-self:flex-start;max-width:94%;width:94%}.a-msg-ft[data-v-d2cc4eff]{display:flex;justify-content:flex-start;align-items:center;gap:8px;height:auto;margin-top:var(--chat-block-gap);overflow:visible}.a-duration[data-v-d2cc4eff]{display:inline-flex;align-items:center;font-size:var(--text-base);color:var(--muted);line-height:1}.a-cpbtn[data-v-d2cc4eff]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.a-cpbtn[data-v-d2cc4eff]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.a-cpbtn svg[data-v-d2cc4eff]{display:block;flex:none}@media(hover:none){.a-msg-ft[data-v-d2cc4eff]{height:auto;margin-top:var(--chat-block-gap);opacity:1;pointer-events:auto}.a-cpbtn[data-v-d2cc4eff]{font-size:var(--ui-font-size-sm);padding:8px 10px;margin:-4px -6px}}.a-msg .msg[data-v-d2cc4eff]{font-size:var(--ui-font-size);line-height:1.6;color:var(--color-text);font-weight:500}.a-msg .msg[data-v-d2cc4eff] p{margin:0}.a-msg .msg[data-v-d2cc4eff] p+p{margin-top:8px}.a-msg>.msg[data-v-d2cc4eff],.a-msg[data-v-d2cc4eff]>.think,.a-msg[data-v-d2cc4eff]>.tool-group,.a-msg[data-v-d2cc4eff]>.agent-card,.a-msg[data-v-d2cc4eff]>.agent-group,.a-msg[data-v-d2cc4eff]>.box,.a-msg[data-v-d2cc4eff]>.swarm-card,.a-msg[data-v-d2cc4eff]>.media-tool{margin-top:var(--chat-block-gap)}.a-msg>.msg[data-v-d2cc4eff]:first-child,.a-msg[data-v-d2cc4eff]>.think:first-child,.a-msg[data-v-d2cc4eff]>.tool-group:first-child,.a-msg[data-v-d2cc4eff]>.agent-card:first-child,.a-msg[data-v-d2cc4eff]>.agent-group:first-child,.a-msg[data-v-d2cc4eff]>.box:first-child,.a-msg[data-v-d2cc4eff]>.swarm-card:first-child,.a-msg[data-v-d2cc4eff]>.media-tool:first-child{margin-top:0}.a-msg[data-v-d2cc4eff] code{font:.9em var(--font-mono);background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-sm);padding:1px 6px;color:var(--color-accent-hover)}@container (min-width: 760px){.a-msg .msg[data-v-d2cc4eff] .markstream-vue.markdown-renderer:has(.table-node-wrapper){content-visibility:visible}.a-msg .msg[data-v-d2cc4eff] .table-node-wrapper{position:relative;left:50%;width:max-content;min-width:100%;max-width:min(var(--p-table-max),calc(100cqi - var(--space-5) - var(--space-5)))!important;transform:translate(-50%)}}.u-atts[data-v-d2cc4eff]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.sending-placeholder[data-v-d2cc4eff]{align-self:flex-start;padding:10px 0}.skill-act[data-v-d2cc4eff]{display:flex;flex-direction:column;gap:2px}.skill-act-head[data-v-d2cc4eff]{font-size:var(--ui-font-size-sm);font-weight:500;color:var(--color-accent-hover);display:flex;align-items:center;gap:6px}.skill-act-arrow[data-v-d2cc4eff]{color:var(--color-accent);font-size:var(--text-base)}.skill-act-args[data-v-d2cc4eff]{font-size:var(--text-base);color:var(--muted);padding-left:17px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:640px){.chat[data-v-d2cc4eff]{box-sizing:border-box;width:100%;padding:14px max(12px,var(--safe-right)) 18px max(12px,var(--safe-left))}.u-bub[data-v-d2cc4eff]{max-width:min(88%,calc(100vw - 52px))}.a-msg[data-v-d2cc4eff]{width:100%;max-width:100%}.u-bub .u-text[data-v-d2cc4eff],.a-msg .msg[data-v-d2cc4eff]{font-size:var(--ui-font-size-xl)}.a-msg[data-v-d2cc4eff] .md,.a-msg[data-v-d2cc4eff] .markdown-renderer,.a-msg[data-v-d2cc4eff] .code-block-container,.a-msg[data-v-d2cc4eff] .diff-wrap,.a-msg[data-v-d2cc4eff] pre{max-width:100%}.a-msg[data-v-d2cc4eff] .code-block-container pre,.a-msg[data-v-d2cc4eff] .diff-pre{overflow-x:auto;-webkit-overflow-scrolling:touch}.a-msg[data-v-d2cc4eff] .media-tool.mob{width:min(44vw,160px)}.cd-label[data-v-d2cc4eff]{min-width:0;max-width:calc(100% - 48px);overflow:hidden;text-overflow:ellipsis}.u-edit-confirm[data-v-d2cc4eff]{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100vw - 28px)}.ts[data-v-d2cc4eff]{font-size:var(--ui-font-size-sm)}.chat-empty-text[data-v-d2cc4eff],.chat-loading-text[data-v-d2cc4eff]{font-size:var(--ui-font-size-lg)}.cd-label[data-v-d2cc4eff],.cd-btn[data-v-d2cc4eff]{font-size:var(--ui-font-size)}}.top-sentinel[data-v-d2cc4eff]{display:flex;align-items:center;justify-content:center;padding:12px 0;min-height:28px}.top-sentinel-loading[data-v-d2cc4eff]{opacity:.8}.top-sentinel-btn[data-v-d2cc4eff]{appearance:none;border:1px solid var(--border);background:transparent;color:var(--muted);font-size:var(--ui-font-size-sm);padding:4px 12px;border-radius:999px;cursor:pointer;transition:color .15s ease,border-color .15s ease}.top-sentinel-btn[data-v-d2cc4eff]:hover{color:var(--fg);border-color:var(--fg)}.top-sentinel-text[data-v-d2cc4eff]{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:var(--ui-font-size-sm)}.chat[data-v-d2cc4eff]{background:transparent}.chat[data-v-d2cc4eff]{gap:0;padding:22px 20px 26px}.u-bub[data-v-d2cc4eff]{background:var(--color-accent-soft);border-color:var(--color-accent-bd);border-radius:var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl);padding:11px 15px;box-shadow:var(--shc)}.a-msg[data-v-d2cc4eff]{max-width:100%;width:100%}.chat>.q-stack[data-v-d2cc4eff]{margin-top:var(--chat-turn-gap)}.chat>.q-stack[data-v-d2cc4eff]:first-child{margin-top:0}.q-stack[data-v-d2cc4eff]{align-self:flex-end;width:100%;display:flex;flex-direction:column;gap:8px}.q-head[data-v-d2cc4eff]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 6px;color:var(--color-text-faint);font-size:var(--ui-font-size-xs)}.q-title[data-v-d2cc4eff]{display:inline-flex;align-items:center;gap:6px}.q-title b[data-v-d2cc4eff]{color:var(--color-accent-hover);font-weight:var(--weight-medium)}.q-hint[data-v-d2cc4eff]{color:var(--color-text-faint)}.q-turn[data-v-d2cc4eff]{position:relative}.q-bub[data-v-d2cc4eff]{display:flex;align-items:center;gap:8px;width:fit-content;background:var(--color-surface-raised);border:1px dashed var(--color-accent-bd);padding:8px 8px 8px 6px;transition:border-color .12s ease,background .12s ease}.q-bub[data-v-d2cc4eff]:hover{border-color:var(--color-accent);background:var(--color-accent-soft)}.q-grip[data-v-d2cc4eff]{flex:none;display:inline-flex;align-items:center;padding:2px;color:var(--color-text-faint);cursor:grab;opacity:.7}.q-grip[data-v-d2cc4eff]:hover{opacity:1}.q-grip[data-v-d2cc4eff]:active{cursor:grabbing}.q-body[data-v-d2cc4eff]{flex:1;min-width:0;background:none;border:none;padding:0;margin:0;font:inherit;color:var(--color-text);text-align:left;cursor:pointer;opacity:.82}.q-bub:hover .q-body[data-v-d2cc4eff]{opacity:1}.q-body[data-v-d2cc4eff]:disabled{cursor:default}.q-text[data-v-d2cc4eff]{white-space:pre-wrap;overflow-wrap:anywhere}.q-text-placeholder[data-v-d2cc4eff]{display:inline-flex;align-items:center;gap:4px;color:var(--color-text-muted)}.q-imgs[data-v-d2cc4eff]{display:flex;gap:4px;flex:none}.q-img[data-v-d2cc4eff]{width:28px;height:28px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--color-line)}.q-file[data-v-d2cc4eff]{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 6px;border-radius:var(--radius-sm);border:1px solid var(--color-line);color:var(--color-text-muted);font-size:calc(var(--ui-font-size) - 3px);max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.q-tag[data-v-d2cc4eff]{flex:none;padding:1px 6px;border-radius:var(--radius-full);font-size:var(--ui-font-size-xs);font-weight:var(--weight-medium);line-height:1.4;white-space:nowrap}.q-tag-next[data-v-d2cc4eff]{color:var(--color-accent-hover);background:var(--color-accent-soft);border:1px solid var(--color-accent-bd)}.q-tag-idx[data-v-d2cc4eff]{color:var(--color-text-faint);background:var(--color-surface-sunken);border:1px solid var(--color-line)}.q-rm[data-v-d2cc4eff]{flex:none;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text-faint);cursor:pointer;opacity:0;transition:opacity .12s ease,background .12s ease,color .12s ease}.q-bub:hover .q-rm[data-v-d2cc4eff],.q-bub:focus-within .q-rm[data-v-d2cc4eff],.q-rm[data-v-d2cc4eff]:focus-visible{opacity:1}.q-rm[data-v-d2cc4eff]:hover{background:var(--color-danger-soft);color:var(--color-danger)}.q-turn.q-dragging .q-bub[data-v-d2cc4eff]{opacity:.45}.q-turn.drop-before[data-v-d2cc4eff]:before,.q-turn.drop-after[data-v-d2cc4eff]:after{content:"";position:absolute;left:0;right:0;height:2px;background:var(--color-accent);border-radius:var(--radius-full);z-index:1}.q-turn.drop-before[data-v-d2cc4eff]:before{top:-5px}.q-turn.drop-after[data-v-d2cc4eff]:after{bottom:-5px}.chat-header[data-v-fa4451d4]{flex:none;display:flex;align-items:center;gap:14px;height:48px;padding:0 16px;border-bottom:1px solid var(--color-line);background:var(--color-bg);font-family:var(--font-ui);min-width:0}.chat-header.macos-desktop[data-v-fa4451d4]{-webkit-app-region:drag}.chat-header.macos-desktop button[data-v-fa4451d4],.chat-header.macos-desktop input[data-v-fa4451d4]{-webkit-app-region:no-drag}.ch-id[data-v-fa4451d4]{display:flex;align-items:center;gap:6px;min-width:0;flex:none;max-width:46%}.ch-ws[data-v-fa4451d4]{color:var(--color-text-muted);font-size:var(--text-base);font-weight:var(--weight-medium);flex:none}.ch-sep[data-v-fa4451d4]{color:var(--color-text-faint);flex:none}.ch-ses[data-v-fa4451d4]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ch-rename[data-v-fa4451d4]{flex:1;min-width:0;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none}.ch-git[data-v-fa4451d4]{display:flex;align-items:center;gap:4px;border:none;background:transparent;padding:0;color:var(--muted);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 2px);flex:0 1 auto;max-width:none;min-width:0;cursor:pointer}.ch-git:hover .ch-branch[data-v-fa4451d4]{color:var(--color-text)}.ch-branch[data-v-fa4451d4]{color:var(--dim);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:4px}.ch-detached[data-v-fa4451d4]{color:var(--muted);font-style:italic}.ch-pill[data-v-fa4451d4]{display:inline-flex;align-items:center;gap:3px;padding:1px 5px;border-radius:999px;background:var(--panel);border:1px solid var(--line);font-size:calc(var(--ui-font-size) - 3px)}.ch-sync-pill[data-v-fa4451d4]{border-color:var(--line)}.ch-diff-pill[data-v-fa4451d4]{border-color:color-mix(in srgb,var(--color-success) 20%,var(--line))}.ch-ahead[data-v-fa4451d4]{color:var(--color-warning);flex:none}.ch-behind[data-v-fa4451d4]{color:var(--color-accent-hover);flex:none}.ch-add[data-v-fa4451d4]{color:var(--color-success);flex:none}.ch-del[data-v-fa4451d4]{color:var(--color-danger);flex:none}.ch-spacer[data-v-fa4451d4]{flex:1;min-width:0}.ch-act-more.open[data-v-fa4451d4]{background:var(--color-surface-sunken);color:var(--color-text)}.ch-pr[data-v-fa4451d4]{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 9px;flex:none;border:1px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-surface-sunken);color:var(--color-text-muted);font-size:var(--text-xs);font-weight:500;cursor:pointer}.ch-pr svg[data-v-fa4451d4]{flex:none}.ch-pr.pr-open[data-v-fa4451d4]{color:var(--color-success);border-color:var(--color-success-bd);background:var(--color-success-soft)}.ch-pr.pr-merged[data-v-fa4451d4]{color:var(--color-done);border-color:var(--color-done-bd);background:var(--color-done-soft)}.ch-pr.pr-closed[data-v-fa4451d4]{color:var(--color-danger);border-color:var(--color-danger-bd);background:var(--color-danger-soft)}.ch-pr.pr-draft[data-v-fa4451d4],.ch-pr.pr-unknown[data-v-fa4451d4]{color:var(--color-text-muted);border-color:var(--color-line-strong);background:var(--color-surface-sunken)}.ch-pr[data-v-fa4451d4]:hover{border-color:var(--color-line-strong)}.ch-menu[data-v-fa4451d4]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}@media(max-width:980px){.ch-act-label[data-v-fa4451d4]{display:none}}@media(max-width:640px){.chat-header[data-v-fa4451d4]{display:none}}.slash-menu[role=listbox][data-v-f60b70d9]{position:absolute;bottom:calc(100% + 4px);left:0;right:0;padding:var(--space-1);background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);z-index:var(--z-dropdown);max-height:240px;overflow-y:auto}.slash-item[data-v-f60b70d9]{display:grid;grid-template-columns:minmax(90px,32%) minmax(0,1fr);align-items:start;gap:10px;padding:6px 10px;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);border-radius:var(--radius-sm)}.slash-item[data-v-f60b70d9]:hover{background:var(--color-surface-sunken)}.slash-item.active[data-v-f60b70d9]{background:var(--color-accent-soft)}.slash-item.active .slash-name[data-v-f60b70d9]{color:var(--color-accent-hover)}.slash-name[data-v-f60b70d9]{color:var(--color-accent);font-weight:500;min-width:0;line-height:var(--leading-normal);overflow-wrap:anywhere}.slash-desc[data-v-f60b70d9]{color:var(--color-text-muted);font-size:var(--text-xs);min-width:0;line-height:var(--leading-normal);overflow-wrap:anywhere}@media(max-width:520px){.slash-item[data-v-f60b70d9]{grid-template-columns:minmax(0,1fr);gap:2px}}.slash-menu[data-v-f60b70d9]{border-radius:var(--radius-lg);box-shadow:var(--sh)}.slash-desc[data-v-f60b70d9]{font-family:var(--sans)}.mention-menu[role=listbox][data-v-f4d6b958]{position:absolute;bottom:calc(100% + 4px);left:0;right:0;padding:var(--space-1);background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);z-index:var(--z-dropdown);max-height:220px;overflow-y:auto}.mention-state[data-v-f4d6b958]{padding:8px 12px;font-family:var(--font-ui);font-size:var(--text-sm)}.dim[data-v-f4d6b958]{color:var(--color-text-muted)}.mention-item[data-v-f4d6b958]{display:flex;align-items:center;gap:8px;padding:6px 10px;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);border-radius:var(--radius-sm)}.mention-icon[data-v-f4d6b958]{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;color:var(--color-text-faint);flex-shrink:0}.mention-icon[data-v-f4d6b958] svg{width:13px;height:13px;display:block}.mention-item:hover .mention-icon[data-v-f4d6b958],.mention-item.active .mention-icon[data-v-f4d6b958]{color:var(--color-text-muted)}.mention-item[data-v-f4d6b958]:hover{background:var(--color-surface-sunken)}.mention-item.active[data-v-f4d6b958]{background:var(--color-accent-soft)}.mention-name[data-v-f4d6b958]{color:var(--color-text);font-weight:500;min-width:80px;flex-shrink:0}.mention-path[data-v-f4d6b958]{color:var(--color-text-muted);font-size:var(--text-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mention-menu[data-v-f4d6b958]{border-radius:var(--radius-lg);box-shadow:var(--sh)}.mention-state[data-v-f4d6b958]{font-family:var(--sans)}.ui-button[data-v-e58393a8]{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);border:1px solid transparent;border-radius:var(--radius-md);font-family:var(--font-ui);font-weight:var(--weight-medium);line-height:1;cursor:pointer;white-space:nowrap;transition:background var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.ui-button[data-v-e58393a8]:focus-visible{outline:none;box-shadow:var(--p-focus-ring-strong)}.ui-button[data-v-e58393a8]:not(:disabled):active{transform:scale(.98)}.ui-button[data-v-e58393a8]:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}.ui-button--sm[data-v-e58393a8]{height:30px;padding:0 var(--space-3);font-size:var(--text-sm);border-radius:var(--radius-sm)}.ui-button--md[data-v-e58393a8]{height:36px;padding:0 var(--space-4);font-size:var(--text-base)}.ui-button--lg[data-v-e58393a8]{height:42px;padding:0 var(--space-5);font-size:15px;border-radius:var(--radius-lg)}.ui-button__content[data-v-e58393a8]{display:inline-flex;align-items:center;gap:var(--space-2)}.ui-button__content[data-v-e58393a8] svg{flex:none}.ui-button__content[data-v-e58393a8] svg:not([width]){width:1em;height:1em}.ui-button--primary[data-v-e58393a8]{background:var(--color-accent);color:var(--color-text-on-accent);border-color:var(--color-accent);box-shadow:var(--shadow-xs)}.ui-button--primary[data-v-e58393a8]:not(:disabled):hover{background:var(--color-accent-hover);border-color:var(--color-accent-hover)}.ui-button--secondary[data-v-e58393a8]{background:var(--color-surface-raised);color:var(--color-text);border-color:var(--color-line-strong);box-shadow:var(--shadow-xs)}.ui-button--secondary[data-v-e58393a8]:not(:disabled):hover{border-color:var(--color-line-strong);background:var(--color-surface-sunken)}.ui-button--ghost[data-v-e58393a8]{background:transparent;color:var(--color-text-muted);border-color:transparent}.ui-button--ghost[data-v-e58393a8]:not(:disabled):hover{background:var(--color-surface-sunken);color:var(--color-text)}.ui-button--danger[data-v-e58393a8]{background:var(--color-danger);color:var(--color-text-on-accent);border-color:var(--color-danger);box-shadow:var(--shadow-xs)}.ui-button--danger[data-v-e58393a8]:not(:disabled):hover{filter:brightness(.96)}.ui-button--danger-soft[data-v-e58393a8]{background:var(--color-danger-soft);color:var(--color-danger);border-color:var(--color-danger-bd)}.ui-button--danger-soft[data-v-e58393a8]:not(:disabled):hover{background:var(--color-danger);color:var(--color-text-on-accent);border-color:var(--color-danger)}.ui-button.is-loading .ui-button__content[data-v-e58393a8]{opacity:.7}.ui-button .ui-button__spinner[data-v-e58393a8]{flex:none;color:inherit}.ui-button__spinner[data-v-e58393a8] .ui-spinner__track{opacity:.35}.ctx-ring[data-v-a364f1f1]{width:16px;height:16px;flex:none;transform:rotate(-90deg)}.ctx-ring-track[data-v-a364f1f1]{stroke:var(--line)}.ctx-ring-fill[data-v-a364f1f1]{stroke:var(--color-accent);transition:stroke-dashoffset .3s ease,stroke .3s ease}.composer[data-v-a89f6a49]{padding:7px var(--dock-inline-right, 16px) 12px var(--dock-inline-left, 16px);background:transparent;transition:background .12s}.composer.drag-over[data-v-a89f6a49]{background:var(--color-accent-soft)}.drop-overlay[data-v-a89f6a49]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--color-bg) 72%,transparent);pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--duration-base) ease,visibility var(--duration-base)}.drop-overlay.show[data-v-a89f6a49]{opacity:1;visibility:visible}.drop-card[data-v-a89f6a49]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-6);border-radius:var(--radius-lg);border:1.5px dashed var(--color-accent);background:var(--color-bg);color:var(--color-accent);font-size:var(--ui-font-size-lg);font-weight:var(--weight-medium);box-shadow:var(--shadow-md)}.composer-card[data-v-a89f6a49]{--composer-send-size: 32px;--composer-send-inset: var(--space-2);position:relative;border:1px solid var(--line);border-radius:calc((var(--composer-send-size) / 2) + var(--composer-send-inset) + var(--space-3));corner-shape:superellipse(1.5);background:var(--bg);box-shadow:var(--shadow-md);transition:border-color .15s,box-shadow .15s}.composer-card[data-v-a89f6a49]:focus-within{border-color:var(--color-accent);box-shadow:var(--shadow-md),0 0 0 3px var(--color-accent-soft)}.att-strip[data-v-a89f6a49]{display:flex;flex-wrap:wrap;gap:6px;padding:4px 0 6px}.att-lightbox[data-v-a89f6a49]{position:fixed;inset:0;z-index:var(--z-overlay);display:flex;align-items:center;justify-content:center;padding:24px;background:#14171c9e}.att-lightbox-card[data-v-a89f6a49]{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:min(960px,calc(100vw - 48px));max-height:calc(100vh - 48px)}.att-lightbox-media[data-v-a89f6a49]{max-width:100%;max-height:calc(100vh - 96px);border-radius:6px;background:var(--bg);box-shadow:var(--shadow-xl);object-fit:contain}.att-lightbox-name[data-v-a89f6a49]{max-width:100%;color:var(--color-text-on-accent);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 2px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.att-lightbox-close[data-v-a89f6a49]{position:absolute;top:-14px;right:-14px;width:28px;height:28px;border:1px solid rgba(255,255,255,.45);border-radius:50%;background:#14171cd1;color:var(--color-text-on-accent);cursor:pointer}.file-input-hidden[data-v-a89f6a49]{display:none}.cin-wrap[data-v-a89f6a49]{position:relative;padding:14px 16px 8px}.input-row[data-v-a89f6a49]{display:flex;align-items:flex-start;gap:var(--space-2)}.expand-btn[data-v-a89f6a49]{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--dim);cursor:pointer;padding:0;transition:background .12s,color .12s}.expand-btn[data-v-a89f6a49]:hover{background:var(--panel2);color:var(--color-text)}.expand-btn[data-v-a89f6a49]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.ph[data-v-a89f6a49]{color:var(--faint);caret-color:var(--color-text);flex:1;border:none;outline:none;resize:none;font-family:var(--font-ui);font-size:var(--content-font-size);background:transparent;min-height:36px;max-height:25vh;overflow-y:auto;line-height:1.5;margin-bottom:6px}.ph[data-v-a89f6a49]::placeholder{color:var(--muted)}.ph[data-v-a89f6a49]:not(:placeholder-shown){color:var(--color-text)}.composer.expanded .ph[data-v-a89f6a49]{min-height:70vh;max-height:70vh}.compact-chip[data-v-a89f6a49]{background:none;border:1px solid var(--line);border-radius:var(--radius-xs);color:var(--color-warning);font-family:var(--mono);font-size:var(--ui-font-size);padding:0 4px;cursor:pointer;height:19px;line-height:17px;flex:none}.compact-chip[data-v-a89f6a49]:hover{background:var(--panel2)}.send[data-v-a89f6a49]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:50%;background:var(--color-accent);color:var(--color-text-on-accent);border:none;box-shadow:var(--shadow-xs);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;margin-left:var(--space-2);transition:background .25s ease,transform .12s ease;position:relative}.send[data-v-a89f6a49]:hover{background:var(--color-accent-hover)}.send[data-v-a89f6a49]:active{transform:scale(.92)}.send[data-v-a89f6a49]:disabled{cursor:not-allowed;opacity:.88}.send[data-v-a89f6a49]:disabled:active{transform:none}.send.is-starting[data-v-a89f6a49] .ui-spinner{color:var(--color-text-on-accent)}.send.is-starting[data-v-a89f6a49] .ui-spinner__track{stroke:#ffffff52}.send svg[data-v-a89f6a49]{flex:none;width:var(--p-ic-lg);height:var(--p-ic-lg)}.stop[data-v-a89f6a49]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:50%;background:var(--color-danger-soft);color:var(--color-danger);border:1px solid var(--color-danger-bd);box-shadow:var(--shadow-xs);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;margin-left:var(--space-2);transition:background .16s ease,color .16s ease,border-color .16s ease,transform .12s ease}.stop[data-v-a89f6a49]:hover{background:var(--color-danger);color:var(--color-text-on-accent);border-color:var(--color-danger)}.stop[data-v-a89f6a49]:active{transform:scale(.92)}.stop svg[data-v-a89f6a49]{flex:none;width:var(--p-ic-lg);height:var(--p-ic-lg)}.toolbar[data-v-a89f6a49]{display:flex;align-items:center;justify-content:space-between;padding:6px var(--composer-send-inset) var(--composer-send-inset);position:relative}.menu-measure[data-v-a89f6a49]{position:absolute;width:max-content;height:0;overflow:hidden;visibility:hidden;pointer-events:none}.toolbar-left[data-v-a89f6a49],.toolbar-right[data-v-a89f6a49]{display:flex;align-items:center;gap:2px;min-width:0;overflow:hidden}.perm-pill[data-v-a89f6a49]{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:var(--ui-font-size);color:var(--color-text);cursor:pointer;user-select:none;transition:background .1s,color .15s;font-family:var(--font-ui);font-weight:var(--weight-medium)}.perm-pill[data-v-a89f6a49]:hover{background:var(--color-surface-sunken)}.perm-pill.open[data-v-a89f6a49]{background:var(--color-accent-soft)}.perm-pill.perm-manual[data-v-a89f6a49]{color:var(--dim)}.perm-pill.perm-yolo[data-v-a89f6a49]{color:var(--color-warning)}.perm-pill.perm-auto[data-v-a89f6a49]{color:var(--color-danger)}.ctx-group[data-v-a89f6a49]{display:flex;align-items:center;gap:4px;flex-shrink:0;padding:2px 4px;border-radius:var(--radius-xs)}.ctx-group[data-v-a89f6a49]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.model-pill[data-v-a89f6a49]{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:6px;font-size:var(--ui-font-size);line-height:var(--leading-normal);color:var(--dim);font-family:var(--font-ui);font-weight:var(--weight-medium);cursor:pointer;user-select:none;transition:background .1s;position:relative;overflow:hidden}.model-pill[data-v-a89f6a49]:hover{background:var(--color-surface-sunken);color:var(--color-text)}.model-pill.open[data-v-a89f6a49]{background:var(--color-accent-soft)}.model-pill b[data-v-a89f6a49]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:280px}.model-pill .think-suffix[data-v-a89f6a49]{color:var(--color-accent);font-weight:500;flex-shrink:0}.model-pill .cv[data-v-a89f6a49]{color:var(--faint);flex:none}.model-pill:hover .cv[data-v-a89f6a49],.model-pill.open .cv[data-v-a89f6a49]{color:var(--color-accent-hover)}.model-dropdown[data-v-a89f6a49]{position:absolute;bottom:calc(100% + 4px);right:10px;z-index:var(--z-dropdown);min-width:200px;background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:5px;display:flex;flex-direction:column;gap:1px;font-family:var(--font-ui)}.md-section[data-v-a89f6a49]{padding:4px 7px 2px;font-size:var(--text-xs);color:var(--muted);text-transform:uppercase;letter-spacing:0;font-weight:var(--weight-semibold)}.md-row[data-v-a89f6a49]{display:flex;align-items:center;gap:7px;width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);padding:5px 7px;border-radius:6px;text-align:left}.md-row[data-v-a89f6a49]:hover{background:var(--color-surface-sunken)}.md-row[data-v-a89f6a49]:disabled{cursor:default;opacity:.58}.md-row[data-v-a89f6a49]:disabled:hover{background:none}.md-row.is-current[data-v-a89f6a49]{color:var(--color-text);background:var(--color-accent-soft)}.md-row.is-on[data-v-a89f6a49]{color:var(--color-accent)}.md-note[data-v-a89f6a49]{margin-left:auto;color:var(--muted);font-size:var(--ui-font-size-xs)}.md-row-more[data-v-a89f6a49]{color:var(--color-accent);font-weight:500}.md-row-more[data-v-a89f6a49]:hover{background:var(--color-accent-soft)}.md-check[data-v-a89f6a49]{width:14px;flex:none;color:var(--color-accent);font-weight:500;display:flex;justify-content:center}.md-name[data-v-a89f6a49]{flex:1}.md-provider[data-v-a89f6a49]{color:var(--muted);font-size:var(--ui-font-size-xs);flex:none}.md-star[data-v-a89f6a49]{color:var(--star);flex:none;margin-left:auto}.md-divider[data-v-a89f6a49]{height:1px;background:var(--line);margin:3px 0}.md-thinking[data-v-a89f6a49]{display:flex;align-items:center;gap:8px;padding:6px 7px;border-radius:var(--radius-sm)}.md-thinking .md-name[data-v-a89f6a49]{font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);flex:none}.md-thinking .md-note[data-v-a89f6a49]{margin-left:auto}.effort-segments[data-v-a89f6a49]{margin-left:auto;display:inline-flex;align-items:center;gap:1px;padding:2px;background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-md)}.effort-seg[data-v-a89f6a49]{appearance:none;border:none;background:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-font-size-xs);line-height:1;color:var(--color-text-muted);padding:4px 9px;border-radius:var(--radius-sm);white-space:nowrap;transition:background .12s,color .12s,box-shadow .12s}.effort-seg[data-v-a89f6a49]:hover:not(:disabled):not(.is-active){background:var(--color-surface-raised);color:var(--color-text)}.effort-seg[data-v-a89f6a49]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.effort-seg.is-active[data-v-a89f6a49]{background:var(--color-accent);color:var(--color-text-on-accent);box-shadow:var(--shadow-xs);font-weight:500}.effort-seg[data-v-a89f6a49]:disabled{cursor:default}.md-thinking.is-readonly .effort-segments[data-v-a89f6a49]{opacity:.62}.md-cache-note[data-v-a89f6a49]{width:0;min-width:100%;padding:2px 7px 4px;color:var(--muted);font-size:var(--ui-font-size-xs);line-height:1.4}.md-thinking.is-readonly .effort-seg.is-active[data-v-a89f6a49]{background:var(--color-surface-raised);color:var(--color-text-muted);box-shadow:none}.perm-dropdown[data-v-a89f6a49]{position:absolute;bottom:calc(100% + 4px);left:10px;z-index:var(--z-dropdown);min-width:220px;width:max-content;max-width:calc(100vw - var(--space-8));background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:5px;display:flex;flex-direction:column;gap:1px}.pd-row[data-v-a89f6a49]{display:grid;grid-template-columns:14px var(--composer-menu-desc-width, max-content);column-gap:7px;row-gap:2px;align-items:start;width:100%;background:none;border:none;cursor:pointer;padding:6px 7px;border-radius:6px;text-align:left}.pd-row[data-v-a89f6a49]:hover{background:var(--color-surface-sunken)}.pd-row.is-current[data-v-a89f6a49]{background:var(--color-accent-soft)}.pd-check[data-v-a89f6a49]{grid-column:1;grid-row:1;width:14px;min-height:1lh;color:var(--color-accent);font-size:var(--ui-font-size);font-weight:var(--weight-medium);display:flex;align-items:center;justify-content:center;line-height:var(--leading-normal)}.pd-info[data-v-a89f6a49]{display:contents}.pd-name[data-v-a89f6a49]{grid-column:2;grid-row:1;font-family:var(--font-ui);font-size:var(--ui-font-size);font-weight:var(--weight-medium);line-height:var(--leading-normal)}.pd-desc[data-v-a89f6a49]{grid-column:2;grid-row:2;width:var(--composer-menu-desc-width, auto);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-medium);color:var(--muted);line-height:var(--leading-normal)}.modes[data-v-a89f6a49]{position:relative;display:inline-flex;z-index:var(--z-sticky)}.mode-pill[data-v-a89f6a49]{display:inline-flex;align-items:center;gap:6px;padding:2px 9px;border:none;background:none;border-radius:6px;font-size:var(--ui-font-size);font-family:var(--font-ui);font-weight:var(--weight-medium);color:var(--color-text);cursor:pointer;user-select:none;transition:background .1s,color .15s}.mode-pill[data-v-a89f6a49]:hover{background:var(--color-surface-sunken)}.mode-pill.on[data-v-a89f6a49]{background:var(--color-accent-soft);color:var(--color-accent-hover)}.mode-pill.open[data-v-a89f6a49]{background:var(--color-accent-soft)}.mode-label[data-v-a89f6a49]{flex:none}.mode-tag[data-v-a89f6a49]{flex:none;font-family:var(--font-ui);font-size:calc(var(--ui-font-size) - 3px);color:var(--color-accent-hover);background:var(--bg);border:1px solid var(--color-accent-bd);border-radius:999px;padding:0 6px;line-height:16px}.mode-dot[data-v-a89f6a49]{width:6px;height:6px;border-radius:50%;background:var(--color-accent);flex:none}.modes-menu[data-v-a89f6a49]{position:fixed;z-index:var(--z-dropdown);min-width:220px;width:max-content;max-width:calc(100vw - var(--space-8));background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:5px;display:flex;flex-direction:column;gap:1px}.mode-row[data-v-a89f6a49]{display:grid;grid-template-columns:14px var(--composer-menu-desc-width, max-content);column-gap:7px;row-gap:2px;align-items:start;width:100%;padding:6px 7px;border:none;background:none;border-radius:6px;cursor:pointer;font-family:var(--font-ui);text-align:left}.mode-row[data-v-a89f6a49]:hover:not(:disabled){background:var(--color-surface-sunken)}.mode-row[data-v-a89f6a49]:disabled{cursor:not-allowed;opacity:.45}.mode-row-info[data-v-a89f6a49]{display:contents}.mode-row-icon[data-v-a89f6a49]{grid-column:1;grid-row:1;width:14px;min-height:1lh;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:var(--ui-font-size);line-height:var(--leading-normal)}.mode-row-name[data-v-a89f6a49]{grid-column:2;grid-row:1;font-size:var(--ui-font-size);font-weight:var(--weight-medium);color:var(--color-text);line-height:var(--leading-normal)}.mode-row-desc[data-v-a89f6a49]{grid-column:2;grid-row:2;width:var(--composer-menu-desc-width, auto);font-size:var(--text-xs);font-weight:var(--weight-medium);color:var(--muted);line-height:var(--leading-normal)}.mode-row-not-supported[data-v-a89f6a49]{margin-left:auto;font-size:var(--ui-font-size-xs);color:var(--muted)}.mode-row.on[data-v-a89f6a49]{background:var(--color-accent-soft)}.mode-row.on .mode-row-name[data-v-a89f6a49],.mode-row.on .mode-row-icon[data-v-a89f6a49]{color:var(--color-accent-hover)}.mode-row-meta[data-v-a89f6a49]{font-family:var(--mono);font-size:calc(var(--ui-font-size) - 3px);color:var(--muted)}.mode-row:disabled .mode-row-meta[data-v-a89f6a49]{color:var(--faint)}.mode-switch[data-v-a89f6a49]{grid-column:2;grid-row:1;justify-self:end;width:34px;height:19px;border-radius:999px;background:var(--panel2);border:1px solid var(--line);position:relative;transition:background .15s}.mode-switch.on[data-v-a89f6a49]{background:var(--color-accent);border-color:var(--color-accent)}.mode-knob[data-v-a89f6a49]{position:absolute;top:1px;left:1px;width:15px;height:15px;border-radius:50%;background:var(--bg);box-shadow:var(--shadow-xs);transition:transform .15s}.mode-switch.on .mode-knob[data-v-a89f6a49]{transform:translate(15px)}.mode-row-goal[data-v-a89f6a49]{--mode-row-icon-col: 14px;--mode-row-col-gap: 7px;--mode-row-pad-x: 7px;display:flex;flex-direction:column;align-items:stretch;cursor:default;padding:0;gap:0}.mode-row-goal[data-v-a89f6a49]:hover{background:transparent}.mode-row-goal.on[data-v-a89f6a49]{background:var(--color-accent-soft)}.mode-row-main[data-v-a89f6a49]{display:grid;grid-template-columns:var(--mode-row-icon-col) var(--composer-menu-desc-width, max-content);column-gap:var(--mode-row-col-gap);row-gap:2px;align-items:start;width:100%;padding:6px var(--mode-row-pad-x);border:none;background:none;border-radius:6px;cursor:pointer;font-family:var(--font-ui);text-align:left}.mode-row-main[data-v-a89f6a49]:hover{background:var(--color-surface-sunken)}.mode-row-goal.on .mode-row-main .mode-row-name[data-v-a89f6a49]{color:var(--color-accent-hover)}.mode-row-actions[data-v-a89f6a49]{display:flex;flex-wrap:wrap;gap:var(--space-2);justify-content:flex-start;padding:0 var(--mode-row-pad-x) var(--mode-row-pad-x) calc(var(--mode-row-pad-x) + var(--mode-row-icon-col) + var(--mode-row-col-gap))}.mode-row-action[data-v-a89f6a49]{flex:none}.mode-row-action[data-v-a89f6a49] .ui-button__content{gap:var(--space-1)}.mode-row-input[data-v-a89f6a49]{flex:1;min-width:0;padding:4px 8px;border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--bg);color:var(--color-text);font-size:var(--ui-font-size-xs)}@media(max-width:980px){.model-pill b[data-v-a89f6a49]{max-width:130px}.perm-pill[data-v-a89f6a49]{max-width:104px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}@media(max-width:640px){.composer[data-v-a89f6a49]{padding:9px var(--dock-inline-right, max(12px, var(--safe-right))) max(24px,var(--safe-bottom)) var(--dock-inline-left, max(12px, var(--safe-left)))}.composer-card[data-v-a89f6a49]{--composer-send-size: 36px;max-width:100%}.input-row[data-v-a89f6a49]{gap:6px;min-width:0}.send[data-v-a89f6a49]{width:var(--composer-send-size);height:var(--composer-send-size);min-width:var(--composer-send-size);padding:0;border-radius:50%;font-size:0;align-self:flex-end;position:relative}.send svg[data-v-a89f6a49]{display:none}.send[data-v-a89f6a49]:after{content:"↑";font-size:17px;line-height:1;color:var(--bg)}.stop[data-v-a89f6a49]{width:var(--composer-send-size);height:var(--composer-send-size);min-width:var(--composer-send-size);padding:0;border-radius:50%;font-size:0;align-self:flex-end;position:relative}.stop svg[data-v-a89f6a49]{display:none}.stop[data-v-a89f6a49]:after{content:"■";font-size:17px;line-height:1}.perm-pill[data-v-a89f6a49],.modes[data-v-a89f6a49]{display:none}.model-dropdown[data-v-a89f6a49]{right:10px;left:auto;min-width:180px;max-width:calc(100vw - 24px)}.ph[data-v-a89f6a49]{font-size:16px}.model-pill[data-v-a89f6a49],.attach-btn[data-v-a89f6a49]{font-size:var(--ui-font-size)}.toolbar[data-v-a89f6a49]{gap:6px;min-width:0}.toolbar-left[data-v-a89f6a49],.toolbar-right[data-v-a89f6a49]{min-width:0}.model-pill[data-v-a89f6a49]{max-width:min(52vw,220px)}.model-pill b[data-v-a89f6a49]{max-width:min(40vw,170px)}.md-row[data-v-a89f6a49],.md-section[data-v-a89f6a49]{font-size:var(--ui-font-size)}.md-thinking[data-v-a89f6a49]{flex-wrap:wrap;row-gap:6px}.md-thinking .effort-segments[data-v-a89f6a49]{margin-left:0;width:100%;justify-content:space-between}.md-thinking .effort-seg[data-v-a89f6a49]{flex:1;padding:5px 6px}.pd-name[data-v-a89f6a49]{font-size:var(--ui-font-size)}.pd-desc[data-v-a89f6a49]{font-size:var(--text-xs)}}.ui-card[data-v-9c9f9a9a]{background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden}.ui-card.is-elevated[data-v-9c9f9a9a]{box-shadow:var(--shadow-md);border-color:transparent}.ui-card__head[data-v-9c9f9a9a]{display:flex;align-items:center;gap:var(--space-2);padding:10px 14px;border-bottom:1px solid var(--color-line);background:var(--color-surface);font-family:var(--font-mono);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text)}.ui-card__body[data-v-9c9f9a9a]{padding:14px;color:var(--color-text-muted)}.ui-card__foot[data-v-9c9f9a9a]{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-2);padding:10px 14px;border-top:1px solid var(--color-line);background:var(--color-surface)}.goal-strip[data-v-44bef30f]{--composer-send-size: 32px;--composer-send-inset: var(--space-2);--goal-corner-radius: calc((var(--composer-send-size) / 2) + var(--composer-send-inset) + var(--space-3));margin:var(--space-2) var(--space-4) 0;box-shadow:var(--shadow-md)}.goal-strip.ui-card[data-v-44bef30f]{border-radius:var(--goal-corner-radius);corner-shape:superellipse(1.5)}.goal-strip:not(.expanded).ui-card[data-v-44bef30f]{border-radius:var(--radius-full);corner-shape:round}.goal-strip[data-v-44bef30f] .ui-card__foot{padding:var(--composer-send-inset)}.goal-strip[data-v-44bef30f] .ui-card__head,.goal-strip[data-v-44bef30f] .ui-card__body,.goal-strip[data-v-44bef30f] .ui-card__foot{padding-left:calc((var(--composer-send-inset) + var(--composer-send-size)) / 2)}.goal-strip[data-v-44bef30f] .ui-card__body{background:var(--color-surface-raised);max-height:480px;overflow:hidden;opacity:1;transition:max-height var(--duration-slow) var(--ease-out),padding-top var(--duration-slow) var(--ease-out),padding-bottom var(--duration-slow) var(--ease-out),opacity var(--duration-base) var(--ease-out)}.goal-strip[data-v-44bef30f]:not(.expanded) .ui-card__body{max-height:0;padding-top:0;padding-bottom:0;opacity:0}.goal-strip[data-v-44bef30f] .ui-card__head{border-bottom-color:var(--color-line);transition:border-bottom-color var(--duration-base) var(--ease-out)}.goal-strip[data-v-44bef30f]:not(.expanded) .ui-card__head{border-bottom-color:transparent}.goal-row[data-v-44bef30f]{width:100%;display:flex;align-items:center;gap:var(--space-2);padding:0;border:none;background:transparent;color:var(--color-text);font:var(--text-base)/var(--leading-normal) var(--font-ui);text-align:left;cursor:pointer}.goal-kicker[data-v-44bef30f]{flex:none;color:var(--color-success);font:var(--text-base)/var(--leading-normal) var(--font-ui);font-weight:var(--weight-semibold)}.goal-icon[data-v-44bef30f]{flex:none;color:var(--color-success);margin-right:calc(-1 * var(--space-1))}.goal-objective[data-v-44bef30f]{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-size:var(--text-base);text-align:left}.goal-objective.expanded-hidden[data-v-44bef30f]{visibility:hidden;pointer-events:none}.goal-status[data-v-44bef30f]{flex:none}.goal-progress[data-v-44bef30f]{width:54px;height:4px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.goal-progress-fill[data-v-44bef30f]{display:block;height:100%;border-radius:inherit;background:var(--color-success)}.goal-chevron[data-v-44bef30f]{width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted);transition:transform var(--duration-fast) var(--ease-out);flex:none}.goal-chevron.open[data-v-44bef30f]{transform:rotate(90deg)}.goal-full[data-v-44bef30f]{color:var(--color-text);font-size:var(--text-base);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.goal-criterion[data-v-44bef30f]{margin-top:var(--space-3);color:var(--color-text-muted);font:var(--text-xs) var(--font-mono);text-transform:uppercase}.goal-criterion p[data-v-44bef30f]{margin:var(--space-1) 0 0;color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui);text-transform:none}.goal-footer[data-v-44bef30f]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);width:100%;min-width:0}.goal-strip[data-v-44bef30f] .ui-card__foot{max-height:100px;overflow:hidden;opacity:1;transition:max-height var(--duration-slow) var(--ease-out),padding-top var(--duration-slow) var(--ease-out),padding-bottom var(--duration-slow) var(--ease-out),opacity var(--duration-base) var(--ease-out),border-top-color var(--duration-base) var(--ease-out)}.goal-strip[data-v-44bef30f]:not(.expanded) .ui-card__foot{max-height:0;padding-top:0;padding-bottom:0;border-top-color:transparent;opacity:0}.goal-meta[data-v-44bef30f]{min-width:0;display:flex;flex-wrap:wrap;gap:var(--space-2);color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui);font-weight:450;font-variant-numeric:tabular-nums}.goal-actions[data-v-44bef30f]{display:flex;gap:var(--space-2);justify-content:flex-end;flex:none}.goal-action[data-v-44bef30f]{flex:none;min-width:0;height:var(--composer-send-size);border-radius:calc(var(--composer-send-size) / 2);padding-inline:var(--space-4)}.goal-action[data-v-44bef30f] .ui-button__content{gap:var(--space-1)}@media(max-width:640px){.goal-strip[data-v-44bef30f]{--composer-send-size: 36px;margin:var(--space-2) var(--space-3) 0}.goal-progress[data-v-44bef30f]{display:none}}@media(prefers-reduced-motion:reduce){.goal-strip[data-v-44bef30f] .ui-card__head,.goal-strip[data-v-44bef30f] .ui-card__body,.goal-strip[data-v-44bef30f] .ui-card__foot{transition:none}}.qcard[data-v-14c58ac1]{margin:var(--space-2) 0}.qcard.ui-card[data-v-14c58ac1]{border-color:var(--color-accent-bd)}.qcard[data-v-14c58ac1] .ui-card__head{background:var(--color-accent-soft);border-bottom-color:var(--color-accent-bd)}.qcard.minimized[data-v-14c58ac1] .ui-card__body{display:none}.qcard.minimized[data-v-14c58ac1] .ui-card__head{border-bottom:none}.qh[data-v-14c58ac1]{display:flex;align-items:center;gap:var(--space-2);width:100%;font:var(--text-sm)/var(--leading-normal) var(--font-ui)}.qh-ic[data-v-14c58ac1]{width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center;color:var(--color-accent);font-weight:var(--weight-semibold);font-size:15px;line-height:1;flex:none}.qtitle[data-v-14c58ac1]{color:var(--color-accent-hover);font-size:var(--text-base);font-weight:var(--weight-semibold)}.qstep[data-v-14c58ac1]{color:var(--color-text-muted);font:var(--text-xs) var(--font-ui);margin-left:var(--space-1)}.qmin[data-v-14c58ac1]{margin-left:auto}.qmin-peek[data-v-14c58ac1]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font:var(--text-xs) var(--font-ui)}.qbody[data-v-14c58ac1]{color:var(--color-text);font:var(--text-base)/var(--leading-normal) var(--font-ui)}.qsteps[data-v-14c58ac1]{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-3);font-family:var(--font-ui)}.qstep-dot[data-v-14c58ac1]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--radius-full);border:1px solid var(--color-line);background:var(--color-surface);color:var(--color-text-muted);font:var(--text-xs) var(--font-ui);cursor:pointer;padding:0;transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.qstep-dot[data-v-14c58ac1]:hover:not(.active){background:var(--color-surface-sunken)}.qstep-dot.active[data-v-14c58ac1]{border-color:var(--color-accent);background:var(--color-accent);color:var(--color-text-on-accent);font-weight:var(--weight-medium)}.qstep-dot.answered[data-v-14c58ac1]:not(.active){border-color:var(--color-accent);color:var(--color-accent)}.qheader-chip[data-v-14c58ac1]{margin-bottom:var(--space-2)}.qtext[data-v-14c58ac1]{font-size:var(--text-base);color:var(--color-text);font-weight:var(--weight-medium);margin-bottom:var(--space-2);line-height:var(--leading-normal)}.qmdbody[data-v-14c58ac1]{margin-bottom:var(--space-2)}.qopts[data-v-14c58ac1]{display:flex;flex-direction:column;gap:var(--space-1);margin-top:var(--space-2)}.qopt[data-v-14c58ac1]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border:1px solid var(--color-line);border-radius:var(--radius-md);cursor:pointer;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text);transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out);user-select:none}.qopt[data-v-14c58ac1]:hover{background:var(--color-surface-sunken)}.qopt.selected[data-v-14c58ac1]{border-color:var(--color-accent-bd);background:var(--color-accent-soft);color:var(--color-text)}.qopt-key[data-v-14c58ac1]{color:var(--color-text-muted);font:var(--text-xs) var(--font-ui);font-weight:var(--weight-medium);width:12px;flex:none;text-align:center}.qopt-glyph[data-v-14c58ac1]{color:var(--color-accent-hover);font-size:var(--text-base);flex:none}.qopt-text[data-v-14c58ac1]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.qopt-label[data-v-14c58ac1]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.qopt-desc[data-v-14c58ac1]{color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui);font-weight:var(--weight-medium)}.chk[data-v-14c58ac1],.rad[data-v-14c58ac1]{font:var(--text-base) var(--font-mono)}.other-input[data-v-14c58ac1]{flex:1;font:var(--text-base) var(--font-ui);border:none;border-bottom:1px solid var(--color-line);outline:none;padding:2px var(--space-1);color:var(--color-text);background:transparent;min-width:0}.other-input[data-v-14c58ac1]:focus-visible{border-bottom-color:var(--color-accent);box-shadow:0 1px 0 0 var(--color-accent)}.qfoot[data-v-14c58ac1]{display:flex;justify-content:flex-end;gap:var(--space-2);width:100%}@media(max-width:640px){.qh[data-v-14c58ac1]{flex-wrap:wrap;row-gap:var(--space-1)}.qtext[data-v-14c58ac1]{font-size:var(--text-lg)}.qstep-dot[data-v-14c58ac1]{width:28px;height:28px;font:var(--text-xs) var(--font-ui)}.qopt[data-v-14c58ac1]{min-height:44px;padding:var(--space-3);font-size:var(--text-base);border-radius:var(--radius-md)}.qopt-desc[data-v-14c58ac1]{font-size:var(--text-xs)}.other-input[data-v-14c58ac1]{flex-basis:100%;min-height:28px}.qfoot[data-v-14c58ac1]{flex-direction:column}.qfoot-btn[data-v-14c58ac1]{width:100%;min-height:46px}.qfoot-main[data-v-14c58ac1]{order:-1}}.appr[data-v-458a9d7d]{margin:var(--space-2) 0}.appr.ui-card[data-v-458a9d7d]{border-color:var(--color-warning-bd)}.appr[data-v-458a9d7d] .ui-card__head{background:var(--color-warning-soft);border-bottom-color:var(--color-warning-bd)}.appr.minimized[data-v-458a9d7d] .ui-card__body{display:none}.appr.minimized[data-v-458a9d7d] .ui-card__head{border-bottom:none}.ah[data-v-458a9d7d]{display:flex;align-items:center;gap:var(--space-2);width:100%;font:var(--text-sm)/var(--leading-normal) var(--font-ui);flex-wrap:nowrap}.ah-ic[data-v-458a9d7d]{width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center;color:var(--color-warning);font-weight:var(--weight-semibold);font-size:15px;line-height:1;flex:none}.akind[data-v-458a9d7d]{color:var(--color-warning);font-size:var(--text-base);font-weight:var(--weight-semibold);white-space:nowrap;flex:none}.apath[data-v-458a9d7d]{color:var(--color-text);font:var(--text-sm) var(--font-mono);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ah-path[data-v-458a9d7d]{margin-bottom:var(--space-2);color:var(--color-text-muted);font:var(--text-xs) var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw[data-v-458a9d7d],.minimized .amin[data-v-458a9d7d]{margin-left:auto}.diff[data-v-458a9d7d]{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-sunken);overflow:hidden;font:var(--text-sm)/1.85 var(--font-mono)}.dl[data-v-458a9d7d]{display:flex;padding:0 var(--space-3)}.dg[data-v-458a9d7d]{width:30px;color:var(--color-text-muted);text-align:right;padding-right:var(--space-3);user-select:none}.dc[data-v-458a9d7d]{white-space:pre;font:inherit}.del[data-v-458a9d7d]{background:var(--color-danger-soft)}.del .dc[data-v-458a9d7d]{color:var(--color-danger)}.add[data-v-458a9d7d]{background:var(--color-success-soft)}.add .dc[data-v-458a9d7d]{color:var(--color-success)}.shell-cmd[data-v-458a9d7d]{font:var(--text-sm) var(--font-mono);background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);white-space:pre-wrap;word-break:break-all;max-height:160px;overflow-y:auto;color:var(--color-text)}.shell-dollar[data-v-458a9d7d]{color:var(--color-accent-hover);font-weight:var(--weight-medium);margin-right:var(--space-2)}.shell-cwd[data-v-458a9d7d]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);margin-top:var(--space-1)}.shell-danger[data-v-458a9d7d]{margin-top:var(--space-2);padding:var(--space-1) var(--space-3);border:1px solid var(--color-danger-bd);border-radius:var(--radius-sm);color:var(--color-danger);font:var(--text-sm) var(--font-ui);background:var(--color-danger-soft)}.body-file[data-v-458a9d7d]{border:1px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden}.file-bar[data-v-458a9d7d]{padding:var(--space-1) var(--space-3);background:var(--color-surface);border-bottom:1px solid var(--color-line);font:var(--text-xs) var(--font-mono);color:var(--color-text-muted)}.file-lang[data-v-458a9d7d]{letter-spacing:.04em}.file-content[data-v-458a9d7d]{padding:var(--space-2) 0;font:var(--text-sm)/1.7 var(--font-mono);background:var(--color-surface-sunken);max-height:240px;overflow-y:auto}.file-line[data-v-458a9d7d]{display:flex;padding:0 var(--space-3)}.file-ln[data-v-458a9d7d]{width:30px;color:var(--color-text-muted);text-align:right;padding-right:var(--space-3);user-select:none;flex:none}.file-text[data-v-458a9d7d]{white-space:pre;font:inherit}.body-chip[data-v-458a9d7d]{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.chip-label[data-v-458a9d7d]{background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-sm);padding:2px var(--space-2);font:var(--weight-semibold) var(--text-xs) var(--font-mono);color:var(--color-text-muted);white-space:nowrap}.chip-value[data-v-458a9d7d]{font:var(--text-sm) var(--font-mono);color:var(--color-text);word-break:break-all}.chip-detail[data-v-458a9d7d]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted)}.todo-item[data-v-458a9d7d]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-1) 0;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.todo-glyph[data-v-458a9d7d]{color:var(--color-accent);font-size:var(--text-sm);flex:none;width:14px}.todo-title[data-v-458a9d7d]{color:var(--color-text)}.todo-done[data-v-458a9d7d]{color:var(--color-text-muted);text-decoration:line-through}.body-generic[data-v-458a9d7d]{font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text);word-break:break-word}.body-plan[data-v-458a9d7d]{max-height:50vh;overflow-y:auto}.feedback-wrap[data-v-458a9d7d]{margin-top:var(--space-3)}.feedback-ta[data-v-458a9d7d]{width:100%;box-sizing:border-box;font:var(--text-sm) var(--font-ui);padding:var(--space-2) var(--space-2);border:1px solid var(--color-line);border-radius:var(--radius-sm);resize:none;outline:none;color:var(--color-text);background:var(--color-surface-raised)}.feedback-ta[data-v-458a9d7d]:focus-visible{border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.feedback-hint[data-v-458a9d7d]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted);margin-top:var(--space-1)}.abtn[data-v-458a9d7d],.plan-actions[data-v-458a9d7d]{display:flex;justify-content:flex-end;gap:var(--space-2);width:100%}.plan-actions[data-v-458a9d7d]{flex-wrap:wrap}.k[data-v-458a9d7d]{opacity:.75}@media(max-width:640px){.diff[data-v-458a9d7d],.file-content[data-v-458a9d7d]{overflow-x:auto;-webkit-overflow-scrolling:touch}.file-content[data-v-458a9d7d]{max-height:50vh}.abtn[data-v-458a9d7d],.plan-actions[data-v-458a9d7d]{flex-direction:column}.kbtn[data-v-458a9d7d]{width:100%;min-height:46px}}.status-glyph[data-v-f595d935]{flex:none;width:16px;font-size:var(--text-base);line-height:1;text-align:center;user-select:none}.status-glyph.s-run[data-v-f595d935]{color:var(--color-accent);font-weight:500}.status-glyph.s-done[data-v-f595d935]{color:var(--color-success)}.status-glyph.s-fail[data-v-f595d935]{color:var(--color-danger)}.status-glyph.s-pending[data-v-f595d935]{color:var(--color-text-faint)}.taskspane[data-v-28fd5fc0]{padding:14px 18px 10px;flex:1;min-height:0;display:flex;flex-direction:column}.tp-head[data-v-28fd5fc0]{border-top:1px solid var(--line);padding-top:10px;margin-bottom:8px;display:flex;align-items:baseline;gap:8px}.tp-title[data-v-28fd5fc0]{color:var(--color-accent-hover);font-weight:500;font-size:var(--text-base);text-transform:capitalize}.tp-count[data-v-28fd5fc0]{color:var(--muted);font-size:var(--text-base)}.tp-list[data-v-28fd5fc0]{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px}.tp-row[data-v-28fd5fc0]{padding:4px 0}.tp-row.done .tp-name[data-v-28fd5fc0]{color:var(--muted);text-decoration:line-through}.tp-row.fail .tp-name[data-v-28fd5fc0]{color:var(--color-danger)}.tp-main[data-v-28fd5fc0]{display:flex;align-items:center;gap:7px;font-size:var(--text-base)}.tp-row.expandable>.tp-main[data-v-28fd5fc0]{cursor:pointer;border-radius:4px}.tp-row.expandable>.tp-main[data-v-28fd5fc0]:hover{background:var(--panel2)}.tp-chevron[data-v-28fd5fc0]{flex:none;color:var(--muted);transition:transform .12s}.tp-chevron.open[data-v-28fd5fc0]{transform:rotate(90deg)}.tp-name[data-v-28fd5fc0]{color:var(--color-text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-time[data-v-28fd5fc0]{flex:none;font-size:var(--text-base);color:var(--muted)}.tp-stop[data-v-28fd5fc0]{flex:none;background:none;border:1px solid color-mix(in srgb,var(--color-danger) 22%,var(--bg));border-radius:var(--radius-xs);color:var(--color-danger);font-size:max(9px,calc(var(--ui-font-size) - 3.5px));padding:1px 8px;cursor:pointer;font-family:var(--mono)}.tp-stop[data-v-28fd5fc0]:hover{background:var(--panel)}.tp-detail[data-v-28fd5fc0]{margin:4px 0 0 23px;display:flex;flex-direction:column;gap:4px}.tp-codebox[data-v-28fd5fc0]{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-xs)}.tp-copy[data-v-28fd5fc0]{position:absolute;top:4px;right:6px;z-index:1;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;background:var(--panel2);border:1px solid var(--line);border-radius:var(--radius-xs);color:var(--dim);font-size:max(9px,calc(var(--ui-font-size) - 3.5px));padding:1px 7px;cursor:pointer;font-family:var(--sans)}.tp-codebox:hover .tp-copy[data-v-28fd5fc0],.tp-copy[data-v-28fd5fc0]:focus-visible{opacity:1;visibility:visible}.tp-copy[data-v-28fd5fc0]:hover{background:var(--panel)}.tp-copy.copied[data-v-28fd5fc0]{color:var(--color-success);border-color:color-mix(in srgb,var(--color-success) 30%,var(--line))}.tp-pre[data-v-28fd5fc0]{margin:0;padding:6px 10px;max-height:320px;overflow:auto;contain:layout paint}.tp-pre code[data-v-28fd5fc0]{display:block;font-family:var(--mono);font-size:var(--text-base);line-height:1.55;color:var(--dim);white-space:pre-wrap;word-break:break-word}.tp-cmd[data-v-28fd5fc0]{display:block;color:var(--muted)}.tp-line[data-v-28fd5fc0]{display:block}.tp-empty[data-v-28fd5fc0]{padding:24px 0;text-align:center;color:var(--faint);font-size:var(--ui-font-size-sm)}@media(max-width:640px){.taskspane[data-v-28fd5fc0]{padding:14px 14px 16px}.tp-main[data-v-28fd5fc0]{flex-wrap:wrap;row-gap:4px}.tp-name[data-v-28fd5fc0]{font-size:var(--ui-font-size-sm)}.tp-stop[data-v-28fd5fc0]{min-height:32px;display:inline-flex;align-items:center;padding:4px 12px;border-radius:6px;font-size:var(--ui-font-size-xs)}.tp-detail[data-v-28fd5fc0]{margin-left:0}.tp-pre[data-v-28fd5fc0]{font-size:var(--ui-font-size-xs)}}.tp-stop[data-v-28fd5fc0]{border-radius:var(--radius-md);font-family:var(--sans)}.todo-card[data-v-01c65735]{display:flex;flex-direction:column;gap:1px;font-size:var(--text-base)}.tc-row[data-v-01c65735]{display:flex;align-items:center;gap:7px;padding:4px 0;color:var(--color-text)}.tc-name[data-v-01c65735]{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.4}.tc-row.s-in_progress .tc-name[data-v-01c65735]{font-weight:var(--weight-medium)}.tc-row.s-done .tc-name[data-v-01c65735]{color:var(--color-text-faint);text-decoration:line-through}.tc-empty[data-v-01c65735]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);color:var(--color-text-faint);font-size:var(--text-sm)}.tc-empty-ico[data-v-01c65735]{width:28px;height:28px;color:var(--color-line-strong)}@media(max-width:640px){.todo-card[data-v-01c65735]{font-size:var(--text-lg)}.tc-row[data-v-01c65735]{padding:var(--space-2) var(--space-3)}}.chat-dock[data-v-9e5ec0f2]{--dock-inline-left: 16px;--dock-inline-right: 16px;box-sizing:border-box;width:100%;max-width:calc(var(--read-max) + var(--panes-scrollbar-width, 0px));padding-right:var(--panes-scrollbar-width, 0px);flex:none;position:relative;background:var(--color-bg);z-index:var(--z-sticky)}.chat-dock.align-center[data-v-9e5ec0f2]{margin-left:auto;margin-right:auto}.chat-dock.align-left[data-v-9e5ec0f2]{margin-left:0;margin-right:auto}.chat-dock.align-mobile[data-v-9e5ec0f2]{max-width:none}.dock-work-panel[data-v-9e5ec0f2]{position:absolute;left:16px;right:calc(16px + var(--panes-scrollbar-width, 0px));bottom:100%;background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-md);margin-bottom:7px;max-height:min(360px,50vh);display:flex;flex-direction:column;overflow:hidden}.dock-work-head[data-v-9e5ec0f2]{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--color-line)}.dock-work-tab[data-v-9e5ec0f2]{font-size:var(--text-base);font-weight:500;color:var(--color-text);padding:3px 8px;border-radius:var(--radius-sm);background:var(--color-surface-sunken);border:1px solid var(--color-line)}.dock-work-tab.static[data-v-9e5ec0f2]{background:transparent;border-color:transparent;padding-left:2px}.dock-work-body[data-v-9e5ec0f2]{padding:8px 10px;overflow-y:auto;min-height:0}.dock-work-body[data-v-9e5ec0f2] .taskspane{border:none;background:transparent;padding:0}.dock-work-body[data-v-9e5ec0f2] .taskspane .tp-head{display:none}.dock-workbar[data-v-9e5ec0f2]{display:flex;align-items:center;gap:6px;padding:4px var(--dock-inline-right) 2px var(--dock-inline-left)}.dock-workbar .dw-count[data-v-9e5ec0f2]{margin-left:1px}.dock-workbar .dw-count b[data-v-9e5ec0f2]{font-weight:500}.dock-approval[data-v-9e5ec0f2]{margin-top:8px}@media(max-width:640px){.chat-dock[data-v-9e5ec0f2]{--dock-inline-left: max(12px, var(--safe-left));--dock-inline-right: max(12px, var(--safe-right))}.dock-work-panel[data-v-9e5ec0f2]{left:10px;right:calc(10px + var(--panes-scrollbar-width, 0px))}}.chat-dock[data-v-9e5ec0f2]:not(.align-mobile) .composer{padding-bottom:14px}.dock-panel-enter-active[data-v-9e5ec0f2],.dock-panel-leave-active[data-v-9e5ec0f2]{transition:opacity .16s ease,transform .16s ease}.dock-panel-enter-from[data-v-9e5ec0f2],.dock-panel-leave-to[data-v-9e5ec0f2]{opacity:0;transform:translateY(8px)}.conversation-toc[data-v-3f1c1f66]{position:absolute;z-index:var(--z-sticky);top:50%;transform:translateY(-50%);--toc-content-max: min( var(--p-content-max), calc(100cqi - var(--space-5) - var(--space-5)) );left:calc(50% + (var(--toc-content-max) / 2) + 14px);display:flex;flex-direction:column;justify-content:center;opacity:.5;transition:opacity var(--duration-base) var(--ease-out)}.conversation-toc[data-v-3f1c1f66]:before{content:"";position:absolute;inset:0 -48px 0 -14px;z-index:0}.conversation-toc[data-v-3f1c1f66]:hover,.conversation-toc[data-v-3f1c1f66]:focus-within{opacity:1}.toc-scroll[data-v-3f1c1f66]{position:relative;z-index:1;display:flex;flex-direction:column;gap:7px;padding:8px 0;max-height:calc(100vh - 200px);overflow-y:auto;scrollbar-width:none}.toc-scroll[data-v-3f1c1f66]::-webkit-scrollbar{display:none}.toc-row[data-v-3f1c1f66]{display:flex;align-items:center;gap:10px;height:18px;padding:0;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;white-space:nowrap}.toc-row[data-v-3f1c1f66]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.toc-bar[data-v-3f1c1f66]{flex:none;width:3px;height:14px;border-radius:var(--radius-full);background:var(--color-accent);opacity:.3;transition:opacity var(--duration-fast) var(--ease-out),height var(--duration-fast) var(--ease-out)}.toc-label[data-v-3f1c1f66]{display:block;max-width:0;overflow:hidden;opacity:0;text-overflow:ellipsis;transition:max-width .22s var(--ease-out),opacity var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.conversation-toc:hover .toc-bar[data-v-3f1c1f66],.conversation-toc:focus-within .toc-bar[data-v-3f1c1f66]{height:18px;opacity:.5}.conversation-toc:hover .toc-label[data-v-3f1c1f66],.conversation-toc:focus-within .toc-label[data-v-3f1c1f66]{max-width:220px;opacity:1}.toc-row.active .toc-bar[data-v-3f1c1f66]{opacity:1;height:18px}.toc-row.active .toc-label[data-v-3f1c1f66]{color:var(--color-accent);font-weight:var(--weight-medium)}.toc-row:hover .toc-bar[data-v-3f1c1f66]{opacity:1}.toc-row:hover .toc-label[data-v-3f1c1f66]{color:var(--color-text)}.conversation-toc.toc-clipped[data-v-3f1c1f66]{visibility:hidden;pointer-events:none}.con[data-v-68f9dafd]{--read-max: 760px;display:flex;flex-direction:column;min-width:0;height:100%;position:relative;container-type:inline-size}.panes[data-v-68f9dafd]{flex:1;min-height:0;overflow-y:auto;overflow-anchor:auto;scrollbar-gutter:stable}.panes.is-following[data-v-68f9dafd],.panes.history-prepending[data-v-68f9dafd]{overflow-anchor:none}.chat-layout[data-v-68f9dafd]{display:flex;flex-direction:column;height:100%;min-height:0;position:relative}.chat-scroll[data-v-68f9dafd]{flex:1;min-height:0;position:relative}.content-wrap[data-v-68f9dafd]{width:100%;max-width:var(--read-max);min-height:100%;display:flex;flex-direction:column;flex-shrink:0}.content-wrap.align-center[data-v-68f9dafd]{margin-left:auto;margin-right:auto}.content-wrap.align-left[data-v-68f9dafd]{margin-left:0;margin-right:auto}.content-wrap.align-mobile[data-v-68f9dafd]{max-width:none}@media(max-width:640px){.con.mobile[data-v-68f9dafd]{min-width:0;overflow:hidden}.con.mobile .panes[data-v-68f9dafd]{scrollbar-gutter:auto;-webkit-overflow-scrolling:touch}.content-wrap.align-mobile[data-v-68f9dafd]{width:100%;min-width:0}}.empty-spacer[data-v-68f9dafd]{flex:1}.empty-hint[data-v-68f9dafd]{flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:0 16px 16px;color:var(--color-text);font-family:var(--font-ui)}.empty-hint-title[data-v-68f9dafd]{font-size:calc(var(--ui-font-size) + 16px);font-optical-sizing:auto;font-weight:600}.empty-hint-title.is-starting[data-v-68f9dafd]{display:inline-flex;align-items:center;gap:9px;color:var(--dim);font-weight:400}.empty-hint-text[data-v-68f9dafd]{display:inline-block;font-size:var(--text-base);color:var(--dim);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty-add-workspace[data-v-68f9dafd]{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:7px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--dim);font-family:var(--mono);font-size:var(--ui-font-size-sm);cursor:pointer}.empty-add-workspace[data-v-68f9dafd]:hover{border-color:var(--color-accent-bd);color:var(--color-text)}.empty-add-workspace[data-v-68f9dafd]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.empty-add-workspace svg[data-v-68f9dafd]{flex:none}.ws-pick[data-v-68f9dafd]{position:relative;font-family:var(--font-ui)}.ws-pick-btn[data-v-68f9dafd]{display:inline-flex;align-items:center;gap:7px;width:max-content;max-width:min(100%,calc(100vw - var(--space-8)));padding:5px 10px;background:var(--panel);border:1px solid var(--line);border-radius:8px;color:var(--dim);font-family:inherit;font-size:var(--ui-font-size-sm);cursor:pointer}.ws-pick-btn[data-v-68f9dafd]:hover{border-color:var(--color-accent-bd);color:var(--color-text)}.ws-pick-name[data-v-68f9dafd]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ws-pick-chev[data-v-68f9dafd]{flex:none;color:var(--muted);transition:transform .15s}.ws-pick-chev.open[data-v-68f9dafd]{transform:rotate(180deg)}.ws-pick-backdrop[data-v-68f9dafd]{position:fixed;inset:0;z-index:var(--z-sticky)}.ws-pick-menu[data-v-68f9dafd]{position:absolute;display:grid;grid-template-columns:minmax(0,1fr);left:50%;transform:translate(-50%);top:calc(100% + 6px);z-index:var(--z-dropdown);width:max-content;min-width:min(180px,calc(100cqw - var(--space-8)));max-width:calc(100cqw - var(--space-8));max-height:50vh;overflow:hidden auto;background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:4px}.ws-pick-item[data-v-68f9dafd]{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;text-align:left;background:none;border:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-family:var(--font-ui)}.ws-pick-item[data-v-68f9dafd]:hover{background:var(--panel2)}.ws-pick-item.on[data-v-68f9dafd]{background:var(--color-accent-soft)}.ws-pick-item-name[data-v-68f9dafd]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.ws-pick-item.on .ws-pick-item-name[data-v-68f9dafd]{color:var(--color-accent-hover)}.ws-pick-item-path[data-v-68f9dafd]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);font-weight:475;color:var(--muted)}.ws-pick-item.ws-pick-more[data-v-68f9dafd]{flex-direction:row;align-items:center;justify-content:flex-start;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--dim)}.ws-pick-item.ws-pick-more[data-v-68f9dafd]:hover{color:var(--color-text)}.ws-pick-item.ws-pick-more span[data-v-68f9dafd],.ws-pick-action span[data-v-68f9dafd]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ws-pick-divider[data-v-68f9dafd]{height:1px;margin:4px 6px;background:var(--line)}.ws-pick-action[data-v-68f9dafd]{display:flex;align-items:center;gap:7px;width:100%;text-align:left;background:none;border:none;border-radius:6px;padding:7px 10px;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--dim)}.ws-pick-action[data-v-68f9dafd]:hover{background:var(--panel2);color:var(--color-text)}.ws-pick-action svg[data-v-68f9dafd]{flex:none}.chat-scroll[data-v-68f9dafd]{display:flex;flex-direction:column}.mobile .panes[data-v-68f9dafd]:has(>.chat-layout){overflow:hidden;scrollbar-gutter:auto}.newmsg-pill[data-v-68f9dafd]{position:absolute;left:50%;bottom:12px;transform:translate(-50%);display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--color-text);font-size:var(--ui-font-size-sm);cursor:pointer;box-shadow:var(--shadow-sm);z-index:var(--z-base)}.newmsg-pill[data-v-68f9dafd]:hover{background:var(--panel2)}.pill-chevron[data-v-68f9dafd]{width:12px;height:12px}.pill-enter-active[data-v-68f9dafd],.pill-leave-active[data-v-68f9dafd]{transition:opacity .2s ease,transform .2s ease}.pill-enter-from[data-v-68f9dafd],.pill-leave-to[data-v-68f9dafd]{opacity:0;transform:translate(-50%) translateY(8px)}.abort-toast[data-v-68f9dafd]{position:absolute;left:50%;top:60px;transform:translate(-50%);padding:8px 14px;border-radius:var(--radius-sm);background:var(--color-text);color:var(--bg);font-size:var(--ui-font-size-sm);z-index:var(--z-sticky);box-shadow:var(--shadow-sm)}.abort-toast-text[data-v-68f9dafd]{display:flex;align-items:center;gap:8px}.abort-toast-enter-active[data-v-68f9dafd],.abort-toast-leave-active[data-v-68f9dafd]{transition:opacity .15s ease,transform .15s ease}.abort-toast-enter-from[data-v-68f9dafd],.abort-toast-leave-to[data-v-68f9dafd]{opacity:0;transform:translate(-50%) translateY(-6px)}.con[data-v-68f9dafd]{background:var(--bg)}.newmsg-pill[data-v-68f9dafd]{font-family:var(--sans)}.ui-seg[data-v-d1aaccd7]{display:inline-flex;gap:2px;padding:2px;background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-md)}.ui-seg__item[data-v-d1aaccd7]{border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-weight:var(--weight-medium);cursor:pointer;line-height:1;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.ui-seg--md .ui-seg__item[data-v-d1aaccd7]{padding:5px var(--space-3);font-size:var(--text-sm)}.ui-seg--sm .ui-seg__item[data-v-d1aaccd7]{height:24px;padding:0 var(--space-2);font-size:var(--text-sm)}.ui-seg__item[data-v-d1aaccd7]:hover:not(.is-on){color:var(--color-text)}.ui-seg__item.is-on[data-v-d1aaccd7]{background:var(--color-surface-raised);color:var(--color-text);box-shadow:var(--shadow-xs)}.ui-seg__item[data-v-d1aaccd7]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ui-panel-header[data-v-c47879ad]{flex:none;display:flex;align-items:center;gap:var(--space-2);height:var(--panel-head-h, 48px);padding:0 6px 0 var(--space-3);box-sizing:border-box;min-width:0;border-bottom:1px solid var(--color-line);background:var(--color-surface)}.ui-panel-header__title[data-v-c47879ad]{flex:none;font:var(--weight-semibold) var(--text-xs) var(--font-mono);letter-spacing:.04em;color:var(--color-text)}.ui-panel-header__sub[data-v-c47879ad]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--text-xs) var(--font-mono);color:var(--color-text-muted)}.ui-panel-header__close[data-v-c47879ad]{flex:none;margin-left:auto}.ui-panel-header.wrap[data-v-c47879ad]{flex-wrap:wrap;height:auto;min-height:var(--panel-head-h, 48px);padding-top:3px;padding-bottom:3px;gap:4px 6px}.ui-panel-header.wrap .ui-panel-header__close[data-v-c47879ad]{margin-left:0}.file-preview[data-v-ded222d2]{display:flex;flex-direction:column;height:100%;background:var(--bg);font-family:var(--mono);min-width:0;container-type:inline-size}.fp-empty[data-v-ded222d2],.fp-loading[data-v-ded222d2]{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--muted);font-size:var(--ui-font-size)}.fp-path[data-v-ded222d2]{flex:1 1 60px;min-width:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;font-size:var(--ui-font-size-xs);color:var(--muted);font-weight:400}.fp-meta[data-v-ded222d2]{display:flex;align-items:center;gap:8px;flex:none}@container (max-width: 539px){.fp-meta[data-v-ded222d2]{display:none}}.fp-lines[data-v-ded222d2],.fp-size[data-v-ded222d2]{font-size:max(9px,calc(var(--ui-font-size) - 3.5px));color:var(--muted);white-space:nowrap}.fp-search[data-v-ded222d2]{display:flex;align-items:center;gap:4px;flex:1 1 110px;min-width:70px;max-width:200px}.fp-search-input[data-v-ded222d2]{flex:1;min-width:0;height:26px;border:1px solid var(--color-line);border-radius:var(--radius-sm);padding:2px 7px;background:var(--color-surface-raised);color:var(--color-text);font:var(--text-xs) var(--font-mono)}.fp-search-count[data-v-ded222d2]{color:var(--muted);font-size:max(9px,calc(var(--ui-font-size) - 3.5px));min-width:18px;text-align:right}.fp-download[data-v-ded222d2]{display:inline-grid;place-items:center;width:26px;height:26px;flex:none;border-radius:var(--radius-sm);color:var(--color-text-muted)}.fp-download[data-v-ded222d2]:hover{background:var(--color-surface-sunken);color:var(--color-text)}.fp-download[data-v-ded222d2]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.fp-download svg[data-v-ded222d2]{width:var(--p-ic-sm);height:var(--p-ic-sm)}.fp-check[data-v-ded222d2]{color:var(--color-success)}.fp-body[data-v-ded222d2]{--fp-search-hit-bg: color-mix(in srgb, var(--star) 22%, var(--bg));--fp-search-active-bg: color-mix(in srgb, var(--star) 36%, var(--bg));--fp-token-keyword: color-mix(in srgb, var(--color-accent) 68%, var(--color-danger));--fp-token-string: var(--color-success);--fp-token-literal: var(--color-accent-hover);--fp-token-tag: var(--color-warning);flex:1;min-height:0;overflow:auto}.fp-markdown[data-v-ded222d2]{padding:16px 20px}.fp-code[data-v-ded222d2]{background:var(--bg)}.fp-line-table[data-v-ded222d2]{display:table;width:100%;border-collapse:collapse;font-size:var(--ui-font-size);line-height:1.6}.fp-line-row[data-v-ded222d2]{display:table-row}.fp-line-row.hit .fp-line-text[data-v-ded222d2],.fp-table tr.hit td[data-v-ded222d2]{background:var(--fp-search-hit-bg)}.fp-line-row.active .fp-line-text[data-v-ded222d2],.fp-table tr.active td[data-v-ded222d2]{background:var(--fp-search-active-bg)}.fp-line-row.target .fp-gutter[data-v-ded222d2],.fp-line-row.target .fp-line-text[data-v-ded222d2],.fp-table tr.target th[data-v-ded222d2],.fp-table tr.target td[data-v-ded222d2]{background:var(--color-accent-soft)}.fp-gutter[data-v-ded222d2]{display:table-cell;width:44px;padding:0 10px 0 12px;text-align:right;color:var(--faint);user-select:none;font-size:var(--text-base);white-space:nowrap;border-right:1px solid var(--line2);vertical-align:top}.fp-line-text[data-v-ded222d2]{display:table-cell;padding:0 12px;color:var(--color-text);white-space:pre;vertical-align:top}.fp-line-text[data-v-ded222d2] .tok-key,.fp-line-text[data-v-ded222d2] .tok-keyword{color:var(--fp-token-keyword);font-weight:500}.fp-line-text[data-v-ded222d2] .tok-string{color:var(--fp-token-string)}.fp-line-text[data-v-ded222d2] .tok-number,.fp-line-text[data-v-ded222d2] .tok-literal{color:var(--fp-token-literal)}.fp-line-text[data-v-ded222d2] .tok-comment{color:var(--muted);font-style:italic}.fp-line-text[data-v-ded222d2] .tok-tag{color:var(--fp-token-tag);font-weight:500}.fp-line-text[data-v-ded222d2] .tok-attr{color:var(--fp-token-literal)}.fp-html-frame[data-v-ded222d2],.fp-pdf-frame[data-v-ded222d2]{width:100%;height:100%;border:0;background:var(--color-surface-raised)}.fp-pdf-wrap[data-v-ded222d2]{background:var(--panel2)}.fp-table-wrap[data-v-ded222d2]{background:var(--bg)}.fp-table[data-v-ded222d2]{border-collapse:collapse;min-width:100%;font:12px/1.5 var(--mono)}.fp-table th[data-v-ded222d2]{position:sticky;left:0;z-index:1;width:44px;min-width:44px;padding:2px 8px;text-align:right;color:var(--faint);background:var(--panel);border-right:1px solid var(--line2);user-select:none}.fp-table td[data-v-ded222d2]{padding:2px 10px;border-right:1px solid var(--line2);border-bottom:1px solid var(--line2);white-space:pre}.fp-image-wrap[data-v-ded222d2]{display:flex;align-items:center;justify-content:center;padding:24px;background:var(--panel2)}.fp-image[data-v-ded222d2]{max-width:100%;max-height:100%;object-fit:contain;border:1px solid var(--line);border-radius:4px;background:var(--media-alpha-canvas)}.fp-image.actual[data-v-ded222d2]{max-width:none;max-height:none}.fp-binary-wrap[data-v-ded222d2]{display:flex;align-items:center;justify-content:center}.fp-binary-card[data-v-ded222d2]{display:flex;align-items:center;gap:12px;padding:20px 24px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted);font-size:var(--ui-font-size);margin:32px auto;max-width:480px}.fp-binary-icon[data-v-ded222d2]{color:var(--faint);flex:none}.fp-error[data-v-ded222d2]{flex-direction:column;padding:24px;text-align:center}@keyframes spin-ded222d2{to{transform:rotate(360deg)}}.spinner[data-v-ded222d2]{display:inline-block;width:14px;height:14px;border:1.5px solid var(--line);border-top-color:var(--color-accent);border-radius:50%;animation:spin-ded222d2 .7s linear infinite}@media(max-width:640px){.fp-lines[data-v-ded222d2]{display:none}.fp-markdown[data-v-ded222d2]{padding:14px 16px}.fp-body.fp-code[data-v-ded222d2]{-webkit-overflow-scrolling:touch}}.fp-empty[data-v-ded222d2],.fp-loading[data-v-ded222d2]{font-family:var(--sans)}.fp-binary-card[data-v-ded222d2]{border:1px solid var(--color-line);border-radius:var(--radius-md)}.fp-binary-label[data-v-ded222d2]{font-family:var(--sans)}.fp-image[data-v-ded222d2]{border-radius:var(--radius-md)}.seg-btn[data-v-ded222d2]{font-family:var(--sans)}.tp[data-v-cf9c560b]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--color-bg)}.tp-body[data-v-cf9c560b]{flex:1;min-height:0;overflow-y:auto;margin:0;padding:12px 14px;font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:425;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word}.ap[data-v-715bd93e]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--color-bg)}.ap-phase[data-v-715bd93e]{flex:none}.ap-body[data-v-715bd93e]{flex:1;min-height:0;overflow-y:auto;padding:12px 14px;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.ap-type[data-v-715bd93e]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);margin-bottom:8px}.ap-reason[data-v-715bd93e]{color:var(--color-warning);margin-bottom:8px}.ap-field+.ap-field[data-v-715bd93e]{margin-top:12px}.ap-field-label[data-v-715bd93e]{display:block;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono);text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}.ap-field-body[data-v-715bd93e]{white-space:pre-wrap;overflow-wrap:anywhere}.ap-progress[data-v-715bd93e]{display:flex;flex-direction:column;gap:6px;font:var(--text-base)/var(--leading-relaxed) var(--font-mono);color:var(--color-text);min-width:0}.ap-live[data-v-715bd93e]{font:var(--text-base)/var(--leading-relaxed) var(--font-mono);color:var(--color-text);white-space:pre-wrap;overflow-wrap:anywhere}.ap-group[data-v-715bd93e]{min-width:0}.ap-call[data-v-715bd93e]{display:flex;align-items:baseline;gap:6px;min-width:0;font-weight:var(--weight-medium);color:var(--color-text);overflow-wrap:anywhere;white-space:pre-wrap}.ap-glyph[data-v-715bd93e]{flex:none;color:var(--color-accent);font-size:.85em}.ap-output[data-v-715bd93e]{margin:2px 0 0 16px;padding-left:8px;color:var(--color-text-muted);font-size:var(--text-sm);line-height:var(--leading-normal);border-left:2px solid var(--color-line);min-width:0}.ap-out-line[data-v-715bd93e]{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}.ap-fold[data-v-715bd93e]{display:inline-block;margin:2px 0;padding:0;background:none;border:none;color:var(--color-accent);font:inherit;cursor:pointer}.ap-fold[data-v-715bd93e]:hover{text-decoration:underline}.ap-fold[data-v-715bd93e]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.diff-lines[data-v-2f6bc1cc]{padding:4px 0 12px;font-size:var(--ui-font-size);line-height:1.5;-webkit-overflow-scrolling:touch;width:max-content;min-width:100%}.dl[data-v-2f6bc1cc]{display:flex;align-items:flex-start;min-height:18px;white-space:pre;width:100%}.dl-gutter[data-v-2f6bc1cc]{flex:none;width:40px;padding:0 6px;text-align:right;color:var(--faint, #aeb4bc);background:var(--panel, #fafbfc);user-select:none;border-right:1px solid var(--line2, #eef1f4);font-variant-numeric:tabular-nums}.dl-gutter.new[data-v-2f6bc1cc]{border-right:1px solid var(--line, #e7eaee)}.dl-sign[data-v-2f6bc1cc]{flex:none;width:16px;text-align:center;color:var(--muted);user-select:none}.dl-text[data-v-2f6bc1cc]{flex:none;padding-right:14px;white-space:pre;color:var(--color-text)}.dl-add[data-v-2f6bc1cc]{background:var(--color-success-soft);box-shadow:inset 2px 0 color-mix(in srgb,var(--color-success) 55%,transparent)}.dl-add .dl-sign[data-v-2f6bc1cc]{color:var(--color-success)}.dl-del[data-v-2f6bc1cc]{background:var(--color-danger-soft);box-shadow:inset 2px 0 color-mix(in srgb,var(--color-danger) 55%,transparent)}.dl-del .dl-sign[data-v-2f6bc1cc]{color:var(--color-danger)}.dl-hunk[data-v-2f6bc1cc]{background:var(--panel2, #f3f5f8)}.dl-hunk .hunk-text[data-v-2f6bc1cc]{flex:1;padding:1px 12px;color:var(--muted, #8b929b);font-style:normal}@media(max-width:640px){.diff-lines[data-v-2f6bc1cc]{overflow-x:auto;font-size:var(--ui-font-size)}}.tdp[data-v-76f2fbca]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--bg)}.tdp-body[data-v-76f2fbca]{flex:1;min-height:0;overflow:auto;font-family:var(--mono)}.tdp-output[data-v-76f2fbca]{padding:8px 12px;color:var(--dim);font-size:var(--text-base);line-height:1.7;white-space:pre-wrap;word-break:break-word}.tdp-empty[data-v-76f2fbca]{padding:32px 20px;color:var(--muted, #9098a0);font-size:var(--ui-font-size);text-align:center}.sc[data-v-f973798f]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--bg)}.sc-body[data-v-f973798f]{flex:1;min-height:0;overflow-y:auto}.sc-empty[data-v-f973798f]{padding:24px 16px;text-align:center;color:var(--muted);font-size:var(--ui-font-size)}.sc-composer[data-v-f973798f]{flex:none;display:flex;align-items:flex-end;gap:6px;padding:8px 10px;border-top:1px solid var(--line);background:var(--panel)}.sc-input[data-v-f973798f]{flex:1;min-width:0;resize:none;border:1px solid var(--line);border-radius:var(--r-sm, 8px);padding:7px 9px;background:var(--bg);color:var(--color-text);font:var(--ui-font-size)/1.5 var(--sans);outline:none;max-height:160px}.sc-input[data-v-f973798f]:focus{border-color:var(--color-accent-bd)}.sc-send[data-v-f973798f]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:var(--r-sm, 8px);background:var(--color-accent);color:var(--color-text-on-accent);cursor:pointer}.sc-send[data-v-f973798f]:disabled{opacity:.4;cursor:default}.sc-send[data-v-f973798f]:not(:disabled):hover{background:var(--color-accent-hover)}.sc-loading[data-v-f973798f]{flex:none;padding:8px 12px 12px}.sc-body[data-v-f973798f] .sending-placeholder,.sc-body[data-v-f973798f] .sending-line{display:none}.changes-pane[data-v-7778610a]{display:flex;flex-direction:column;height:100%;background:var(--bg);font-family:var(--mono)}.dv-path[data-v-7778610a],.dv-change-count[data-v-7778610a]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--ui-font-size-xs);color:var(--muted)}.dv-change-count[data-v-7778610a]{flex:1}.ch-head[data-v-7778610a]{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--line);background:var(--panel);font-size:var(--text-base);color:var(--dim);flex:none;white-space:nowrap;overflow:hidden}.br-label[data-v-7778610a]{color:var(--muted);font-size:max(9px,calc(var(--ui-font-size) - 3.5px))}.br-name[data-v-7778610a]{color:var(--color-accent);font-weight:500;font-size:var(--ui-font-size)}.sync-info[data-v-7778610a]{display:flex;align-items:center;gap:4px}.ahead[data-v-7778610a]{color:var(--color-accent);font-size:var(--text-base)}.behind[data-v-7778610a]{color:var(--color-warning);font-size:var(--text-base)}.empty-head[data-v-7778610a]{color:var(--muted);font-size:var(--text-base)}.ch-list[data-v-7778610a]{flex:1;overflow-y:auto;padding:4px 0}.ch-row[data-v-7778610a]{display:flex;align-items:center;gap:10px;padding:6px 16px;cursor:pointer;font-size:var(--ui-font-size);line-height:1.6;width:100%;background:none;border:none;text-align:left;font-family:inherit;color:inherit}.ch-row[data-v-7778610a]:hover{background:var(--panel2, #f5f6f8)}.ch-row[data-v-7778610a]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.ch-tree[data-v-7778610a]{padding:4px 0}.tree-list[data-v-7778610a]{list-style:none;margin:0;padding:0}.tree-row[data-v-7778610a]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 16px;background:none;border:none;text-align:left;font-family:inherit;font-size:var(--ui-font-size);color:inherit;cursor:pointer}.tree-row[data-v-7778610a]:hover{background:var(--panel2, #f5f6f8)}.tree-row[data-v-7778610a]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.tree-folder[data-v-7778610a]{color:var(--color-text);font-weight:500}.tree-file[data-v-7778610a]{color:var(--color-text)}.tree-icon[data-v-7778610a]{flex:none;color:var(--muted)}.tree-name[data-v-7778610a]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge[data-v-7778610a]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);font-size:max(9px,calc(var(--ui-font-size) - 4px));font-weight:500;flex:none;user-select:none}.badge.modified[data-v-7778610a]{background:color-mix(in srgb,var(--color-accent) 12%,var(--bg));color:var(--color-accent)}.badge.added[data-v-7778610a]{background:color-mix(in srgb,var(--color-success) 10%,var(--bg));color:var(--color-success)}.badge.deleted[data-v-7778610a]{background:color-mix(in srgb,var(--color-danger) 10%,var(--bg));color:var(--color-danger)}.badge.renamed[data-v-7778610a]{background:color-mix(in srgb,var(--color-warning) 12%,var(--bg));color:var(--color-warning)}.badge.untracked[data-v-7778610a]{background:var(--color-surface-sunken);color:var(--muted, #9098a0)}.badge.conflicted[data-v-7778610a]{background:color-mix(in srgb,var(--color-danger) 10%,var(--bg));color:var(--color-danger);font-size:max(9px,calc(var(--ui-font-size) - 5px))}.badge.ignored[data-v-7778610a]{background:var(--color-surface-sunken);color:var(--faint, #c0c5cc)}.badge.clean[data-v-7778610a]{background:transparent;color:var(--faint, #c0c5cc)}.badge.unknown[data-v-7778610a]{background:var(--color-surface-sunken);color:var(--muted, #9098a0)}.fpath[data-v-7778610a]{color:var(--color-text);font-size:var(--ui-font-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left;min-width:0}.empty-state[data-v-7778610a]{padding:32px 20px;color:var(--muted, #9098a0);font-size:var(--ui-font-size);text-align:center}.diff-head[data-v-7778610a]{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--line);background:var(--panel);flex:none;white-space:nowrap;overflow:hidden}.dv-lines-wrap[data-v-7778610a]{flex:1;min-height:0;overflow:auto}@media(max-width:640px){.ch-head[data-v-7778610a]{padding:10px 14px}.ch-list[data-v-7778610a]{padding:2px 0 12px}.ch-row[data-v-7778610a]{min-height:44px;padding:8px 14px;gap:12px;font-size:var(--ui-font-size-sm)}.ch-row[data-v-7778610a]:active{background:var(--panel2, #f5f6f8)}.badge[data-v-7778610a]{width:18px;height:18px}.fpath[data-v-7778610a]{font-size:var(--ui-font-size-sm)}.tree-row[data-v-7778610a]{min-height:40px;padding:8px 14px}.diff-head[data-v-7778610a]{padding:8px 12px;gap:10px}.diff-path[data-v-7778610a]{font-size:var(--text-base)}}.changes-pane .empty-state[data-v-7778610a],.br-label[data-v-7778610a],.empty-head[data-v-7778610a]{font-family:var(--sans)}.ch-row[data-v-7778610a],.ct-row[data-v-7778610a]{margin:1px 6px;width:calc(100% - 12px);border-radius:var(--radius-md)}.changes-pane .badge[data-v-7778610a],.changed-tree .badge[data-v-7778610a]{border-radius:var(--radius-sm)}.change-count[data-v-7778610a]{font-family:var(--sans);border-radius:999px}.ui-input[data-v-340f0da2]{width:100%;border:1px solid var(--color-line-strong);border-radius:var(--radius-md);background:var(--color-surface-raised);box-shadow:var(--shadow-xs);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);line-height:var(--leading-normal);padding:0 var(--space-3);transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.ui-input--md[data-v-340f0da2]{height:38px}.ui-input--sm[data-v-340f0da2]{height:32px;font-size:var(--text-sm);border-radius:var(--radius-sm)}.ui-input[data-v-340f0da2]::placeholder{color:var(--color-text-faint)}.ui-input[data-v-340f0da2]:hover:not(:disabled):not(:focus){border-color:var(--color-line-strong)}.ui-input[data-v-340f0da2]:focus{outline:none;border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.ui-input[data-v-340f0da2]:disabled{opacity:.5;cursor:not-allowed}.ui-input[readonly][data-v-340f0da2]{background:var(--color-surface-sunken)}.ui-input.has-error[data-v-340f0da2]{border-color:var(--color-danger)}.ui-input.has-error[data-v-340f0da2]:focus{box-shadow:0 0 0 3px var(--color-danger-soft)}.mp[data-v-56cefe51]{display:flex;flex-direction:column;gap:var(--space-2)}.search-wrap[data-v-56cefe51]{padding-bottom:var(--space-1)}.tab-strip[data-v-56cefe51]{display:flex;gap:var(--space-1);overflow-x:auto}.model-list[data-v-56cefe51]{display:flex;flex-direction:column;padding:var(--space-1) 0}.model-row[data-v-56cefe51]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-2) var(--space-2);border-radius:var(--radius-md);cursor:pointer;color:var(--color-text);min-width:0;transition:background var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.model-row[data-v-56cefe51]:hover,.model-row.is-selected[data-v-56cefe51]{background:var(--color-surface-sunken)}.model-row.is-current[data-v-56cefe51]{background:var(--color-accent-soft);box-shadow:inset 0 0 0 1px var(--color-accent-bd)}.check[data-v-56cefe51]{width:14px;height:14px;color:var(--color-accent);flex:none;display:flex;align-items:center;justify-content:center}.model-main[data-v-56cefe51]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.model-name[data-v-56cefe51]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-id[data-v-56cefe51]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-provider[data-v-56cefe51]{flex:none;max-width:110px;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-ctx[data-v-56cefe51]{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted)}.caps[data-v-56cefe51]{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}.state-row[data-v-56cefe51]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-5) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.state-row.unavail[data-v-56cefe51]{color:var(--color-warning)}.empty[data-v-56cefe51]{padding:var(--space-5) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.footer-hint[data-v-56cefe51]{padding-top:var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint);border-top:1px solid var(--color-line)}@media(max-width:640px){.model-provider[data-v-56cefe51],.caps[data-v-56cefe51]{display:none}}.ui-field[data-v-49bce958]{display:flex;flex-direction:column;gap:6px}.ui-field__label[data-v-49bce958]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)}.ui-field__hint[data-v-49bce958]{font-size:var(--text-xs);color:var(--color-text-faint)}.ui-field__error[data-v-49bce958]{font-size:var(--text-xs);color:var(--color-danger)}.ui-select[data-v-92a040fd]{appearance:none;-webkit-appearance:none;-moz-appearance:none;width:100%;border:1px solid var(--color-line-strong);border-radius:var(--radius-md);background-color:var(--color-surface-raised);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right var(--space-3) center;background-size:16px 16px;box-shadow:var(--shadow-xs);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);line-height:var(--leading-normal);padding:0 var(--space-3);padding-right:calc(var(--space-3) + 16px + var(--space-2));cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.ui-select--md[data-v-92a040fd]{height:38px}.ui-select--sm[data-v-92a040fd]{height:32px;font-size:var(--text-sm)}.ui-select[data-v-92a040fd]:hover:not(:disabled):not(:focus){border-color:var(--color-line-strong)}.ui-select[data-v-92a040fd]:focus{outline:none;border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.ui-select[data-v-92a040fd]:disabled{opacity:.5;cursor:not-allowed}.ui-select.has-error[data-v-92a040fd]{border-color:var(--color-danger)}.ui-select.has-error[data-v-92a040fd]:focus{box-shadow:0 0 0 3px var(--color-danger-soft)}html[data-color-scheme=dark] .ui-select[data-v-92a040fd]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239aa0a8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E")}@media(prefers-color-scheme:dark){html[data-color-scheme=system] .ui-select[data-v-92a040fd]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239aa0a8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E")}}.pm[data-v-cf73278e]{display:flex;flex-direction:column;gap:var(--space-4)}.prov-list[data-v-cf73278e]{display:flex;flex-direction:column;gap:var(--space-1)}.state-row[data-v-cf73278e]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.state-row.unavail[data-v-cf73278e]{color:var(--color-warning)}.empty[data-v-cf73278e]{padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.prov-row[data-v-cf73278e]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) 0;border-bottom:1px solid var(--color-line);transition:background var(--duration-fast) var(--ease-out)}.prov-row[data-v-cf73278e]:last-child{border-bottom:none}.status-dot[data-v-cf73278e]{width:8px;height:8px;flex:none;border-radius:50%;box-sizing:border-box}.status-dot--empty[data-v-cf73278e]{background:transparent;border:1.5px solid var(--color-text-faint)}.prov-info[data-v-cf73278e]{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-1)}.prov-type[data-v-cf73278e]{font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.prov-url[data-v-cf73278e]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prov-meta[data-v-cf73278e]{display:flex;align-items:center;gap:var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-muted)}.prov-actions[data-v-cf73278e]{display:flex;gap:var(--space-2);flex:none;align-items:center;flex-wrap:wrap}.add-section[data-v-cf73278e]{border-top:1px solid var(--color-line);padding-top:var(--space-4)}.add-btns[data-v-cf73278e]{display:flex;flex-wrap:wrap;gap:var(--space-2)}.add-form[data-v-cf73278e]{display:flex;flex-direction:column;gap:var(--space-3)}.add-error[data-v-cf73278e]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-danger)}.form-btns[data-v-cf73278e]{display:flex;flex-wrap:wrap;gap:var(--space-2)}.footer-hint[data-v-cf73278e]{padding-top:var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint);border-top:1px solid var(--color-line)}@media(max-width:640px){.prov-row[data-v-cf73278e]{align-items:flex-start;flex-wrap:wrap}.prov-actions[data-v-cf73278e]{flex:1 1 100%;justify-content:flex-end}}.center-body[data-v-8308a28f]{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-8) 0 var(--space-4);text-align:center}.center-text[data-v-8308a28f]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.success-text[data-v-8308a28f]{color:var(--color-success)}.err-text[data-v-8308a28f]{color:var(--color-danger)}.warn-text[data-v-8308a28f]{color:var(--color-warning);font-size:var(--text-base)}.center-hint[data-v-8308a28f]{font-size:var(--text-sm);color:var(--color-text-muted)}.nb[data-v-8308a28f]{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-2) 0 var(--space-4)}.nb-lead[data-v-8308a28f]{font-size:var(--text-base);color:var(--color-text);line-height:var(--leading-normal)}.nb-primary[data-v-8308a28f]{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);width:100%;min-height:40px;padding:0 var(--space-4);background:var(--color-accent);color:var(--color-text-on-accent);border:1px solid var(--color-accent);border-radius:var(--radius-md);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);cursor:pointer;text-decoration:none;transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out)}.nb-primary[data-v-8308a28f]:hover{background:var(--color-accent-hover);border-color:var(--color-accent-hover)}.nb-or[data-v-8308a28f]{display:flex;align-items:center;gap:var(--space-3);color:var(--color-text-muted);font-size:var(--text-xs);letter-spacing:.06em}.nb-or[data-v-8308a28f]:before,.nb-or[data-v-8308a28f]:after{content:"";flex:1;height:1px;background:var(--color-line)}.nb-fallback[data-v-8308a28f]{display:flex;flex-direction:column;gap:var(--space-2)}.nb-fb-text[data-v-8308a28f]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.nb-fb-link[data-v-8308a28f]{color:var(--color-accent);text-decoration:none;border-bottom:1px solid var(--color-accent-bd)}.nb-fb-link[data-v-8308a28f]:hover{border-bottom-color:var(--color-accent)}.nb-code-row[data-v-8308a28f]{display:flex;align-items:center;gap:var(--space-3);background:var(--color-surface-sunken);border:1px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}.nb-code[data-v-8308a28f]{flex:1;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:var(--weight-medium);color:var(--color-text);letter-spacing:.14em}.nb-copy.is-copied[data-v-8308a28f]{color:var(--color-success);border-color:var(--color-success-bd)}.nb-status[data-v-8308a28f]{display:flex;align-items:center;gap:var(--space-2);padding-top:var(--space-3);border-top:1px solid var(--color-line)}.nb-status-text[data-v-8308a28f]{font-family:var(--font-mono);font-size:var(--text-sm);color:var(--color-text-muted);flex:1}.nb-countdown[data-v-8308a28f]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);font-variant-numeric:tabular-nums}.actions[data-v-8308a28f]{display:flex;justify-content:flex-end;gap:var(--space-3);padding-top:var(--space-4)}@media(max-width:640px){.center-body[data-v-8308a28f],.nb[data-v-8308a28f]{overflow-y:auto;-webkit-overflow-scrolling:touch}.nb-code-row[data-v-8308a28f],.nb-status[data-v-8308a28f],.actions[data-v-8308a28f]{flex-wrap:wrap}.nb-code[data-v-8308a28f]{min-width:0;overflow-wrap:anywhere;letter-spacing:.08em}.nb-copy[data-v-8308a28f]{min-height:34px}.nb-primary[data-v-8308a28f]{min-height:44px}.nb-status-text[data-v-8308a28f]{min-width:0}}.ui-switch[data-v-dbe22dc4]{position:relative;width:36px;height:20px;flex:none;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-line-strong);cursor:pointer;transition:background var(--duration-base) var(--ease-out)}.ui-switch.is-on[data-v-dbe22dc4]{background:var(--color-accent)}.ui-switch[data-v-dbe22dc4]:disabled{opacity:.5;cursor:not-allowed}.ui-switch[data-v-dbe22dc4]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ui-switch__thumb[data-v-dbe22dc4]{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:var(--radius-full);background:var(--color-text-on-accent);box-shadow:var(--shadow-xs);transition:transform var(--duration-base) var(--ease-out)}.ui-switch.is-on .ui-switch__thumb[data-v-dbe22dc4]{transform:translate(16px)}.sd[data-v-2377814f]{display:flex;flex-direction:row;min-height:0;height:100%}.settings-tabs[data-v-2377814f]{display:flex;flex-direction:column;flex:none;width:148px;padding:var(--space-2);gap:2px;overflow-y:auto}.tab[data-v-2377814f]{text-align:left;padding:8px 10px;border:none;border-radius:var(--radius-md);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.tab[data-v-2377814f]:hover{background:var(--color-surface-sunken);color:var(--color-text)}.tab.on[data-v-2377814f]{background:var(--color-accent-soft);color:var(--color-accent);font-weight:var(--weight-medium)}.tab[data-v-2377814f]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.body[data-v-2377814f]{display:flex;flex-direction:column;overflow-y:auto;padding:var(--space-2) var(--space-5) var(--space-5) var(--space-6);flex:1;min-width:0}.panel[data-v-2377814f]{display:block}.sec[data-v-2377814f]{padding:var(--space-4) 0;border-bottom:1px solid var(--color-line)}.sec[data-v-2377814f]:last-child{border-bottom:none}.sec-head[data-v-2377814f]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}.sec-title[data-v-2377814f]{margin:0 0 var(--space-3);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-medium);letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-muted)}.sec-head .sec-title[data-v-2377814f]{margin-bottom:0}.saving[data-v-2377814f]{flex:none;font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-muted)}.row[data-v-2377814f]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);min-height:38px;padding:var(--space-1) 0}.rlabel[data-v-2377814f]{font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text);display:flex;flex-direction:column;gap:var(--space-1)}.rvalue[data-v-2377814f]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rvalue.mono[data-v-2377814f]{font-family:var(--font-mono);font-size:var(--text-xs)}.hint[data-v-2377814f]{font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.num-field[data-v-2377814f]{display:inline-flex;align-items:center;gap:var(--space-2);flex:none;padding:0 var(--space-3);height:38px;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-raised);transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.num-field[data-v-2377814f]:hover{border-color:var(--color-line-strong)}.num-field[data-v-2377814f]:focus-within{border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.num-input[data-v-2377814f]{width:48px;border:none;outline:none;background:transparent;color:var(--color-text);font-family:var(--font-mono);font-size:var(--text-base);text-align:right}.num-unit[data-v-2377814f]{color:var(--color-text-muted);font-family:var(--font-mono);font-size:var(--text-xs)}.select-wrap[data-v-2377814f]{min-width:220px;max-width:min(320px,50vw);flex:none}.empty-config[data-v-2377814f]{font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text-muted);padding:var(--space-1) 0}.actions[data-v-2377814f]{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-2)}@media(max-width:640px){.sd[data-v-2377814f]{flex-direction:column}.settings-tabs[data-v-2377814f]{flex-direction:row;width:auto;padding:var(--space-2) var(--space-3);gap:var(--space-1);overflow-x:auto}.tab[data-v-2377814f]{white-space:nowrap;flex:none}.row[data-v-2377814f]{align-items:flex-start;flex-direction:column}.select-wrap[data-v-2377814f]{width:100%;max-width:none}}.setting-card[data-v-2377814f]{border:1px solid var(--color-line);border-radius:var(--radius-xl);overflow:hidden;background:var(--color-bg)}.panel-head[data-v-2377814f]{margin-bottom:var(--space-4)}.panel-kicker[data-v-2377814f]{font-size:var(--text-xs);letter-spacing:.05em;text-transform:uppercase;color:var(--color-text-faint);margin-bottom:var(--space-1)}.panel-title[data-v-2377814f]{margin:0 0 var(--space-2);font-family:var(--font-ui);font-size:var(--text-2xl);font-weight:var(--weight-semibold);letter-spacing:-.01em;color:var(--color-text)}.panel-desc[data-v-2377814f]{margin:0;font-family:var(--font-ui);font-size:var(--text-sm);line-height:var(--leading-normal);color:var(--color-text-muted);max-width:560px}.archive-toolbar[data-v-2377814f]{display:flex;align-items:center;gap:var(--space-3);margin-bottom:var(--space-4);flex-wrap:wrap}.archive-search[data-v-2377814f]{flex:1;min-width:200px;height:36px;display:flex;align-items:center;gap:var(--space-2);padding:0 var(--space-3);border-radius:var(--radius-md);border:1px solid var(--color-line);color:var(--color-text-faint);font-size:var(--text-sm);background:var(--color-surface-raised);transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.archive-search[data-v-2377814f]:focus-within{border-color:var(--color-accent);box-shadow:var(--p-focus-ring);color:var(--color-text-muted)}.archive-search svg[data-v-2377814f]{width:15px;height:15px;flex:none}.archive-search input[data-v-2377814f]{width:100%;border:none;outline:none;background:transparent;font:inherit;color:var(--color-text)}.archive-list[data-v-2377814f]{display:flex;flex-direction:column;gap:var(--space-4)}.archive-card .setting-card[data-v-2377814f]{margin-bottom:0}.archive-workspace[data-v-2377814f]{display:flex;align-items:center;gap:var(--space-2);margin:0 2px var(--space-2);color:var(--color-text-muted);font-size:var(--text-sm);font-weight:var(--weight-medium)}.archive-workspace svg[data-v-2377814f]{width:16px;height:16px;color:var(--color-text-faint);flex:none}.archive-workspace .path[data-v-2377814f]{font-family:var(--font-mono);font-size:var(--text-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-workspace .count[data-v-2377814f]{margin-left:auto;color:var(--color-text-faint);font-weight:var(--weight-regular);font-size:var(--text-xs);flex:none}.archive-row[data-v-2377814f]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-3);align-items:center;padding:var(--space-3) var(--space-4);border-top:1px solid var(--color-line)}.archive-row[data-v-2377814f]:first-child{border-top:none}.archive-row[data-v-2377814f]:hover{background:var(--color-surface-sunken)}.archive-meta[data-v-2377814f]{min-width:0}.archive-name[data-v-2377814f]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-time[data-v-2377814f]{margin-top:2px;font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-mono)}.archive-draining[data-v-2377814f]{margin-bottom:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);background:var(--color-accent-soft);color:var(--color-accent-hover);font-size:var(--text-sm)}.archive-empty[data-v-2377814f]{padding:var(--space-6) var(--space-4);border:1px solid var(--color-line);border-radius:var(--radius-xl);color:var(--color-text-faint);font-size:var(--text-sm);text-align:center;background:var(--color-bg)}@media(max-width:640px){.archive-toolbar[data-v-2377814f]{flex-direction:column;align-items:stretch}.archive-search[data-v-2377814f]{min-width:0}}[data-v-2377814f] .ui-dialog{width:min(980px,96vw)}[data-v-2377814f] .ui-dialog--fixed-height{height:min(780px,calc(100vh - var(--space-8) * 2))}.aw[data-v-07cbb13d]{margin-left:calc(-1 * var(--space-5));margin-right:calc(-1 * var(--space-5));margin-bottom:calc(-1 * var(--space-4))}.crumbbar[data-v-07cbb13d]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-5);border-bottom:1px solid var(--color-line)}.crumbs[data-v-07cbb13d]{display:flex;align-items:center;flex-wrap:wrap;gap:1px;min-width:0;font-size:var(--text-sm)}.crumb-sep[data-v-07cbb13d]{color:var(--color-text-muted)}.crumb[data-v-07cbb13d]{background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);padding:1px var(--space-1);border-radius:var(--radius-xs)}.crumb[data-v-07cbb13d]:hover{color:var(--color-accent);background:var(--color-surface-sunken)}.crumb.last[data-v-07cbb13d]{color:var(--color-text);font-weight:var(--weight-medium)}.filterbar[data-v-07cbb13d]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-5);border-bottom:1px solid var(--color-line)}.filter-icon[data-v-07cbb13d]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.filter-input[data-v-07cbb13d]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-base);padding:var(--space-1) 0;border:none;background:none;color:var(--color-text);outline:none}.filter-input[data-v-07cbb13d]::placeholder{color:var(--color-text-muted)}.search-rel[data-v-07cbb13d]{color:var(--color-text)}.filterbar.has-error[data-v-07cbb13d]{border-bottom-color:var(--color-danger)}.filterbar.has-error .filter-icon[data-v-07cbb13d]{color:var(--color-danger)}.folder-list[data-v-07cbb13d]{height:300px;overflow-y:auto;padding:var(--space-1) var(--space-2)}.fl-loading[data-v-07cbb13d],.fl-empty[data-v-07cbb13d]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}.fl-note[data-v-07cbb13d]{padding:var(--space-2) var(--space-4);font-size:var(--text-sm);color:var(--color-text-muted)}.fl-error[data-v-07cbb13d]{color:var(--color-danger)}.folder-row[data-v-07cbb13d]{display:flex;align-items:center;gap:var(--space-2);width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text);text-align:left;padding:var(--space-1) var(--space-4);border-radius:var(--radius-md)}.folder-row[data-v-07cbb13d]:hover{background:var(--color-surface-sunken)}.dir-icon[data-v-07cbb13d]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.folder-row:hover .dir-icon[data-v-07cbb13d]{color:var(--color-accent)}.folder-name[data-v-07cbb13d]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text)}.degraded-hint[data-v-07cbb13d]{padding:var(--space-6) var(--space-5);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}.add-error[data-v-07cbb13d]{margin:0 14px 8px;padding:6px 10px;font-family:var(--mono);font-size:var(--ui-font-size-xs);color:#b3261e;background:#b3261e14;border:1px solid rgba(179,38,30,.25);border-radius:3px}.actions[data-v-07cbb13d]{display:flex;justify-content:flex-end;gap:var(--space-3);padding:var(--space-4) var(--space-5)}.footer-hint[data-v-07cbb13d]{padding:var(--space-2) var(--space-5);font-size:var(--text-xs);color:var(--color-text-muted);border-top:1px solid var(--color-line)}@media(max-width:640px){.folder-row[data-v-07cbb13d]{min-height:44px}.crumbbar[data-v-07cbb13d]{align-items:flex-start}.actions[data-v-07cbb13d]{flex-wrap:wrap}}.confirm-dialog__message[data-v-2e719024]{margin:0;font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.rows[data-v-39844d89]{margin:0;padding:0}.row[data-v-39844d89]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) 0;font-size:var(--text-base)}.row dt[data-v-39844d89]{width:96px;flex:none;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:var(--text-xs)}.row dd[data-v-39844d89]{margin:0;color:var(--color-text);font-weight:var(--weight-medium);display:flex;align-items:center;gap:var(--space-2);min-width:0}.row dd.plan-on[data-v-39844d89],.row dd.swarm-on[data-v-39844d89]{color:var(--color-accent)}.ctx-text[data-v-39844d89]{flex:none}.bar[data-v-39844d89]{width:80px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.bar i[data-v-39844d89]{display:block;height:100%;background:var(--color-accent)}@media(max-width:640px){.rows[data-v-39844d89]{overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-39844d89]{align-items:flex-start;flex-direction:column;gap:var(--space-1);min-height:48px}.row dt[data-v-39844d89]{width:auto}.row dd[data-v-39844d89]{max-width:100%;flex-wrap:wrap}}.ui-toast[data-v-adc6f346]{display:flex;align-items:flex-start;gap:11px;width:360px;max-width:100%;padding:13px 14px;background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);font-family:var(--font-ui);line-height:1.45}.ui-toast__icon[data-v-adc6f346]{flex:none;width:20px;height:20px;margin-top:1px;border-radius:var(--radius-full);display:grid;place-items:center;background:var(--color-accent-soft);color:var(--color-accent)}.ui-toast__icon svg[data-v-adc6f346]{width:12px;height:12px}.ui-toast--success .ui-toast__icon[data-v-adc6f346]{background:var(--color-success-soft);color:var(--color-success)}.ui-toast--warning .ui-toast__icon[data-v-adc6f346]{background:var(--color-warning-soft);color:var(--color-warning)}.ui-toast--danger .ui-toast__icon[data-v-adc6f346]{background:var(--color-danger-soft);color:var(--color-danger)}.ui-toast--danger[data-v-adc6f346]{border-color:color-mix(in srgb,var(--color-danger) 35%,transparent)}.ui-toast__body[data-v-adc6f346]{flex:1;min-width:0}.ui-toast__title[data-v-adc6f346]{font-size:var(--text-base);font-weight:500;color:var(--color-text);overflow-wrap:anywhere}.ui-toast__msg[data-v-adc6f346]{margin-top:2px;font-size:var(--text-sm);color:var(--color-text-muted);overflow-wrap:anywhere}.ui-toast--danger .ui-toast__msg[data-v-adc6f346]{color:var(--color-danger)}.ui-toast__close[data-v-adc6f346]{flex:none;margin:-3px -4px 0 0}.toasts[data-v-6cc72bd4]{position:fixed;right:16px;bottom:84px;display:flex;flex-direction:column;gap:var(--space-2);z-index:var(--z-toast);width:min(440px,calc(100vw - 32px));max-height:56vh;overflow-y:auto}.toast-enter-active[data-v-6cc72bd4],.toast-leave-active[data-v-6cc72bd4]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.toast-enter-from[data-v-6cc72bd4],.toast-leave-to[data-v-6cc72bd4]{opacity:0;transform:translate(16px)}.toast-move[data-v-6cc72bd4]{transition:transform var(--duration-base) var(--ease-out)}.actions[data-v-6cc72bd4]{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-2)}.link[data-v-6cc72bd4]{border:0;padding:0;background:none;color:var(--color-accent);cursor:pointer;font:inherit;font-size:var(--ui-font-size-xs)}.link[data-v-6cc72bd4]:hover{text-decoration:underline}.details[data-v-6cc72bd4]{display:grid;gap:5px;margin:8px 0 0;padding:8px;border:1px solid var(--color-line);border-radius:var(--radius-sm);background:var(--color-surface-sunken)}.detail-row[data-v-6cc72bd4]{display:grid;grid-template-columns:minmax(88px,.34fr) minmax(0,1fr);gap:8px}.detail-row dt[data-v-6cc72bd4]{color:var(--color-text-muted)}.detail-row dd[data-v-6cc72bd4]{margin:0;color:var(--color-text);overflow-wrap:anywhere;white-space:pre-wrap}@media(max-width:640px){.toasts[data-v-6cc72bd4]{left:12px;right:12px;bottom:calc(var(--dock-h, 76px) + 8px);width:auto;max-height:50vh}.detail-row[data-v-6cc72bd4]{grid-template-columns:1fr;gap:2px}}.topbar[data-v-6b4b901f]{display:flex;align-items:center;gap:10px;height:calc(50px + var(--safe-top));flex:none;padding:var(--safe-top) max(12px,var(--safe-right)) 0 max(12px,var(--safe-left));border-bottom:1px solid var(--color-line);background:var(--color-bg);font-family:var(--font-ui)}.wsq[data-v-6b4b901f]{flex:none;width:28px;height:28px;border-radius:var(--radius-md);background:var(--color-text);color:var(--color-bg);display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-weight:var(--weight-medium);font-size:var(--ui-font-size-sm)}.tb-mid[data-v-6b4b901f]{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:center;gap:1px;background:none;border:none;padding:0;cursor:pointer;text-align:left}.tb-path[data-v-6b4b901f]{display:flex;align-items:center;gap:5px;font-size:var(--ui-font-size-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tb-path .ws[data-v-6b4b901f]{color:var(--color-text)}.tb-path .sl[data-v-6b4b901f]{color:var(--color-text-faint)}.tb-path .se[data-v-6b4b901f]{color:var(--color-text);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tb-path .cv[data-v-6b4b901f]{color:var(--color-text-faint);flex:none}.tb-sub[data-v-6b4b901f]{display:flex;align-items:center;gap:5px;font-size:max(9px,calc(var(--ui-font-size) - 3.5px));color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tb-sub .rd[data-v-6b4b901f]{flex:none;width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-text-faint)}.tb-sub .rd.on[data-v-6b4b901f]{background:var(--color-success)}.topbar .tb-path[data-v-6b4b901f]{font-family:var(--sans)}.sheet-root[data-v-745ee5a2]{position:fixed;inset:0;z-index:var(--z-overlay);display:flex;flex-direction:column;justify-content:flex-end}.sheet-scrim[data-v-745ee5a2]{position:absolute;inset:0;background:#0d111773}.sheet-panel[data-v-745ee5a2]{position:relative;background:var(--color-surface-raised);border:1px solid var(--color-line);border-bottom:none;border-radius:var(--radius-xl) var(--radius-xl) 0 0;box-shadow:var(--shadow-xl);max-height:86vh;display:flex;flex-direction:column;min-height:0;font-family:var(--font-ui);color:var(--color-text)}.sheet-grab[data-v-745ee5a2]{flex:none;align-self:center;width:56px;height:18px;padding:0;border:none;background:none;cursor:pointer;position:relative;margin-top:4px}.sheet-grab[data-v-745ee5a2]:after{content:"";position:absolute;left:50%;top:7px;transform:translate(-50%);width:38px;height:5px;border-radius:var(--radius-full);background:var(--color-line)}.sheet-head[data-v-745ee5a2]{flex:none;display:flex;align-items:center;justify-content:space-between;padding:6px 16px 10px}.sheet-title[data-v-745ee5a2]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.sheet-body[data-v-745ee5a2]{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:max(16px,var(--safe-bottom))}.sheet-enter-active[data-v-745ee5a2],.sheet-leave-active[data-v-745ee5a2]{transition:opacity var(--duration-slow) var(--ease-out)}.sheet-enter-active .sheet-panel[data-v-745ee5a2],.sheet-leave-active .sheet-panel[data-v-745ee5a2]{transition:transform var(--duration-slow) var(--ease-out)}.sheet-enter-from[data-v-745ee5a2],.sheet-leave-to[data-v-745ee5a2]{opacity:0}.sheet-enter-from .sheet-panel[data-v-745ee5a2],.sheet-leave-to .sheet-panel[data-v-745ee5a2]{transform:translateY(102%)}.newrow[data-v-df277098]{display:flex;align-items:center;gap:10px;width:100%;padding:var(--space-3) var(--space-4);background:none;border:none;border-radius:var(--radius-md);color:var(--color-accent);font-weight:500;font-size:var(--text-base);cursor:pointer;text-align:left}.newrow[data-v-df277098]:hover,.newrow[data-v-df277098]:active{background:var(--color-surface-sunken)}.newrow.secondary[data-v-df277098]{padding-top:var(--space-2);padding-bottom:var(--space-2);color:var(--color-text-muted);font-weight:400}.newrow.secondary[data-v-df277098]:hover{background:var(--color-surface-sunken)}.newrow.secondary[data-v-df277098]:active{background:var(--color-surface-sunken);color:var(--color-text)}.mlist[data-v-df277098]{--m-pad: 16px;--m-gutter: 15px;--m-gap: 8px;--m-indent: calc(var(--m-pad) + var(--m-gutter) + var(--m-gap));padding-bottom:var(--space-1)}.mempty[data-v-df277098]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-faint);font-size:var(--ui-font-size)}.mempty.small[data-v-df277098]{padding:10px 16px 12px var(--m-indent);text-align:left;font-size:var(--ui-font-size-xs)}.mgroup[data-v-df277098]{padding-top:2px}.mgh[data-v-df277098]{display:flex;align-items:center;gap:var(--m-gap);padding:10px var(--m-pad) 6px;border-radius:var(--radius-md);cursor:pointer;user-select:none;position:relative}.mgh[data-v-df277098]:hover,.mgh[data-v-df277098]:active{background:var(--color-surface-sunken)}.mgh-folder[data-v-df277098]{flex:none;color:var(--color-text-muted)}.mgh-main[data-v-df277098]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.mgh-name[data-v-df277098]{font-size:var(--ui-font-size-lg);font-weight:550;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-path[data-v-df277098]{font-size:var(--text-base);font-weight:425;color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-add[data-v-df277098]{margin:-10px -12px -10px 0}.mgh-add[data-v-df277098]:active{color:var(--color-text);background:var(--color-surface-sunken)}.mgh-more[data-v-df277098]{margin:-10px -8px}.mgh-more[data-v-df277098]:active{color:var(--color-text);background:var(--color-surface-sunken)}.srow[data-v-df277098]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--m-pad) var(--space-3) var(--m-indent);border-radius:var(--radius-md);cursor:pointer;position:relative}.srow[data-v-df277098]:hover,.srow[data-v-df277098]:active{background:var(--color-surface-sunken)}.srow.cur[data-v-df277098]{background:var(--color-accent-soft);box-shadow:inset 0 0 0 1px var(--color-accent-bd)}.srow .m[data-v-df277098]{flex:1;min-width:0}.srow .m .t[data-v-df277098]{font-size:var(--text-base);font-weight:450;line-height:var(--leading-tight);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.srow.cur .m .t[data-v-df277098]{color:var(--color-accent-hover)}.srow .m .t.run[data-v-df277098]{position:relative}.srow .m .t.run[data-v-df277098]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-accent);animation:mRunPulse-df277098 1.4s ease-in-out infinite}@keyframes mRunPulse-df277098{0%,to{opacity:1}50%{opacity:.35}}.srow .m .t.aborted[data-v-df277098]{position:relative}.srow .m .t.aborted[data-v-df277098]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-danger)}.srow .m .s[data-v-df277098]{font-size:var(--text-base);font-weight:475;font-variant-numeric:tabular-nums;color:var(--color-text-faint);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.att[data-v-df277098]{flex:none;font-family:var(--font-mono);font-size:max(9px,calc(var(--ui-font-size) - 4px));color:var(--color-text-on-accent);background:var(--color-warning);border-radius:var(--radius-full);padding:1px 7px}.srow .kb[data-v-df277098]:active{color:var(--color-text);background:var(--color-surface-sunken)}.kmenu[data-v-df277098]{position:absolute;right:12px;top:44px;z-index:var(--z-dropdown);min-width:96px;overflow:hidden}.wsmenu[data-v-df277098]{top:calc(100% - 4px);right:var(--m-pad);min-width:132px}.mshow-more[data-v-df277098]{display:flex;align-items:center;width:100%;min-height:44px;padding:var(--space-1) var(--m-pad) var(--space-1) var(--m-indent);background:none;border:none;color:var(--color-text-muted);font-size:var(--text-base);cursor:pointer;text-align:left}.mshow-more[data-v-df277098]:active{color:var(--color-accent-hover);background:var(--color-surface-sunken)}.newrow[data-v-df277098]{font-family:var(--sans)}.mlist .srow[data-v-df277098]{margin:1px 8px;border-radius:var(--radius-md);border-bottom:none;padding:12px calc(var(--m-pad, 16px) - 8px) 12px calc(var(--m-indent, 39px) - 8px)}.mlist .srow.cur[data-v-df277098]{box-shadow:inset 0 0 0 1px var(--color-accent-bd)}.group-title[data-v-c244b2fe]{padding:var(--space-3) var(--space-3) var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-medium);letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-faint)}.srow[data-v-c244b2fe]{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:52px;padding:var(--space-3);background:none;border:none;border-radius:var(--radius-md);cursor:pointer;text-align:left;color:var(--color-text)}.srow[data-v-c244b2fe]:hover:not(.read-only){background:var(--color-surface-sunken)}.srow[data-v-c244b2fe]:active:not(.read-only){background:var(--color-surface-sunken)}.srow.read-only[data-v-c244b2fe]{cursor:default}.srow-main[data-v-c244b2fe]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.srow-label[data-v-c244b2fe]{font-size:var(--text-base);color:var(--color-text)}.srow-sub[data-v-c244b2fe]{font-size:var(--text-base);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.srow-val[data-v-c244b2fe]{flex:none;font-family:var(--font-mono);font-size:var(--ui-font-size);font-weight:500;color:var(--color-accent-hover)}.srow-val.dim[data-v-c244b2fe]{font-weight:400;color:var(--color-text-muted)}.cache-note[data-v-c244b2fe]{padding:0 var(--space-3) var(--space-2);font-size:var(--text-xs);color:var(--color-text-faint);line-height:1.4}.chev[data-v-c244b2fe]{flex:none;color:var(--color-text-faint);font-size:17px;line-height:1}.toggle[data-v-c244b2fe]{flex:none;width:44px;height:26px;border-radius:var(--radius-full);background:var(--color-line);position:relative;transition:background .18s}.toggle.on[data-v-c244b2fe]{background:var(--color-accent)}.toggle[data-v-c244b2fe]:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:var(--radius-full);box-sizing:border-box;background:var(--color-bg);border:1px solid var(--color-line);box-shadow:var(--shadow-xs);transition:left .18s}.toggle.on[data-v-c244b2fe]:after{left:21px}.srow.pref[data-v-c244b2fe]{cursor:default}.num-field[data-v-c244b2fe]{display:inline-flex;align-items:center;gap:6px;flex:none;height:34px;padding:0 9px;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-bg)}.num-input[data-v-c244b2fe]{width:50px;border:none;outline:none;background:transparent;color:var(--color-text);font-family:var(--font-mono);font-size:var(--ui-font-size);text-align:right}.num-unit[data-v-c244b2fe]{color:var(--color-text-muted);font-family:var(--font-mono);font-size:var(--ui-font-size-xs)}.srow.acct.in .srow-label[data-v-c244b2fe]{color:var(--color-accent-hover);font-weight:500}.srow.acct.out .srow-label[data-v-c244b2fe]{color:var(--color-danger)}.ctx-meter[data-v-c244b2fe]{flex:none;width:96px;height:7px;border-radius:var(--radius-full);background:var(--color-surface-sunken);overflow:hidden}.ctx-meter i[data-v-c244b2fe]{display:block;height:100%;background:var(--color-accent)}@media(max-width:640px){.srow[data-v-c244b2fe]{align-items:flex-start;gap:10px;min-width:0;padding:14px max(14px,var(--safe-right)) 14px max(14px,var(--safe-left))}.group-title[data-v-c244b2fe],.cache-note[data-v-c244b2fe]{padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right))}.srow-main[data-v-c244b2fe]{flex:1 1 auto}.srow-sub[data-v-c244b2fe]{white-space:normal;overflow-wrap:anywhere}.srow.pref[data-v-c244b2fe]{flex-wrap:wrap}.srow.pref .srow-main[data-v-c244b2fe]{flex:1 0 100%}.num-field[data-v-c244b2fe]{margin-left:auto}.srow-val[data-v-c244b2fe],.chev[data-v-c244b2fe],.toggle[data-v-c244b2fe],.ctx-meter[data-v-c244b2fe]{margin-top:2px}}.srow[data-v-c244b2fe],.srow-sub[data-v-c244b2fe],.srow-val[data-v-c244b2fe],.cache-note[data-v-c244b2fe]{font-family:var(--sans)}.arch-subhead[data-v-c244b2fe]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:var(--space-2) var(--space-3) var(--space-1)}.arch-back[data-v-c244b2fe]{display:inline-flex;align-items:center;gap:2px;border:none;background:none;padding:var(--space-1) var(--space-2) var(--space-1) 0;font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-accent-hover);cursor:pointer}.chev.back[data-v-c244b2fe]{font-size:20px}.arch-count[data-v-c244b2fe]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.arch-tools[data-v-c244b2fe]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);flex-wrap:wrap}.arch-search-input[data-v-c244b2fe]{flex:1;min-width:160px}.arch-row[data-v-c244b2fe]{display:flex;align-items:center;gap:var(--space-3);min-height:56px;padding:var(--space-2) var(--space-3);border-top:1px solid var(--color-line)}.arch-row[data-v-c244b2fe]:first-of-type{border-top:none}.arch-meta[data-v-c244b2fe]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.arch-name[data-v-c244b2fe]{font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.arch-time[data-v-c244b2fe]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.arch-empty[data-v-c244b2fe]{padding:var(--space-6) var(--space-4);text-align:center;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.ob-brand[data-v-fbdd3eab]{flex:1;display:flex;align-items:center;gap:var(--space-3);min-width:0}.ob-brand-text[data-v-fbdd3eab]{min-width:0}.ob-logo[data-v-fbdd3eab]{width:52px;height:36px;flex:none}.ob-title[data-v-fbdd3eab]{color:var(--color-text);font-size:var(--text-xl);font-weight:var(--weight-medium)}.ob-sub[data-v-fbdd3eab]{color:var(--color-text-muted);font-size:var(--text-base);margin-top:1px}.ob-sec[data-v-fbdd3eab]{margin-bottom:var(--space-4)}.ob-label[data-v-fbdd3eab]{color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-medium);margin-bottom:var(--space-2)}.ob-start[data-v-fbdd3eab]{width:100%}.ob-eyes[data-v-fbdd3eab]{animation:ob-eye-look-fbdd3eab 6s ease-in-out infinite}.ob-eye[data-v-fbdd3eab]{transform-box:fill-box;transform-origin:center;animation:ob-eye-blink-fbdd3eab 4s ease-in-out infinite}@keyframes ob-eye-look-fbdd3eab{0%,42%{transform:translate(0)}47%,53%{transform:translate(2px)}58%,80%{transform:translate(0)}84%,90%{transform:translate(-2px)}95%,to{transform:translate(0)}}@keyframes ob-eye-blink-fbdd3eab{0%,94%,to{transform:scaleY(1)}96.5%,98%{transform:scaleY(.12)}}@media(prefers-reduced-motion:reduce){.ob-eyes[data-v-fbdd3eab],.ob-eye[data-v-fbdd3eab]{animation:none}}.gload[data-v-0b6dec6a]{position:fixed;top:0;left:0;width:100vw;height:100vh;height:100dvh;min-width:100vw;min-height:100dvh;z-index:var(--z-toast);display:flex;align-items:center;justify-content:center;background:var(--bg)}.gload-box[data-v-0b6dec6a]{display:flex;flex-direction:column;align-items:center;gap:22px;transform:translateY(-6%)}.gload-logo[data-v-0b6dec6a]{width:128px;height:auto;color:var(--color-text);animation:gload-pop-0b6dec6a .55s cubic-bezier(.22,1,.36,1) both}.gload-text[data-v-0b6dec6a]{font-family:var(--mono);font-size:var(--text-base);color:var(--muted);letter-spacing:.04em}.gload-issue[data-v-0b6dec6a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);max-width:min(480px,80vw);font-family:var(--sans);font-size:var(--text-sm);color:var(--muted);text-align:center}.gload-issue-detail[data-v-0b6dec6a]{font-family:var(--mono);font-size:var(--text-xs);color:var(--muted);opacity:.8;word-break:break-word}@keyframes gload-pop-0b6dec6a{0%{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.gload-logo[data-v-0b6dec6a]{animation:none}}.gload-text[data-v-0b6dec6a]{font-family:var(--sans)}.kap-root[data-v-3cda6fe3]{height:100vh;display:flex;flex-direction:column;background:var(--bg);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 2.5px);color:var(--color-text)}.kap-head[data-v-3cda6fe3]{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--panel)}.kap-count[data-v-3cda6fe3]{color:var(--muted)}.kap-head-actions[data-v-3cda6fe3]{margin-left:auto;display:flex;gap:6px}.kap-head-actions button[data-v-3cda6fe3],.kap-view-toggle button[data-v-3cda6fe3]{padding:3px 8px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--muted);font:inherit;cursor:pointer}.kap-head-actions button[data-v-3cda6fe3]:hover,.kap-view-toggle button[data-v-3cda6fe3]:hover{color:var(--color-text)}.kap-head-actions button.on[data-v-3cda6fe3],.kap-view-toggle button.on[data-v-3cda6fe3]{color:var(--color-accent-hover);border-color:var(--color-accent-bd);background:var(--color-accent-soft)}.kap-filters[data-v-3cda6fe3]{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:7px 10px;border-bottom:1px solid var(--line)}.kap-filters select[data-v-3cda6fe3],.kap-filters input[type=text][data-v-3cda6fe3]{padding:3px 6px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--color-text);font:inherit;min-width:0}.kap-filters input[type=text][data-v-3cda6fe3]{flex:1;min-width:120px}.kap-check[data-v-3cda6fe3]{display:inline-flex;align-items:center;gap:4px;color:var(--muted);white-space:nowrap}.kap-view-toggle[data-v-3cda6fe3]{display:flex;gap:0}.kap-view-toggle button[data-v-3cda6fe3]:first-child{border-radius:6px 0 0 6px;border-right:none}.kap-view-toggle button[data-v-3cda6fe3]:last-child{border-radius:0 6px 6px 0}.kap-list[data-v-3cda6fe3]{flex:1;min-height:0;overflow-y:auto}.kap-empty[data-v-3cda6fe3]{padding:18px 12px;color:var(--muted);text-align:center}.kap-row[data-v-3cda6fe3]{display:flex;align-items:baseline;gap:7px;width:100%;padding:3px 10px;border:none;border-bottom:1px solid var(--line);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.kap-row[data-v-3cda6fe3]:hover{background:var(--panel2)}.kap-row.expanded[data-v-3cda6fe3]{background:var(--color-accent-soft)}.kap-ts[data-v-3cda6fe3]{flex:none;color:var(--muted)}.kap-badge[data-v-3cda6fe3]{flex:none;padding:0 5px;border-radius:var(--radius-sm);font-size:max(9px,calc(var(--ui-font-size) - 4.5px));font-weight:500;line-height:1.7}.b-rest[data-v-3cda6fe3]{background:var(--color-accent-soft);color:var(--color-accent-hover)}.b-in[data-v-3cda6fe3]{background:var(--color-accent-soft);color:var(--color-success)}.b-out[data-v-3cda6fe3]{background:var(--color-accent-soft);color:var(--color-warning)}.b-life[data-v-3cda6fe3]{background:var(--panel2);color:var(--muted)}.b-err[data-v-3cda6fe3]{background:var(--color-warning);color:var(--bg)}.kap-label[data-v-3cda6fe3]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kap-detail[data-v-3cda6fe3]{border-bottom:1px solid var(--line);background:var(--bg);padding:6px 10px 10px}.kap-detail-actions[data-v-3cda6fe3]{display:flex;justify-content:flex-end;margin-bottom:4px}.kap-detail-actions button[data-v-3cda6fe3]{padding:2px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted);font:inherit;cursor:pointer}.kap-detail-actions button[data-v-3cda6fe3]:hover{color:var(--color-text)}.kap-detail pre[data-v-3cda6fe3]{margin:0;max-height:320px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:calc(var(--ui-font-size) - 3px);line-height:1.45}.kap-agg[data-v-3cda6fe3]{flex:1;min-height:0;overflow-y:auto;padding:8px 10px}.kap-agg h4[data-v-3cda6fe3]{margin:8px 0 4px;font-size:calc(var(--ui-font-size) - 2.5px);color:var(--muted)}.kap-agg table[data-v-3cda6fe3]{width:100%;border-collapse:collapse}.kap-agg th[data-v-3cda6fe3],.kap-agg td[data-v-3cda6fe3]{padding:3px 6px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.kap-agg th[data-v-3cda6fe3]{color:var(--muted);font-weight:500}.kap-agg .num[data-v-3cda6fe3]{text-align:right}.kap-agg .err[data-v-3cda6fe3]{color:var(--color-warning);font-weight:500}.kap-agg .mono[data-v-3cda6fe3]{word-break:break-all}.kap-fab[data-v-21346738]{position:fixed;right:10px;bottom:10px;z-index:var(--z-overlay);padding:5px 9px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 3px);font-weight:500;letter-spacing:.04em;cursor:pointer;opacity:.75}.kap-fab[data-v-21346738]:hover{opacity:1;color:var(--color-accent)}.server-auth-overlay[data-v-6f624612]{position:fixed;inset:0;z-index:var(--z-max);display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--color-bg) 70%,transparent)}.server-auth-card[data-v-6f624612]{width:480px;max-width:calc(100vw - 48px);background:var(--color-surface-raised);border:1px solid var(--color-line);border-radius:var(--radius-xl);box-shadow:var(--shadow-xl);overflow:hidden;color:var(--color-text);font-family:var(--font-ui)}.server-auth-head[data-v-6f624612]{display:flex;flex-direction:column;padding:20px 22px 14px}.server-auth-title[data-v-6f624612]{margin:0;font-size:var(--text-lg);font-weight:var(--weight-medium);letter-spacing:-.01em;color:var(--color-text)}.server-auth-hint[data-v-6f624612]{margin:4px 0 0;font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.server-auth-hint code[data-v-6f624612]{padding:1px 5px;font-family:var(--font-mono);font-size:var(--text-xs);background:var(--color-surface-sunken);border-radius:var(--radius-xs)}.server-auth-body[data-v-6f624612]{padding:4px 22px 18px}.server-auth-foot[data-v-6f624612]{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 20px}.internal-build-tag[data-v-166b3735]{flex:none;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:999px;background:#f5a623;color:#3a2a00;font-size:11px;font-weight:700;letter-spacing:.01em;line-height:1.4;white-space:nowrap;user-select:none}.gload-fade-leave-active[data-v-8cd3196b]{transition:opacity .28s ease}.gload-fade-leave-to[data-v-8cd3196b]{opacity:0}.app-shell[data-v-8cd3196b]{position:fixed;top:var(--app-top, 0px);left:0;right:0;height:100vh;height:100dvh;height:var(--app-height, 100dvh);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.auth-page[data-v-8cd3196b]{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:32px;background:var(--bg);color:var(--color-text);box-sizing:border-box}.auth-page-inner[data-v-8cd3196b]{width:min(420px,100%);display:flex;flex-direction:column;align-items:flex-start;gap:18px}.auth-page-logo[data-v-8cd3196b]{width:64px;height:44px;flex:none;cursor:pointer;user-select:none;-webkit-user-select:none;transition:transform .18s ease}.auth-page-logo[data-v-8cd3196b]:hover{transform:scale(1.06)}.auth-page-copy[data-v-8cd3196b]{display:flex;flex-direction:column;gap:8px}.auth-page-copy h1[data-v-8cd3196b]{margin:0;font-family:var(--sans);font-size:30px;line-height:1.15;font-weight:500;letter-spacing:0;color:var(--color-text)}.auth-page-copy p[data-v-8cd3196b]{margin:0;font-family:var(--sans);font-size:var(--ui-font-size-lg);line-height:1.55;color:var(--dim)}.app[data-v-8cd3196b]{--preview-w: 460px;flex:1;min-height:0;position:relative;display:grid;grid-template-columns:auto 0 minmax(0,1fr) 0 auto;background:var(--bg);color:var(--color-text);overflow:hidden;box-sizing:border-box}.app[data-v-8cd3196b]>*{min-height:0;min-width:0}.app>.side[data-v-8cd3196b]{grid-column:1}.side-handle[data-v-8cd3196b]{grid-column:2}.app:not(.mobile)>.con[data-v-8cd3196b]{grid-column:3}.preview-handle[data-v-8cd3196b]{grid-column:4}.sidebar-toggle-btn[data-v-8cd3196b]{position:absolute;top:11px;left:16px;z-index:var(--z-sticky);animation:sidebar-toggle-btn-in-8cd3196b .18s var(--ease-out) .12s backwards;-webkit-app-region:no-drag}.app.macos-desktop .sidebar-toggle-btn[data-v-8cd3196b]{left:72px;animation:none}@keyframes sidebar-toggle-btn-in-8cd3196b{0%{opacity:0}}.internal-build-fab[data-v-8cd3196b]{position:absolute;right:var(--space-3);bottom:var(--space-3);z-index:var(--z-sticky);pointer-events:none}.app.mobile[data-v-8cd3196b]{grid-template-columns:1fr;grid-template-rows:auto 1fr}.global-preview[data-v-8cd3196b]{grid-column:5;min-width:0;min-height:0;width:0;background:var(--bg);overflow:hidden;transition:width .28s cubic-bezier(.4,0,.2,1)}.global-preview.open[data-v-8cd3196b]{width:var(--preview-w)}.global-preview.no-anim[data-v-8cd3196b]{transition:none}.global-preview[data-v-8cd3196b]:not(.mobile)>*{width:var(--preview-w);height:100%;box-sizing:border-box;border-left:1px solid var(--line)}.global-preview.mobile[data-v-8cd3196b]{position:fixed;inset:0;z-index:var(--z-sticky);width:auto;transition:none;border-top:2px solid var(--color-text)}@media(max-width:640px){.auth-page[data-v-8cd3196b]{align-items:flex-start;padding:max(48px,var(--safe-top)) max(20px,var(--safe-right)) max(24px,var(--safe-bottom)) max(20px,var(--safe-left))}.auth-page-copy h1[data-v-8cd3196b]{font-size:26px}.auth-page-btn[data-v-8cd3196b]{width:100%}}:root{--panel-head-h: 48px}.app:not(.mobile) .chat-header{transition:padding-left .28s cubic-bezier(.4,0,.2,1)}.app.sidebar-collapsed .chat-header{padding-left:52px}.app.sidebar-collapsed.macos-desktop .chat-header{padding-left:108px}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-opsz-normal-BM0NlUE_.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-opsz-normal-BwkfbSeq.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-opsz-italic-mtaF_0H_.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:italic;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(data:font/woff2;base64,d09GMgABAAAAAAfsABQAAAAAEAwAAAeCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbHhwoP0hWQVJbBmA/U1RBVIFiJyYAdC9qEQgKhGSEAAsgADCGCAE2AiQDOgQgBYlMB4EUDAcbLQ4onoexrSC/2ZyLAa8p8VHB8/x3Vue+V0hVJalMJg2nx/TCrQXxBeqLjQG7FyM1WEa/X1tEXN7cFz9EJEMmMUz3RihWSSKeQCbcIou0izz/C8v+fq3VfajEa9gDD11CImXS7qL/RJFVzC1qiB6KmKeD6TZdQ6IRGv78dL6uSVVCfgni5mzu7kcgQBgAEAQTQRCoL++STTYybkJxNfQxAAIAGu8OdEB9teW2jh4BpgDqFjAeSEByW3zFP0CBBgNMsMCGEDjgggdhiEAUAeIIED7ABTDUEnkIE9Q9ahFgKttcVhApo4ACB4qobHaccgDfEjFO6aaWUhjMLt2SyIvHKoDqoA4CSUwEIYQCEjhAO9R1G6keDeDZGjNo+AhxOjCEGTr1WeIF3kYBiLAOKvkJSMiKX0VdAyQt3SDJClCkxJCHkCzfqyVTriJZLcolS32JZHUekq2TYNkYtCtjYHMQXSxGjXDz2t/yLWXzDzxz+o3zFwDEaN23F+13pyMdQAEaSKAR9vcGq4A4MTSKCElGW+M7UcY7xqkggITb28ZJhlqc9q2twYKTt0NjixBgYvO9BIihEBLYuOFXQzfIQ7dXGUEEEgFDooBfAzqiQbpJrhiWSuKJCRFKYbHCyJKI2G5GiZbNAvgAu5pc3vwx4G+g3aDkhklABiSz0BICXrYghtYhx/cdJ+44rY2oZ0aMNRFz3VZjb6W33F3gzltqtOCV8tTHSpOeXuItfvr5lCdfzFpqtEitvqdcdGGFd28ZqqC0tPbeChGXgrIlnhSWu/eUso4uKWFLugyDzQJhflY4659+WjQ++6x72WUMv9G8mw6QJl7BVxX5fe/kpUsOvnZwee9uQ0cGXYd0o89XB2748sDSnt8d2VphdOTTgceDVvOds0v9P/s7HPq15aGun/6Vllb56f1dl0t1LejqrNkpdRZsG8TOnM5vkBG5oiVyVGnS8LHps5cfNWJs6qKPfaNSxiQNBUm3cKNWROr0GSur7Za31k1vieq7LH11VF+jXdRIasRKflc7jkobm1Z9te1IyZA0pDkhLR98+H37Zf1c/8at+dB7x+7GfVyTfJMPiYztsnl59Y5l4j+0n1RXlpHnF3Tq7HecmNF/CJodEMAikruxiyJaGLvHOdAfoA+oDvpjBm2b91cHGRZMU9n25xEU0A8fgEEAdKI3Q1iDtc034sug5YVMkE2jsE+BIkwSoQ3gxXMqz9tELp48bd0cFKOKS7xYjEuXBnZP5ia7DyiO/X/YI+PQSbt2uSdqAkWL9nQbV1XB94/+uPfdZz8dnXYFBYrcTl2SIR/ybxJNJPz/Gupb0JaZeens2ekC7EKr8t+Ls/P5VJPYJdHKyqfg2nqU6bhlidzcddQV/7MmecTzJ5VPcKXkNKSEogHjYFx6QZ7rQ+FSe8njaiNuOnXS8H2ScQ619c2mC3VTtauL0rRbXd/CkSOP37FY9Zkjz8+GibYUMOEWF+RdrFS8Ecv1SHOpPUPZGEIpjPvFyU5cXKjd6OXqorTqy9GwRd++HVufPGnVsW+aO3vggKZ18jR9sXaTC1PWTEsVUaK0FkNySbTQDqlm2PfDjZcu4aalnSLKjnOoYQ0nUlqqXcGpPu/4VgV/xU2pAqW4BW3qzhQ8/hFKhV2qE3+BKAtDqBXjfgnVdH4y0wg5tbVNRenNdTWOrenWLcupQdmsbq5b+18piTe/xRdp1xbILxNPJGInm2z6hoB21Lal0i+ePTtd7B45+3XhFJ329evskXm7qurUVREotqSluSo/L29d3qDhI4YOQqWhI4YNvBNfsMHeXKemXrxQfKeuPOGRVayA3JtkJKEgbPp+dXUDluddutRYLFoXGXWX6N3WFaGLbQtRSitVYNacTNSdy7AaG/HSaUEANcBoGXNdcZvZsOqQ1icBDv21/gzAoYPHH/WDW0qNR3QTYKEAEHig6o13NXbND06CQPlRtYjGNnSktRc09k1mAMDvAlDKfQjgy6fssInlfzmNAjKkDxoxHOBLdVRAIVt9j4qo+hA1w9T1aNBNTUOTTNUHLbqokE+UAfJXCIGw/IxCSL5GRUJeR40rL/UxTm4Q08H6MbCs70ObuNyIIXrINHQYInF06UUlevTjbQzTh5upiDMzMMogUtEnjPs/Y7jAHCJeB0GBHh04tC6FiB6ZFB1oArUSIoFoqhzCeAN6lHwm0T4C3VVPWvjpSMXReuWesMEcoqrmgtNBGd2noWeV0hNAz9rFeShNJxHGsPa3HXeKTk8b55hahySYHaYKKFFLpCfN8rsoaJn01CR04Gkc+5k7KVTCmClX8Q10HCrUEkVlSX+XO33oQR9609tJ516H497WSobWs5Up6TLaS10/dessIskgJSLiDlWvHVUywpkQ7hdPZqGyiEF0uVQerVcPamT1A3eKXdyI1vG9OoflrSXihZ1qqGE3nhmAgiIbRCQgPLEPtOM3UQwTLYaYYomNlpA44opnjV6jkD6id80OOrzf6BzmMD6eEa1zKyeYG1fzfEf16V6jw9XYOaar1/b2kP/IYX8oR2mcFvv2GtBV3JXgd437AQAA) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*,*:before,*:after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;tab-size:4}body{margin:0}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit;margin:0}p,blockquote,dl,dd,figure,pre{margin:0}ol,ul,menu{list-style:none;margin:0;padding:0}a{color:inherit;text-decoration:inherit}b,strong{font-weight:var(--weight-medium)}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}button,input,optgroup,select,textarea{margin:0;padding:0;font-family:inherit;font-size:100%;line-height:inherit;color:inherit}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background:transparent;background-image:none}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block}img,video{max-width:100%;height:auto}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1}table{border-collapse:collapse;border-color:inherit;text-indent:0}hr{height:0;color:inherit;border-top-width:1px}fieldset{margin:0;padding:0}legend{padding:0}dialog{padding:0}summary{display:list-item}[hidden]{display:none}@supports (interpolate-size: allow-keywords){:root{interpolate-size:allow-keywords}}:root{--dim: #595959;--muted: #8a8a8a;--faint: #b5b5b5;--line: #e9edf3;--line2: #f1f4f8;--canvas: #f4f6fa;--sh: 0 1px 3px rgba(28, 40, 66, .05), 0 6px 18px rgba(28, 40, 66, .06);--shc: 0 1px 2px rgba(28, 40, 66, .05);--panel: #fafbfc;--panel2: #f3f5f8;--bg: #ffffff;--blue: #1783ff;--blue2: #0f6fe0;--soft: #e8f3ff;--bd: #cfe6ff;--logo: #1783ff;--bluebg: #e8f3ff;--blueln: #cfe6ff;--ok: #0e7a38;--warn: #a9610a;--star: #eab308;--err: #c0392b;--hover: rgba(0, 0, 0, .05);--r-xs: var(--radius-sm);--r-sm: var(--radius-md);--r-md: var(--radius-lg);--r-lg: var(--radius-xl);--base-ui-font-size: 14px;--ui-font-size: var(--base-ui-font-size);--ui-font-size-sm: calc(var(--ui-font-size) - 1px);--ui-font-size-xs: calc(var(--ui-font-size) - 2px);--ui-font-size-lg: calc(var(--ui-font-size) + 1px);--ui-font-size-xl: calc(var(--ui-font-size) + 2px);--content-font-size: calc(var(--base-ui-font-size) + 1px);--mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--sans: var(--font-ui);color-scheme:light dark}:root{--safe-top: env(safe-area-inset-top, 0px);--safe-right: env(safe-area-inset-right, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);--safe-left: env(safe-area-inset-left, 0px)}.kw-icon{display:inline-block;flex:none;vertical-align:-.15em}code,pre,kbd,samp,tt{font-feature-settings:"liga" 0,"calt" 0,"ss01" 0;font-variant-ligatures:none}html[data-color-scheme=light]{color-scheme:light}html[data-color-scheme=system]{color-scheme:light dark}html[data-color-scheme=dark]{color-scheme:dark;--dim: #9aa0a8;--muted: #727983;--faint: #525960;--line: #2d333b;--line2: #22272e;--panel: #1c2128;--panel2: #161b22;--bg: #0d1117;--blue: #58a6ff;--blue2: #79b8ff;--soft: #1f2937;--bd: #1f6feb;--logo: #58a6ff;--bluebg: #1c2a3a;--blueln: #1f4f7a;--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: rgba(255, 255, 255, .07);--canvas: #161b22;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--dim: #9aa0a8;--muted: #727983;--faint: #525960;--line: #2d333b;--line2: #22272e;--panel: #1c2128;--panel2: #161b22;--bg: #0d1117;--blue: #58a6ff;--blue2: #79b8ff;--soft: #1f2937;--bd: #1f6feb;--logo: #58a6ff;--bluebg: #1c2a3a;--blueln: #1f4f7a;--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: rgba(255, 255, 255, .07);--canvas: #161b22;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}}html[data-accent=mono]{--accent-primary: #171717;--color-accent: #171717;--color-accent-hover: #383838;--color-accent-soft: #f1f1f2;--color-accent-bd: #d4d4d8;--blue: #171717;--blue2: #383838;--soft: #f1f1f2;--bd: #d4d4d8;--bluebg: #f4f4f5;--blueln: #e4e4e7;--logo: #171717}html[data-color-scheme=dark][data-accent=mono]{--accent-primary: #e8eaed;--color-accent: #e8eaed;--color-accent-hover: #c9cdd4;--color-accent-soft: #21262d;--color-accent-bd: #444c56;--blue: #e8eaed;--blue2: #c9cdd4;--soft: #21262d;--bd: #444c56;--bluebg: #21262d;--blueln: #30363d;--logo: #e8eaed}@media(prefers-color-scheme:dark){html[data-color-scheme=system][data-accent=mono]{--accent-primary: #e8eaed;--color-accent: #e8eaed;--color-accent-hover: #c9cdd4;--color-accent-soft: #21262d;--color-accent-bd: #444c56;--blue: #e8eaed;--blue2: #c9cdd4;--soft: #21262d;--bd: #444c56;--bluebg: #21262d;--blueln: #30363d;--logo: #e8eaed}}:root{--accent-primary: #1783ff;--accent-secondary: #6b7280;--surface-light: #ffffff;--surface-dark: #0d1117;--color-bg: #ffffff;--color-surface: #fafbfc;--color-surface-raised: #ffffff;--color-surface-sunken: #f3f5f8;--color-media-alpha-bg-1: color-mix(in srgb, var(--color-bg) 52%, var(--color-text) 48%);--color-media-alpha-bg-2: color-mix(in srgb, var(--color-bg) 42%, var(--color-text) 58%);--media-alpha-canvas: conic-gradient( var(--color-media-alpha-bg-1) 25%, var(--color-media-alpha-bg-2) 0 50%, var(--color-media-alpha-bg-1) 0 75%, var(--color-media-alpha-bg-2) 0 ) 0 0 / 16px 16px;--color-text: rgba(0, 0, 0, .9);--color-text-muted: #6b7280;--color-text-faint: #9aa3af;--color-text-on-accent: #ffffff;--color-line: #e7eaee;--color-line-strong: #d4d9e0;--color-selected: #00000014;--color-hover: #0000000d;--color-sidebar-bg: #fbfaf9;--color-accent: var(--accent-primary);--color-accent-hover: #0f6fe0;--color-accent-soft: #e8f3ff;--color-accent-bd: #cfe6ff;--color-success: #0e7a38;--color-success-soft: #e7f6ee;--color-success-bd: #bfe3cc;--color-warning: #a9610a;--color-warning-soft: #fbf1e0;--color-warning-bd: #f0d9b8;--color-danger: #c0392b;--color-danger-soft: #fbeaea;--color-danger-bd: #f0cccc;--color-done: #8250df;--color-done-soft: #f3e8ff;--color-done-bd: #e0ccff;--color-info: var(--accent-primary);--color-logo-dev: #f5b301;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-8: 32px;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-2xl: 20px;--radius-full: 999px;--z-base: 0;--z-sticky: 100;--z-dropdown: 200;--z-tooltip: 250;--z-overlay: 300;--z-modal: 400;--z-toast: 600;--z-max: 9999;--shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);--shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .05);--shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .08);--shadow-xl: 0 24px 64px rgba(16, 24, 40, .18), 0 8px 20px rgba(16, 24, 40, .1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--duration-fast: .12s;--duration-base: .16s;--duration-slow: .26s;--font-ui: "Inter Variable", "Inter", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-display: var(--font-ui);--font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--text-xs: 12px;--text-sm: 13px;--text-base: 14px;--text-lg: 16px;--text-xl: 18px;--text-2xl: 22px;--leading-tight: 1.25;--leading-normal: 1.5;--leading-relaxed: 1.7;--weight-regular: 400;--weight-medium: 500;--weight-semibold: 700;--p-focus-ring: 0 0 0 3px var(--color-accent-soft);--p-focus-ring-strong: 0 0 0 3px var(--color-accent-soft), 0 0 0 1px var(--color-accent);--p-selection: rgba(23, 131, 255, .18);--p-ic-sm: 14px;--p-ic-md: 16px;--p-ic-lg: 20px;--p-sidebar-w: 264px;--p-content-max: 760px;--p-content-wide: 920px;--p-table-max: 1040px;--p-table-cell-max: 700px;--p-bp-sm: 640px;--p-bp-md: 980px}html[data-color-scheme=dark]{--accent-primary: #58a6ff;--color-bg: #0d1117;--color-surface: #161b22;--color-surface-raised: #1c2128;--color-surface-sunken: #0d1117;--color-text: #c9cdd4;--color-text-muted: #9aa0a8;--color-text-faint: #6b7280;--color-line: #2d333b;--color-line-strong: #3d444d;--color-selected: #ffffff14;--color-hover: #ffffff0d;--color-sidebar-bg: #181817;--color-accent: #58a6ff;--color-accent-hover: #79b8ff;--color-accent-soft: rgba(88, 166, 255, .14);--p-selection: rgba(88, 166, 255, .32);--color-accent-bd: rgba(88, 166, 255, .28);--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-info: #58a6ff;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--accent-primary: #58a6ff;--color-bg: #0d1117;--color-surface: #161b22;--color-surface-raised: #1c2128;--color-surface-sunken: #0d1117;--color-text: #c9cdd4;--color-text-muted: #9aa0a8;--color-text-faint: #6b7280;--color-line: #2d333b;--color-line-strong: #3d444d;--color-selected: #ffffff14;--color-hover: #ffffff0d;--color-sidebar-bg: #181817;--color-accent: #58a6ff;--color-accent-hover: #79b8ff;--color-accent-soft: rgba(88, 166, 255, .14);--p-selection: rgba(88, 166, 255, .32);--color-accent-bd: rgba(88, 166, 255, .28);--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-info: #58a6ff;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}}html,body,#app{height:100%;margin:0;background:var(--bg)}#app{position:fixed;inset:0}html,body{overflow:hidden}@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:rgba(128,128,128,.3) transparent}}*::-webkit-scrollbar{width:6px;height:6px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:#8080804d;border-radius:999px}*::-webkit-scrollbar-thumb:hover{background:#80808080}*::-webkit-scrollbar-corner{background:transparent}body{font-family:var(--sans);color:var(--color-text);background:var(--bg);font-size:var(--ui-font-size);font-weight:400;line-height:1.6;font-optical-sizing:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto;font-synthesis:none;text-size-adjust:100%;-webkit-hyphens:none;hyphens:none}@media(max-width:640px){.backdrop{align-items:flex-end;justify-content:stretch}.backdrop .dialog{width:100%;max-width:100%;max-height:88vh;border-radius:16px 16px 0 0;border-left:none;border-right:none;border-bottom:none;border-top:1px solid var(--line);box-shadow:0 -10px 30px #0000002e;animation:kimi-sheet-up .26s cubic-bezier(.4,0,.2,1)}}@keyframes kimi-sheet-up{0%{transform:translateY(101%)}to{transform:translateY(0)}}.backdrop,.ob-backdrop{min-width:100vw!important;min-height:100vh!important;min-height:100dvh!important}@keyframes kimi-card-in{0%{opacity:0;transform:translateY(8px) scale(.995)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes kimi-check-in{0%{opacity:0;transform:scale(.4)}60%{opacity:1;transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){*{animation-duration:.001ms!important;animation-delay:0ms!important;transition-duration:.001ms!important}}.ch-eyes{animation:kimi-eye-look 16s ease-in-out infinite}.ch-eye{transform-box:fill-box;transform-origin:center;animation:kimi-eye-blink 11s ease-in-out infinite}@keyframes kimi-eye-look{0%,42%{transform:translate(0)}47%,53%{transform:translate(2px)}58%,80%{transform:translate(0)}84%,90%{transform:translate(-2px)}95%,to{transform:translate(0)}}@keyframes kimi-eye-blink{0%,94%,to{transform:scaleY(1)}96.5%,98%{transform:scaleY(.12)}}@media(prefers-reduced-motion:reduce){.ch-eyes,.ch-eye{animation:none}}.ch-logo.blink-now .ch-eye{animation:kimi-eye-blink-once .24s ease-in-out}@keyframes kimi-eye-blink-once{0%,to{transform:scaleY(1)}50%{transform:scaleY(.1)}}.md .markdown-renderer img{min-width:0;min-height:0}.app{font-size:var(--ui-font-size)}.md,.md .markdown-renderer,.md .markdown-renderer p,.md .markdown-renderer li,.md .markdown-renderer blockquote,.md .markdown-renderer td,.md .markdown-renderer th,.u-bub,.u-bub .u-text,.a-msg .msg,.box .bb,.ph{font-size:var(--content-font-size)}.md .code-block-container pre,.md .markstream-pre,.md .code-block-container pre code,.md .diff-pre code,.box .bh,.queue-item,.queue-text,.ctx-num,.model-pill,.perm-pill,.mode-pill,.compact-chip,.qcard,.qtext,.qopt,.qbtn,.srow,.srow-val{font-size:var(--ui-font-size)}.md :not(pre)>code,.md .inline-code,.a-msg code,.qopt-desc,.srow-label{font-size:var(--ui-font-size-sm)}.code-block-header,.code-block-header *,.diff-lang,.queue-label,.qopt-key,.qstep,.srow-sub{font-size:var(--ui-font-size-xs)}@media(max-width:640px){.u-bub .u-text,.a-msg .msg,.ph{font-size:max(16px,var(--ui-font-size-xl))}} diff --git a/apps/kimi-code/dist-web/assets/index-COMYI0Oj.js b/apps/kimi-code/dist-web/assets/index-COMYI0Oj.js new file mode 100644 index 0000000000..9e70e77214 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-COMYI0Oj.js @@ -0,0 +1,153 @@ +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-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-UfJy6YNI.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-Dm6A9KJ5.js","assets/ruby-DyJCeAvU.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-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.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-DbPARsA_.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-D7OTSIA_.js","assets/r-Dspwwk_N.js","assets/just-CUsbIsdP.js","assets/perl-B9cMNwum.js","assets/latex-CaSxy8MP.js","assets/tex-idrVyKtj.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/php-Csjmro_R.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/csharp-DSvCPggb.js","assets/rst-CpCqk9r5.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-Bq5Q-fJD.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-D351s5mN.js","assets/twig-CW1WmMYd.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]); +import{bR as c}from"./index-DtRfJ0vw.js";var Pt=Object.defineProperty,Oi=Object.getOwnPropertyDescriptor,xi=Object.getOwnPropertyNames,Di=Object.prototype.hasOwnProperty,Jt=(e,t)=>{let n={};for(var r in e)Pt(n,r,{get:e[r],enumerable:!0});return Pt(n,Symbol.toStringTag,{value:"Module"}),n},Ni=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=xi(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Oi(t,a))||r.enumerable});return e},lr=(e,t,n)=>(Ni(e,t,"default"),n);const nt=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.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-Dqspr-GT.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-Ve4PFQV2.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"],import:(()=>c(()=>import("./bat-BkioyH1T.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-BIv1doCn.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-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-MRO5bC_T.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:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.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([21,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([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{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([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{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([41,42])))},{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([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.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([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{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([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{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([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.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([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{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([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,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-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{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-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{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([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.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([37,26])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-KW6xsasC.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([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,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-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.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([71,72])))},{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([73,37,26])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.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:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,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"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.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([76,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([77,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-Dspwwk_N.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([78,1,2,3,79])))},{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-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.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([83,84])))},{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([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{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([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.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([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{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([94,11,3,2,25,26,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-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{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-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.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-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,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([100,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"),[]))}],Zt=Object.fromEntries(nt.map(e=>[e.id,e.import])),Yt=Object.fromEntries(nt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),en={...Zt,...Yt},tn=[{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-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.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-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.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-D4h5O-jR.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-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.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-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.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"),[]))}],nn=Object.fromEntries(tn.map(e=>[e.id,e.import]));var rn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Vi(){return 2147483648}function $i(){return typeof performance<"u"?performance.now():Date.now()}const Mi=(e,t)=>e+(t-e%t)%t;async function Gi(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,b){r.HEAPU8.copyWithin(h,m,m+b)}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 b=Vi();if(h>b)return!1;for(let E=1;E<=4;E*=2){let g=m*(1+.2/E);g=Math.min(g,h+100663296);const _=Math.min(b,Mi(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,b=1024){const E=m+b;let g=m;for(;h[g]&&!(g>=E);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let _="";for(;m>10,56320|x&1023)}}return _}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:$i,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 Bi=Object.defineProperty,Ui=(e,t,n)=>t in e?Bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t,n)=>Ui(e,typeof t!="symbol"?t+"":t,n);let D=null;function Fi(e){throw new rn(e.UTF8ToString(e.getLastOnigError()))}class rt{constructor(t){T(this,"utf16Length"),T(this,"utf8Length"),T(this,"utf16Value"),T(this,"utf8Value"),T(this,"utf16OffsetToUtf8"),T(this,"utf8OffsetToUtf16");const n=t.length,r=rt._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 it=class z{constructor(t){if(T(this,"id",++z.LAST_ID),T(this,"_onigBinding"),T(this,"content"),T(this,"utf16Length"),T(this,"utf8Length"),T(this,"utf16OffsetToUtf8"),T(this,"utf8OffsetToUtf16"),T(this,"ptr"),!D)throw new rn("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new rt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!z._sharedPtrInUse?(z._sharedPtr||(z._sharedPtr=D.omalloc(1e4)),z._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,z._sharedPtr),this.ptr=z._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===z._sharedPtr?z._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};T(it,"LAST_ID",0);T(it,"_sharedPtr",0);T(it,"_sharedPtrInUse",!1);let ur=it;class ji{constructor(t){if(T(this,"_onigBinding"),T(this,"_ptr"),!D)throw new rn("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)),Hi(r)?r=await r.instantiator(n):Wi(r)?r=await r.default(n):(zi(r)&&(r=r.data),qi(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Ki(r)(n):r=await Qi(r)(n):Xi(r)?r=await gt(r)(n):r instanceof WebAssembly.Module?r=await gt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await gt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Ne=t(),Ne}function gt(e){return t=>WebAssembly.instantiate(e,t)}function Ki(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Qi(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let cr;function Ji(e){cr=e}function Zi(){return cr}async function dr(e){return e&&await on(e),{createScanner(t){return new ji(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new ur(t)}}}const Yi=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:dr,getDefaultWasmLoader:Zi,loadWasm:on,setDefaultWasmLoader:Ji},Symbol.toStringTag,{value:"Module"}));var pr=Jt({});lr(pr,Yi);var R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function eo(e){return sn(e)}function sn(e){return Array.isArray(e)?to(e):e instanceof RegExp?e:typeof e=="object"?no(e):e}function to(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function fr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?fr(e.substring(0,e.length-1)):e.substr(~t+1)}var _t=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ve=class{static hasCaptures(e){return e===null?!1:(_t.lastIndex=0,_t.test(e))}static replaceCaptures(e,t,n){return e.replace(_t,(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 mr(e,t){return et?1:0}function gr(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=>ro(e.parent,i.parentScopes));return r?new Er(r.fontStyle,r.foreground,r.background):null}},yt=class Fe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Fe(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&&!io(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function io(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Er=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function oo(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&&(E=m.slice(0,m.length-1),E.reverse()),n[r++]=new so(b,E,i,l,u,p)}}return n}var so=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 ao(e,t){e.sort((l,u)=>{let p=mr(l.scope,u.scope);return p!==0||(p=gr(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 lo(t),s=new Er(n,o.getId(r),o.getId(i)),a=new co(new Ot(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)}},co=class xt{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(xt._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 xt(this._mainRule.clone(),Ot.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 ze(e,t){const n=[],r=po(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(bn(i)){const l=[];do l.push(i),i=r.next();while(bn(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 bn(e){return!!e&&!!e.match(/[\w\.:]+/)}function po(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 wr(e){typeof e.dispose=="function"&&e.dispose()}var Le=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ho=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},fo=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))}},mo=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Le(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new fo;for(const n of e)go(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Le){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 go(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 Le?je({baseGrammar:o,selfGrammar:i},r):Dt(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 Le(a))}function Dt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];qe([r],t,n)}}function je(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&qe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&qe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function qe(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?hr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&qe(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=vr(o);switch(s.kind){case 0:je({...t,selfGrammar:t.baseGrammar},n);break;case 1:je(t,n);break;case 2:Dt(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?Dt(s.ruleName,l,n):je(l,n)}else s.kind===4?n.add(new ho(s.scopeName,s.ruleName)):n.add(new Le(s.scopeName));break}}}var _o=class{kind=0},yo=class{kind=1},Eo=class{constructor(e){this.ruleName=e}kind=2},bo=class{constructor(e){this.scopeName=e}kind=3},wo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function vr(e){if(e==="$base")return new _o;if(e==="$self")return new yo;const t=e.indexOf("#");if(t===-1)return new bo(e);if(t===0)return new Eo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new wo(n,r)}}var vo=/\\(\d+)/,wn=/\\(\d+)/g,Co=-1,Cr=-2;var Pe=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ve.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ve.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${fr(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:Ve.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ve.replaceCaptures(this._contentName,e,t)}},Ao=class extends Pe{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!")}},So=class extends Pe{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Re(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 Ie,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vn=class extends Pe{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 Ie,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nt=class extends Pe{_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 Re(i,this.id),this.beginCaptures=o,this._end=new Re(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 Ie;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}},Xe=class extends Pe{_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 Re(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Re(s,Cr),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 Ie;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 Ie,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ar=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Ao(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new So(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=hr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new vn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new Xe(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 Nt(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 wn.lastIndex=0,this.source.replace(wn,(i,o)=>_r(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 Cn(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 Cn(e,r,this._items.map(i=>i.ruleId))}},Cn=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 Et(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Vt.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/},Ro=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])=>_r(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])}},An=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Lr(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,p=-1;if(s){const h=Io(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 An(i,!0);f()}return new An(i,!1);function f(){const h=ko(e,t,n,r,i,p);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,b=h.matchedRuleId,E=m&&m.length>0?m[0].end>r:!1;if(b===Co){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(),!E&&_.getEnterPos()===r){i=_,o.produce(i,l),u=!0;return}}else{const g=e.getRule(b);o.produce(i,m[0].start);const _=i,w=g.getName(t.content,m),A=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(b,r,p,m[0].end===l,null,A,A),g instanceof Nt){const S=g;Ce(e,t,n,i,o,S.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const x=S.getContentName(t.content,m),M=A.pushAttributed(x,e);if(i=i.withContentNameScopesList(M),S.endHasBackReferences&&(i=i.withEndRule(S.getEndWithResolvedBackReferences(t.content,m))),!E&&_.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(g instanceof Xe){const S=g;Ce(e,t,n,i,o,S.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const x=S.getContentName(t.content,m),M=A.pushAttributed(x,e);if(i=i.withContentNameScopesList(M),S.whileHasBackReferences&&(i=i.withEndRule(S.getWhileWithResolvedBackReferences(t.content,m))),!E&&_.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(),!E){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Io(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 Xe&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:p}=Oo(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,p);if(d){if(d.ruleId!==Cr){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 ko(e,t,n,r,i,o){const s=To(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Po(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 Rr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Oo(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 b=f.getName(a,s),E=r.contentNameScopesList.pushAttributed(b,e),g=f.getContentName(a,s),_=E.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,E,_),A=e.createOnigString(a.substring(0,h.end));Lr(e,A,n&&h.start===0,h.start,w,i,!1,0),wr(A);continue}const m=f.getName(a,s);if(m!==null){const E=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new xo(E,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var xo=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Do(e,t,n,r,i,o,s,a){return new Vo(e,t,n,r,i,o,s,a)}function Sn(e,t,n,r,i){const o=ze(t,Ke),s=Ar.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 Ke(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var Vo=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Lo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Ln(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=ze(l,Ke);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)Sn(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&&Sn(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]=Ln(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=Ar.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===$t.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),d=_e.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 $t(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 Mo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Lr(this,o,i,0,t,a,!0,r);return wr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ln(e,t){return e=eo(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 q{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=yt.push(i,o.scopeNames),r=new q(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new q(null,new yt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new yt(null,t),s=r.themeProvider.themeMatch(o),a=q.mergeAttributes(n,i,s);return new q(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return q.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),_e.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return q._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=q._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=q.mergeAttributes(t.tokenAttributes,i,s);return new q(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}},$t=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))}},$o=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ze(n,Ke).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ze(n,Ke).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}},Mo=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=_e.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=_e.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)}},Mt=$t.NULL;function Qe(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 ne(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Uo(e){return Array.isArray(e)?e:[e]}async function Ir(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ot(e){return!e||["plaintext","txt","text","plain"].includes(e)}function kr(e){return e==="ansi"||ot(e)}function st(e){return e==="none"}function Tr(e){return st(e)}const Fo=/(\r?\n)/g;function at(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(Fo);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"?Rn.light:Rn.dark),n||(n=t.type==="light"?In.light:In.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,kn,{enumerable:!1,writable:!1,value:!0}),t}async function Pr(e){return[...new Set((await Promise.all(e.filter(t=>!kr(t)).map(async t=>await Ir(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Or(e){return(await Promise.all(e.map(async t=>Tr(t)?null:an(await Ir(t))))).filter(t=>!!t)}function xr(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 R(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var jo=class extends Bo{_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=an(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=We.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=xr(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 R(`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))}},Ho=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 Wo(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 R("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(an),i=new jo(new Ho(e.engine,n),r,n,e.langAlias);let o;function s(_){return xr(_,e.langAlias)}function a(_){E();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new R(`Language \`${_}\` not found, you may need to load it first`);return w}function l(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};E();const w=i.getTheme(_);if(!w)throw new R(`Theme \`${_}\` not found, you may need to load it first`);return w}function u(_){E();const w=l(_);return o!==_&&(i.setTheme(w),o=_),{theme:w,colorMap:i.getColorMap()}}function p(){return E(),i.getLoadedThemes()}function d(){return E(),i.getLoadedLanguages()}function f(..._){E(),i.loadLanguages(_.flat(1))}async function h(..._){return f(await Pr(_))}function m(..._){E();for(const w of _.flat(1))i.loadTheme(w)}async function b(..._){return E(),m(await Or(_))}function E(){if(t)throw new R("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:b,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}async function zo(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Or(e.themes||[]),Pr(e.langs||[]),e.engine]);return Wo({...e,themes:t,langs:n,engine:r})}const Dr=new WeakMap;function lt(e,t){Dr.set(e,t)}function ke(e){return Dr.get(e)}var ut=class Nr{_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 Nr(Object.fromEntries(Uo(n).map(r=>[r,Mt])),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 qo(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function qo(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 Xo(e,t){if(!(e instanceof ut))throw new R("Invalid grammar state");return e.getInternalStack(t)}const Ko=/,/,Qo=/ /;function Vr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(ot(e.resolveLangAlias(n.lang||"text"))||st(r))return at(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 R(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new R(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Zo(t,s,i,o,n)}function Jo(...e){if(e.length===2)return ke(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(ot(i)||st(o))throw new R("Plain language does not have grammar state");if(i==="ansi")throw new R("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new ut(ln(n,l,s,a,r).stateStack,l.name,s.name)}function Zo(e,t,n,r,i){const o=ln(e,t,n,r,i),s=new ut(o.stateStack,t.name,n.name);return lt(o.tokens,s),o.tokens}function ln(e,t,n,r,i){const o=Qe(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=i,l=at(e);let u=i.grammarState?Xo(i.grammarState,n.name)??Mt:i.grammarContextCode!=null?ln(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Mt,p=[];const d=[];for(let f=0,h=l.length;f0&&m.length>=s){p=[],d.push([{content:m,offset:b,color:"",fontStyle:0}]);continue}let E,g,_;i.includeExplanation&&(E=t.tokenizeLine(m,u,a),g=E.tokens,_=0);const w=t.tokenizeLine2(m,u,a),A=w.tokens.length/2;for(let S=0;Smt.trim());break;case"object":ce=K.scope;break;default:continue}Y.push({settings:K,selectors:ce.map(mt=>mt.split(Qo))})}we.explanation=[];let yn=0;for(;x+yn({scopeName:t}))}function es(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)Tn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function ns(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(ts(s,t,n)){r.push(o);break}return r}function $r(e,t,n,r=Vr){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:ke(p),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=rs(...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,b)=>{const{content:E,explanation:g,offset:_,...w}=m[p][f];h.variants[i[b].color]=w}),h})),l=o[0].state?new ut(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&<(a,l),a}function rs(...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"&&us.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(On,ps);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!On.test(o)){let s=o.replace(ls,ds);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=un}return new i(r,t)}function ds(e){return"-"+e.toLowerCase()}function ps(e){return e.charAt(1).toUpperCase()}const hs=Mr([Gr,ss,Fr,jr,Hr],"html"),Wr=Mr([Gr,as,Fr,jr,Hr],"svg"),xn={}.hasOwnProperty;function fs(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&xn.call(i,e)){const l=String(i[e]);s=xn.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 ms=/["&'<>`]/g,gs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_s=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ys=/[|\\{}()[\]^$+*?.]/g,Dn=new WeakMap;function Es(e,t){if(e=e.replace(t.subset?bs(t.subset):ms,r),t.subset||t.escapeOnly)return e;return e.replace(gs,n).replace(_s,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 bs(e){let t=Dn.get(e);return t||(t=ws(e),Dn.set(e,t)),t}function ws(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:"€"},Rs=["cent","copy","divide","gt","lt","not","para","times"],zr={}.hasOwnProperty,Ft={};let $e;for($e in wt)zr.call(wt,$e)&&(Ft[wt[$e]]=$e);const Is=/[^\dA-Za-z]/;function ks(e,t,n,r){const i=String.fromCharCode(e);if(zr.call(Ft,i)){const o=Ft[i],s="&"+o;return n&&Ls.includes(o)&&!Rs.includes(o)&&(!r||t&&t!==61&&Is.test(String.fromCharCode(t)))?s:s+";"}return""}function Ts(e,t,n){let r=Cs(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ks(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Ss(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],xs=["<",">"];function Ds(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return ge(o,Object.assign({},r.settings.characterReferences,{subset:xs}))}}function Ns(e,t,n,r){return""}function Nn(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 Vs(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function $s(e){return e.join(" ").trim()}const Ms=/[ \t\n\f\r]/g;function cn(e){return typeof e=="object"?e.type==="text"?Vn(e.value):!1:Vn(e)}function Vn(e){return e.replace(Ms,"")===""}const O=Xr(1),qr=Xr(-1),Gs=[];function Xr(e){return t;function t(n,r,i){const o=n?n.children:Gs;let s=(r||0)+e,a=o[s];if(!i)for(;a&&cn(a);)s+=e,a=o[s];return a}}const Bs={}.hasOwnProperty;function Kr(e){return t;function t(n,r,i){return Bs.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const dn=Kr({body:Fs,caption:vt,colgroup:vt,dd:zs,dt:Ws,head:vt,html:Us,li:Hs,optgroup:qs,option:Xs,p:js,rp:$n,rt:$n,tbody:Qs,td:Mn,tfoot:Js,th:Mn,thead:Ks,tr:Zs});function vt(e,t,n){const r=O(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&cn(r.value.charAt(0)))}function Us(e,t,n){const r=O(n,t);return!r||r.type!=="comment"}function Fs(e,t,n){const r=O(n,t);return!r||r.type!=="comment"}function js(e,t,n){const r=O(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 Hs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Ws(e,t,n){const r=O(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function zs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function $n(e,t,n){const r=O(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function qs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Xs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ks(e,t,n){const r=O(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Qs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Js(e,t,n){return!O(n,t)}function Zs(e,t,n){const r=O(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Mn(e,t,n){const r=O(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Ys=Kr({body:na,colgroup:ra,head:ta,html:ea,tbody:ia});function ea(e){const t=O(e,-1);return!t||t.type!=="comment"}function ta(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 na(e){const t=O(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 ra(e,t,n){const r=qr(n,t),i=O(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 ia(e,t,n){const r=qr(n,t),i=O(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 Me={name:[[` +\f\r &/=>`.split(""),` +\f\r "&'/=>\``.split("")],[`\0 +\f\r "&'/<=>`.split(""),`\0 +\f\r "&'/<=>\``.split("")]],unquoted:[[` +\f\r &>`.split(""),`\0 +\f\r "&'<=>\``.split("")],[`\0 +\f\r "&'<=>\``.split(""),`\0 +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function oa(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=Wr);const u=sa(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(s=!1),(u||!o||!Ys(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(p),!s&&(!o||!dn(e,t,n))&&a.push(""),a.join("")}function sa(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=aa(e,i,t[i]);o&&n.push(o)}}for(;++rNn(n,e.alternative)&&(s=e.alternative),a=s+ge(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Me.single:Me.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const la=["<","&"];function Qr(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ge(e.value,Object.assign({},r.settings.characterReferences,{subset:la}))}function ua(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Qr(e,t,n,r)}function ca(e,t,n,r){return r.all(e)}const da=fs("type",{invalid:pa,unknown:ha,handlers:{comment:Ds,doctype:Ns,element:oa,raw:ua,root:ca,text:Qr}});function pa(e){throw new Error("Expected node, not `"+e+"`")}function ha(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const fa={},ma={},ga=[];function _a(e,t){const n=t||fa,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ya,all:Ea,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||is,characterReferences:n.characterReferences||ma,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Wr:hs,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ya(e,t,n){return da(e,t,n,this)}function Ea(e){const t=[],n=e&&e.children||ga;let r=-1;for(;++ri);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let o=i,s=0;for(const a of t){if(oo&&i[o])}const La=["color","background-color"];function Ra(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return nr-i);return n.length?e.map(r=>r.flatMap(i=>{const o=n.filter(s=>i.offsets-i.offset).sort((s,a)=>s-a);return o.length?Ra(i,o):i})):e}function ka(e,t,n,r,i="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(p=>Je(e.variants[p])),a=new Set(s.flatMap(p=>Object.keys(p))),l={},u=(p,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[p]+(d==="color"?"":f)};return s.forEach((p,d)=>{for(const f of a){const h=p[f]||"inherit";if(d===0&&r&&La.includes(f))if(r==="light-dark()"&&s.length>1){const m=t.findIndex(E=>E==="light"),b=t.findIndex(E=>E==="dark");if(m===-1||b===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[f]=`light-dark(${s[m][f]||"inherit"}, ${s[b][f]||"inherit"})`,i==="css-vars"&&(l[u(d,f)]=h)}else l[f]=h;else i==="css-vars"&&(l[u(d,f)]=h)}}),o.htmlStyle=l,o}function Je(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&$.Italic&&(t["font-style"]="italic"),e.fontStyle&$.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&$.Underline&&n.push("underline"),e.fontStyle&$.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function jt(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Ta(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new R(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:r.posToIndex(s.line,l)}}};const r=Aa(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:i(s.start),end:i(s.end)}));Pa(o),e.set(n.meta,{decorations:o,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Ia(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=[...n.children].filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(p,d,f,h){const m=i[p];let b="",E=-1,g=-1;if(d===0&&(E=0),f===0&&(g=0),f===Number.POSITIVE_INFINITY&&(g=m.children.length),E===-1||g===-1)for(let w=0;wb);return p.tagName=d.tagName||"span",p.properties={...p.properties,...h,class:p.properties.class},d.properties?.class&&Jr(p,d.properties.class),p=m(p,f)||p,p}const l=[],u=r.decorations.sort((p,d)=>d.start.offset-p.start.offset||p.end.offset-d.end.offset);for(const p of u){const{start:d,end:f}=p;if(d.line===f.line)o(d.line,d.character,f.character,p);else if(d.lines(h,p));o(f.line,0,f.character,p)}}l.forEach(p=>p())}}}function Pa(e){for(let t=0;tn.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Na(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Ct[r]&&t.push({type:"setDecoration",value:Ct[r]});else if(r<=29){const i=Ct[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:se[r-30]}});else if(r===38){const i=Bn(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:se[r-40]}});else if(r===48){const i=Bn(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:se[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:se[r-100+8]}})}return t}function Va(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const s=Da(r,o),a=s.sequence?r.substring(o,s.startPosition):r.substring(o);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=Na(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}o=s.position}while(oMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||Ua[a]]}))),s=Va();return i.map(a=>s.parse(a[0]).map(l=>{let u,p;l.decorations.has("reverse")?(u=l.background?o.value(l.background):e.bg,p=l.foreground?o.value(l.foreground):e.fg):(u=l.foreground?o.value(l.foreground):e.fg,p=l.background?o.value(l.background):void 0),u=ne(u,r),p=ne(p,r),l.decorations.has("dim")&&(u=ja(u));let d=$.None;return l.decorations.has("bold")&&(d|=$.Bold),l.decorations.has("italic")&&(d|=$.Italic),l.decorations.has("underline")&&(d|=$.Underline),l.decorations.has("strikethrough")&&(d|=$.Strikethrough),{content:l.value,offset:a[1],color:u,bgColor:p,fontStyle:d}}))}function ja(e){const t=e.match(Ga);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],s=r[2],a=r[3];return`#${i}${i}${o}${o}${s}${s}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],o=r[1],s=r[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const n=e.match(Ba);return n?`var(${n[1]}-dim)`:e}function Ht(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!ot(r)&&!st(i)&&r==="ansi"){const{theme:o}=e.setTheme(i);return Fa(o,t,n)}return Vr(e,t,n)}function Ye(e,t,n){let r,i,o,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:p="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,_)=>g.color===u?-1:_.color===u?1:0);if(f.length===0)throw new R("`themes` option must not be empty");const h=$r(e,t,n,Ht);if(l=ke(h),u&&u!=="light-dark()"&&!f.some(g=>g.color===u))throw new R(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=f.map(g=>e.getTheme(g.theme)),b=f.map(g=>g.color);o=h.map(g=>g.map(_=>ka(_,b,p,u,d))),l&<(o,l);const E=f.map(g=>Qe(g.theme,n));i=Un(f,m,E,p,u,"fg",d),r=Un(f,m,E,p,u,"bg",d),s=`shiki-themes ${m.map(g=>g.name).join(" ")}`,a=u?void 0:[i,r].join(";")}else if("theme"in n){const u=Qe(n.theme,n);o=Ht(e,t,n);const p=e.getTheme(n.theme);r=ne(p.bg,u),i=ne(p.fg,u),s=p.name,l=ke(o)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:s,rootStyle:a,grammarState:l}}function Un(e,t,n,r,i,o,s){return e.map((a,l)=>{const u=ne(t[l][o],n[l])||"inherit",p=`${r+a.color}${o==="bg"?"-bg":""}:${u}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const d=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(d===-1||f===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ne(t[d][o],n[d])||"inherit"}, ${ne(t[f][o],n[f])||"inherit"});${p}`}return u}return s==="css-vars"?p:null}).filter(a=>!!a).join(";")}const Yr=/^\s+$/,Ha=/^(\s*)(.*?)(\s*)$/;function et(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>et(e,i,o),codeToTokens:(i,o)=>Ye(e,i,o)}){let i=t;for(const m of Ze(n))i=m.preprocess?.call(r,i,n)||i;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:p}=Ye(e,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?o=za(o):d==="never"&&(o=qa(o)),f&&(o=Xa(o));const h={...r,get source(){return i}};for(const m of Ze(n))o=m.tokens?.call(h,o)||o;return Wa(o,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},h,p)}function Wa(e,t,n,r=ke(e)){const i=Ze(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[b,E]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=E);let p={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:o};const f=[],h={...n,structure:a,addClassToHast:Jr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return p},get code(){return d},get lines(){return f}};if(e.forEach((b,E)=>{E&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:` +`}));let g={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const w of b){let A={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};const S=jt(w.htmlStyle||Je(w));S&&(A.properties.style=S);for(const x of i)A=x?.span?.call(h,A,E+1,_,g,w)||A;a==="inline"?s.children.push(A):a==="classic"&&g.children.push(A),_+=w.content.length}if(a==="classic"){for(const w of i)g=w?.line?.call(h,g,E+1)||g;f.push(g),o.push(g)}else a==="inline"&&f.push(g)}),a==="classic"){for(const b of i)d=b?.code?.call(h,d)||d;p.children.push(d);for(const b of i)p=b?.pre?.call(h,p)||p;s.children.push(p)}else if(a==="inline"){const b=[];let E={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of s.children)_.type==="element"&&_.tagName==="br"?(b.push(E),E={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&E.children.push(_);b.push(E);let g={type:"element",tagName:"code",properties:{},children:b};for(const _ of i)g=_?.code?.call(h,g)||g;s.children=[];for(let _=0;_0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=g.children[_];w.type==="element"&&s.children.push(...w.children)}}let m=s;for(const b of i)m=b?.root?.call(h,m)||m;return r&<(m,r),m}function za(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&$.Underline||o.fontStyle&$.Strikethrough));a&&Yr.test(o.content)&&t[s+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(a?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function qa(e){return e.map(t=>t.flatMap(n=>{if(Yr.test(n.content))return n;const r=n.content.match(Ha);if(!r)return n;const[,i,o,s]=r;if(!i&&!s)return n;const a=[{...n,offset:n.offset+i.length,content:o}];return i&&a.unshift({content:i,offset:n.offset}),s&&a.push({content:s,offset:n.offset+i.length+o.length}),a}))}function Xa(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),o=jt(i.htmlStyle||Je(i)),s=jt(r.htmlStyle||Je(r)),a=i.fontStyle&&(i.fontStyle&$.Underline||i.fontStyle&$.Strikethrough),l=r.fontStyle&&(r.fontStyle&$.Underline||r.fontStyle&$.Strikethrough);!a&&!l&&o===s?i.content+=r.content:n.push({...r})}return n})}const Ka=_a;function Qa(e,t,n){const r={meta:{},options:n,codeToHast:(o,s)=>et(e,o,s),codeToTokens:(o,s)=>Ye(e,o,s)};let i=Ka(et(e,t,n,r));for(const o of Ze(n))i=o.postprocess?.call(r,i,n)||i;return i}async function Ja(e){const t=await zo(e);return{getLastGrammarState:(...n)=>Jo(t,...n),codeToTokensBase:(n,r)=>Ht(t,n,r),codeToTokensWithThemes:(n,r)=>$r(t,n,r),codeToTokens:(n,r)=>Ye(t,n,r),codeToHast:(n,r)=>et(t,n,r),codeToHtml:(n,r)=>Qa(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Za(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function s(d){if(typeof d=="string"){if(d=o.langAlias?.[d]||d,kr(d))return[];const f=t[d];if(!f)throw new R(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}function a(d){if(Tr(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new R(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const l=(o.themes??[]).map(d=>a(d)),u=(o.langs??[]).map(d=>s(d)),p=await Ja({engine:o.engine??r(),...o,themes:l,langs:u});return{...p,loadLanguage(...d){return p.loadLanguage(...d.map(s))},loadTheme(...d){return p.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ya(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return n}function el(e,t){const n=Ya(e);async function r(i,o){const s=await n({langs:[o.lang],themes:"theme"in o?[o.theme]:Object.values(o.themes)}),a=await t?.guessEmbeddedLanguages?.(i,o.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(i){return n(i)},async codeToHtml(i,o){return(await r(i,o)).codeToHtml(i,o)},async codeToHast(i,o){return(await r(i,o)).codeToHast(i,o)},async codeToTokens(i,o){return(await r(i,o)).codeToTokens(i,o)},async codeToTokensBase(i,o){return(await r(i,o)).codeToTokensBase(i,o)},async codeToTokensWithThemes(i,o){return(await r(i,o)).codeToTokensWithThemes(i,o)},async getLastGrammarState(i,o){return(await n({langs:[o.lang],themes:[o.theme]})).getLastGrammarState(i,o)}}}var tl=Jt({bundledLanguages:()=>en,bundledLanguagesAlias:()=>Yt,bundledLanguagesBase:()=>Zt,bundledLanguagesInfo:()=>nt,bundledThemes:()=>nn,bundledThemesInfo:()=>tn,codeToHast:()=>ti,codeToHtml:()=>ei,codeToTokens:()=>ni,codeToTokensBase:()=>ri,codeToTokensWithThemes:()=>ii,createHighlighter:()=>pn,getLastGrammarState:()=>si,getSingletonHighlighter:()=>oi});const pn=Za({langs:en,themes:nn,engine:()=>(0,pr.createOnigurumaEngine)(c(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:ei,codeToHast:ti,codeToTokens:ni,codeToTokensBase:ri,codeToTokensWithThemes:ii,getSingletonHighlighter:oi,getLastGrammarState:si}=el(pn,{guessEmbeddedLanguages:Sa}),Fn=4294967295;var nl=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{const a=i(o);return r?.set(o,a),a}catch(a){if(r?.set(o,a),n)return null;throw a}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=[];function o(s,a,l=0){return{index:s,captureIndices:a.indices.map(u=>u==null?{start:Fn,end:Fn,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let s=0;sa[1].index));for(const[a,l,u]of i)if(l.index===s)return o(a,l,u)}return null}};function Ee(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function rl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const hn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),N=String.raw;function be(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ai=N`\[\^?`,li=`c.? | C(?:-.?)?|${N`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${N`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${N`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${N`o\{[^\}]*\}?`}|${N`\d{1,3}`}`,fn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ge=new RegExp(N` + \\ (?: + ${li} + | [gk]<[^>]*>? + | [gk]'[^']*'? + | . + ) + | \( (?: + \? (?: + [:=!>({] + | <[=!] + | <[^>]*> + | '[^']*' + | ~\|? + | #(?:[^)\\]|\\.?)* + | [^:)]*[:)] + )? + | \*[^\)]*\)? + )? + | (?:${fn.source})+ + | ${ai} + | . +`.replace(/\s+/g,""),"gsu"),At=new RegExp(N` + \\ (?: + ${li} + | . + ) + | \[:(?:\^?\p{Alpha}+|\^):\] + | ${ai} + | && + | . +`.replace(/\s+/g,""),"gsu");function il(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=Cl(n.flags),i=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:n.rules.singleline};let s=[],a;for(Ge.lastIndex=0;a=Ge.exec(e);){const d=ol(o,e,a[0],Ge.lastIndex);d.tokens?s.push(...d.tokens):d.token&&s.push(d.token),d.lastIndex!==void 0&&(Ge.lastIndex=d.lastIndex)}const l=[];let u=0;s.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&l.push(d)}),u||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});const p=u||l.length;return{tokens:s.map(d=>d.type==="EscapedNumber"?Sl(d,p):d).flat(),flags:r}}function ol(e,t,n,r){const[i,o]=n;if(n==="["||n==="[^"){const s=sl(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(o))return{token:jn(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:gl(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ci(n)}}if(o==="K")return{token:di("keep",n)};if(o==="N"||o==="R")return{token:ae("newline",n,{negate:o==="N"})};if(o==="O")return{token:ae("any",n)};if(o==="X")return{token:ae("text_segment",n)};const s=ui(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(i==="("){if(o==="*")return{token:bl(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:El(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:he("group",n)};if(n==="(?>")return{token:he("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:he("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:he("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:hl(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(` +`,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:ae("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":N`\A`,$:N`\Z`}[n]:n;return{token:jn(s,n)}}return n==="|"?{token:ll(n)}:fn.test(n)?{tokens:Ll(n)}:{token:Z(Ee(n),n)}}function sl(e,t,n){const r=[Hn(t[1]==="^",t)];let i=1,o;for(At.lastIndex=n;o=At.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,r.push(Hn(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Z(93,s));else if(i--,r.push(ul(s)),!i)break}else{const a=al(s);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:At.lastIndex||e.length}}function al(e){if(e[0]==="\\")return ui(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?\^?)(?[a-z]+):\]/.exec(e);if(!t||!hn.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return ae("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?cl(e):e==="&&"?dl(e):Z(Ee(e),e)}function ui(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return yl(e);if("dDhHsSwW".includes(n))return wl(e);if(e.startsWith(N`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return vl(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...i].map(s=>{const a=[...o.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return Z(Ee(s),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Z(Al(e),e);if(Wn.has(n))return Z(Wn.get(n),e);if(/\d/.test(n))return pl(t,e);if(e==="\\")throw new Error(N`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Z(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function ll(e){return{type:"Alternator",raw:e}}function jn(e,t){return{type:"Assertion",kind:e,raw:t}}function ci(e){return{type:"Backreference",raw:e}}function Z(e,t){return{type:"Character",value:e,raw:t}}function ul(e){return{type:"CharacterClassClose",raw:e}}function cl(e){return{type:"CharacterClassHyphen",raw:e}}function dl(e){return{type:"CharacterClassIntersector",raw:e}}function Hn(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function ae(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function di(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:be(n.flags),raw:t}}function pl(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function hl(e){return{type:"GroupClose",raw:e}}function he(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function fl(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function ml(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function gl(e){return{type:"Subroutine",raw:e}}const _l=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Wn=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function yl(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Z(Ee(t.toUpperCase())-64,e)}function El(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=qn(n),s=qn(r),a={};if(o&&(a.enable=o),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(i),di("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,he("group",e,{...(o||s)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function bl(e){const t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[s,a,l]=o,u=_l.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return fl(u,r??null,i?.split(",")??null,e)}function zn(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=o===void 0?+i:o===""?1/0:+o,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return ml(t,n,r,e)}function wl(e){const t=e[1].toLowerCase();return ae({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function vl(e){const{p:t,neg:n,value:r}=/^\\(?

[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return ae("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function qn(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function Cl(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Sl(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[ci(n)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(N`Octal encoded byte above 177 unsupported "${n}"`)}else u=Ee(l);o.push(Z(u,(a===0?"\\":"")+l))}return o}function Ll(e){const t=[],n=new RegExp(fn,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const o=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(o){const{min:s,max:a}=o.groups;if(+s>+a&&i.endsWith("?")){n.lastIndex--,t.push(zn(i.slice(0,-1)));continue}}}t.push(zn(i))}return t}function pi(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function Rl(e){return Il.has(e.type)}const Il=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function hi(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=il(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(f,h)=>{const m=r.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,m.type){case"Alternator":return le();case"Assertion":return kl(m);case"Backreference":return Tl(m,o);case"Character":return ct(m.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return Pl(m,o,h);case"CharacterClassOpen":return Ol(m,o,h);case"CharacterSet":return xl(m,o);case"Directive":return Gl(m.kind,{flags:m.flags});case"GroupOpen":return Dl(m,o,h);case"NamedCallout":return Ul(m.kind,m.tag,m.arguments);case"Quantifier":return Nl(m,o);case"Subroutine":return Vl(m,o);default:throw new Error(`Unexpected token type "${m.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},s=jl(Bl(r.flags));let a=s.body[0];for(;o.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(p.has(f)){if(p.get(f).length>1)throw new Error(N`Subroutine uses a duplicate group name "\g<${f}>"`);p.get(f)[0].isSubroutined=!0}else throw new Error(N`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function kl({kind:e}){return Wt(be({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===N`\B`||e===N`\Y`})}function Tl({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(o,s=!1)=>{const a=t.capturingGroups.length;let l=!1;if(o>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,zt(s?a+1-o:o,{orphan:l})};if(n){const o=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return zt(r)}return i(+r)}function Pl(e,t,n){const{tokens:r,walk:i}=t,o=t.parent,s=o.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return o.body.pop(),Ml(s,l);throw new Error("Invalid character class range")}return ct(Ee("-"))}function Ol({negate:e},t,n){const{tokens:r,walk:i}=t,o=[He()],s=r[t.nextIndex];let a=Qn(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(He()),t.nextIndex++;else{const u=o.at(-1);u.body.push(i(u,n))}a=Qn(r[t.nextIndex],s)}const l=He({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function xl({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=r;if(e==="property"){const a=dt(n);if(hn.has(a)&&!s?.has(a))e="posix",n=a;else return fe(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?Fl(n,{negate:t}):qt(e,{negate:t})}function Dl(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:a}=t,l=Hl(e),u=l.type==="AbsenceFunction",p=Kn(l),d=p&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&rl(o,l.name,[]).push(l)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=Jn(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(le()),t.nextIndex++;else{const h=l.body.at(-1),m=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||d});if(h.body.push(m),(p||n.isInLookbehind)&&!s){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Xn(m)||m.type==="CapturingGroup")throw new Error(b)}else if(Xn(m)||Kn(m)&&m.negate)throw new Error(b)}}f=Jn(r[t.nextIndex])}return t.nextIndex++,l}function Nl({kind:e,min:t,max:n},r){const i=r.parent,o=i.body.at(-1);if(!o||!Rl(o))throw new Error("Quantifier requires a repeatable token");const s=mi(e,t,n,o);return i.body.pop(),s}function Vl({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const o=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(o){const a=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=gi(i);return r.push(s),s}function $l(e,t){return{type:"AbsenceFunction",kind:e,body:xe(t?.body)}}function le(e){return{type:"Alternative",body:_i(e?.body)}}function Wt(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function zt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function fi(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Wl(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:xe(t?.body)}}function ct(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function He(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:_i(e?.body)}}function Ml(e,t){if(t.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function jl(e,t){return{type:"Regex",body:xe(t?.body),flags:e}}function gi(e){return{type:"Subroutine",ref:e}}function fe(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(dt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=zl(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(N`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function Hl({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return $l("repeater");case"atomic":return H({atomic:!0});case"capturing":return fi(i,{name:n});case"group":return H({flags:e});case"lookahead":case"lookbehind":return oe({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function xe(e){if(e===void 0)e=[le()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function _i(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Xn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Kn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function Wl(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function zl(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function dt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Qn(e,t){const n=t;return be(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Jn(e){return be(e,"Unclosed group")}function Se(e,t,n=null){function r(o,s){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function Xl(e,t){for(let n=0;n=t&&e[n]++}function Kl(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const j=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function mn(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,a="";for(const l of e.matchAll(i)){const{0:u,groups:{$skip:p}}=l;if(!p&&(!r||r===j.DEFAULT==!s)){n instanceof Function?a+=n(l,{context:s?j.CHAR_CLASS:j.DEFAULT,negated:o[o.length-1]}):a+=n;continue}u[0]==="["?(s++,o.push(u[1]==="^")):u==="]"&&s&&(s--,o.pop()),a+=u}return a}function yi(e,t,n,r){mn(e,t,n,r)}function Ql(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let o=0,s;for(;s=i.exec(e);){const{0:a,groups:{$skip:l}}=s;if(!l&&(!r||r===j.DEFAULT==!o))return s;a==="["?o++:a==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function Ue(e,t,n){return!!Ql(e,t,0,n)}function Jl(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,o=1,s;for(;s=n.exec(e);){const[a]=s;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=s.index;break}}return e.slice(t,r)}const Zn=new RegExp(String.raw`(?${ql})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Zl(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",o="(?:(?=(",s=[0],a=[];let l=0,u=0,p=NaN,d;do{d=!1;let f=0,h=0,m=!1,b;for(Zn.lastIndex=Number.isNaN(p)?0:p+o.length;b=Zn.exec(e);){const{0:E,index:g,groups:{capturingStart:_,noncapturingStart:w}}=b;if(E==="[")f++;else if(f)E==="]"&&f--;else if(E===i&&!m)p=g,m=!0;else if(m&&w)h++;else if(_)m?h++:(l++,s.push(l+u));else if(E===")"&&m){if(!h){u++;const A=l+u;if(e=`${e.slice(0,p)}${o}${e.slice(p+i.length,g)}))<$$${A}>)${e.slice(g+1)}`,d=!0,a.push(A),Xl(n,A),r.size){const S=new Map;r.forEach((x,M)=>{S.set(M>=A?M+1:M,x.map(X=>X>=A?X+1:X))}),r=S}break}h--}}}while(d);return n.push(...a),e=mn(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:m}})=>{if(h){const b=+h;if(b>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[b]}`}return`\\${m}`},j.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Ei=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,St=new RegExp(String.raw` +\\(?: \d+ + | c[A-Za-z] + | [gk]<[^>]+> + | [pPu]\{[^\}]+\} + | u[A-Fa-f\d]{4} + | x[A-Fa-f\d]{2} + ) +| \((?: \? (?: [:=!>] + | <(?:[=!]|[^>]+>) + | [A-Za-z\-]+: + | \(DEFINE\) + ))? +| (?${Ei})(?[?+]?)(?[?*+\{]?) +| \\?. +`.replace(/\s+/g,""),"gsu");function Yl(e){if(!new RegExp(`${Ei}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",o=0,s;for(St.lastIndex=0;s=St.exec(e);){const{0:a,index:l,groups:{qBase:u,qMod:p,invalidQ:d}}=s;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(p==="+"&&i&&!i.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(u))e=Kl(e,l+u.length,p,"");else{if(i===")"||i==="]"){const h=i===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,h)}(?>${e.slice(h,l)}${u})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${u})${e.slice(l+a.length)}`;f+=4}St.lastIndex+=f}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const F=String.raw,eu=F`\\g<(?[^>&]+)&R=(?[^>]+)>`,Xt=F`\(\?R=(?[^\)]+)\)|${eu}`,pt=F`\(\?<(?![=!])(?[^>]+)>`,bi=F`${pt}|(?\()(?!\?)`,re=new RegExp(F`${pt}|${Xt}|\(\?|\\?.`,"gsu"),Lt="Cannot use multiple overlapping recursions";function tu(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Xt,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Ue(e,F`\(\?\(DEFINE\)`,j.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Ue(e,F`\\[1-9]`,j.DEFAULT),a=new Map,l=[];let u=!1,p=0,d=0,f;for(re.lastIndex=0;f=re.exec(e);){const{0:h,groups:{captureName:m,rDepth:b,gRNameOrNum:E,gRDepth:g}}=f;if(h==="[")p++;else if(p)h==="]"&&p--;else if(b){if(Yn(b),u)throw new Error(Lt);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,f.index),w=e.slice(re.lastIndex);if(Ue(w,Xt,j.DEFAULT))throw new Error(Lt);const A=+b-1;e=er(_,w,A,!1,n,o,d),i=nr(i,_,A,o.length,0,d);break}else if(E){Yn(g);let _=!1;for(const Y of l)if(Y.name===E||Y.num===+E){if(_=!0,Y.hasRecursedWithin)throw new Error(Lt);break}if(!_)throw new Error(F`Recursive \g cannot be used outside the referenced group "${r==="external"?E:F`\g<${E}&R=${g}>`}"`);const w=a.get(E),A=Jl(e,w);if(s&&Ue(A,F`${pt}|\((?!\?)`,j.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const S=e.slice(w,f.index),x=A.slice(S.length+h.length),M=o.length,X=+g-1,De=er(S,x,X,!0,n,o,d);i=nr(i,S,X,o.length-M,M,d);const ft=e.slice(0,w),we=e.slice(w+A.length);e=`${ft}${De}${we}`,re.lastIndex+=De.length-h.length-S.length-x.length,l.forEach(Y=>Y.hasRecursedWithin=!0),u=!0}else if(m)d++,a.set(String(d),re.lastIndex),a.set(m,re.lastIndex),l.push({num:d,name:m});else if(h[0]==="("){const _=h==="(";_&&(d++,a.set(String(d),re.lastIndex)),l.push(_?{num:d}:{})}else h===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Yn(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function er(e,t,n,r,i,o,s){const a=new Set;r&&yi(e+t,pt,({groups:{captureName:u}})=>{a.add(u)},j.DEFAULT);const l=[n,r?a:null,i,o,s];return`${e}${tr(`(?:${e}`,"forward",...l)}(?:)${tr(`${t})`,"backward",...l)}${t}`}function tr(e,t,n,r,i,o,s){const l=p=>t==="forward"?p+2:n-p+2-1;let u="";for(let p=0;p[^>]+)>`,({0:f,groups:{captureName:h,unnamed:m,backref:b}})=>{if(b&&r&&!r.has(b))return f;const E=`_$${d}`;if(m||h){const g=s+o.length+1;return o.push(g),nu(i,g),m?f:`(?<${h}${E}>`}return F`\k<${b}${E}>`},j.DEFAULT)}return u}function nu(e,t){for(let n=0;n=t&&e[n]++}function nr(e,t,n,r,i,o){if(e.size&&r){let s=0;yi(t,bi,()=>s++,j.DEFAULT);const a=o-s+i,l=new Map;return e.forEach((u,p)=>{const d=(r-s*n)/n,f=s*n,h=p>a+s?p+r:p,m=[];for(const b of u)if(b<=a)m.push(b);else if(b>a+s+d)m.push(b+r);else if(b<=a+s)for(let E=0;E<=n;E++)m.push(b+s*E);else for(let E=0;E<=n;E++)m.push(b+f+d*E);l.set(h,m)}),l}return e}var P=String.fromCodePoint,v=String.raw,W={},ht=globalThis.RegExp;W.flagGroups=(()=>{try{new ht("(?i:)")}catch{return!1}return!0})();W.unicodeSets=(()=>{try{new ht("[[]]","v")}catch{return!1}return!0})();W.bugFlagVLiteralHyphenIsRange=W.unicodeSets?(()=>{try{new ht(v`[\d\-a]`,"v")}catch{return!0}return!1})():!1;W.bugNestedClassIgnoresNegation=W.unicodeSets&&new ht("[[^a]]","v").test("a");function tt(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Te(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Kt(e,t){return rr[e]>=rr[t]}function ru(e,t){if(e==null)throw new Error(t??"Value expected");return e}var rr={ES2025:2025,ES2024:2024,ES2018:2018},iu={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function wi(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!iu[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=W.flagGroups?"ES2025":W.unicodeSets?"ES2024":"ES2018"),t}var ou="[ -\r ]",su=new Set([P(304),P(305)]),Q=v`[\p{L}\p{M}\p{N}\p{Pc}]`;function vi(e){if(su.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=uu.get(n),o=au.get(n),s=lu.get(n);return[...r].length===1&&t.add(r),s&&t.add(s),i&&t.add(i),t.add(n),o&&t.add(o),[...t]}var gn=new Map(`C Other +Cc Control cntrl +Cf Format +Cn Unassigned +Co Private_Use +Cs Surrogate +L Letter +LC Cased_Letter +Ll Lowercase_Letter +Lm Modifier_Letter +Lo Other_Letter +Lt Titlecase_Letter +Lu Uppercase_Letter +M Mark Combining_Mark +Mc Spacing_Mark +Me Enclosing_Mark +Mn Nonspacing_Mark +N Number +Nd Decimal_Number digit +Nl Letter_Number +No Other_Number +P Punctuation punct +Pc Connector_Punctuation +Pd Dash_Punctuation +Pe Close_Punctuation +Pf Final_Punctuation +Pi Initial_Punctuation +Po Other_Punctuation +Ps Open_Punctuation +S Symbol +Sc Currency_Symbol +Sk Modifier_Symbol +Sm Math_Symbol +So Other_Symbol +Z Separator +Zl Line_Separator +Zp Paragraph_Separator +Zs Space_Separator +ASCII +ASCII_Hex_Digit AHex +Alphabetic Alpha +Any +Assigned +Bidi_Control Bidi_C +Bidi_Mirrored Bidi_M +Case_Ignorable CI +Cased +Changes_When_Casefolded CWCF +Changes_When_Casemapped CWCM +Changes_When_Lowercased CWL +Changes_When_NFKC_Casefolded CWKCF +Changes_When_Titlecased CWT +Changes_When_Uppercased CWU +Dash +Default_Ignorable_Code_Point DI +Deprecated Dep +Diacritic Dia +Emoji +Emoji_Component EComp +Emoji_Modifier EMod +Emoji_Modifier_Base EBase +Emoji_Presentation EPres +Extended_Pictographic ExtPict +Extender Ext +Grapheme_Base Gr_Base +Grapheme_Extend Gr_Ext +Hex_Digit Hex +IDS_Binary_Operator IDSB +IDS_Trinary_Operator IDST +ID_Continue IDC +ID_Start IDS +Ideographic Ideo +Join_Control Join_C +Logical_Order_Exception LOE +Lowercase Lower +Math +Noncharacter_Code_Point NChar +Pattern_Syntax Pat_Syn +Pattern_White_Space Pat_WS +Quotation_Mark QMark +Radical +Regional_Indicator RI +Sentence_Terminal STerm +Soft_Dotted SD +Terminal_Punctuation Term +Unified_Ideograph UIdeo +Uppercase Upper +Variation_Selector VS +White_Space space +XID_Continue XIDC +XID_Start XIDS`.split(/\s/).map(e=>[dt(e),e])),au=new Map([["s",P(383)],[P(383),"s"]]),lu=new Map([[P(223),P(7838)],[P(107),P(8490)],[P(229),P(8491)],[P(969),P(8486)]]),uu=new Map([ee(453),ee(456),ee(459),ee(498),...Rt(8072,8079),...Rt(8088,8095),...Rt(8104,8111),ee(8124),ee(8140),ee(8188)]),cu=new Map([["alnum",v`[\p{Alpha}\p{Nd}]`],["alpha",v`\p{Alpha}`],["ascii",v`\p{ASCII}`],["blank",v`[\p{Zs}\t]`],["cntrl",v`\p{Cc}`],["digit",v`\p{Nd}`],["graph",v`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",v`\p{Lower}`],["print",v`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",v`[\p{P}\p{S}]`],["space",v`\p{space}`],["upper",v`\p{Upper}`],["word",v`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",v`\p{AHex}`]]);function du(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ee(e){const t=P(e);return[t.toLowerCase(),t]}function Rt(e,t){return du(e,t).map(n=>ee(n))}var Ci=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function pu(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Ai(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Kt(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Se(e,hu,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Se(e,fu,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Se(e,mu,s),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var hu={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const o=H();o.body[0].body.push(oe({negate:!0,body:r}),fe("Any"));const s=H();s.body[0].body.push(mi("greedy",0,1/0,o)),n(I(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o\r\n|${i?v`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(te(fe("AHex",{negate:u}),t));else if(l==="newline")n(I(J(u?`[^ +]`:`(?>\r +?|[ +\v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[p];u&&(d=`\0-${P(d.codePointAt(0)-1)}${P(d.codePointAt(2)+1)}-􏿿`),n(I(J(`[${d}]`),t))}else n(I(Tt(J(cu.get(p)),u),t));else if(l==="property")gn.has(dt(p))||(e.key="sc");else if(l==="space")n(te(fe("space",{negate:u}),t));else if(l==="word")n(I(Tt(J(Q),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const u=H({flags:l});u.body[0].body=s(),i(I(u,t),{traverse:!0})}else if(a==="keep"){const u=n.body[0],d=n.body.length===1&&pi(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(v`Uses "\K" in a way that's unsupported`);const f=oe({behind:!0});f.body[0].body=o(),i(I(f,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(I(oe({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=H();t.body[0].body.push(e.body),e.body=I(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=Ii(o.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):i=!0}r&&!i&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(v`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!kt(n)&&(n=It(n,t),e.ref=n)}},fu={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&a.has(e.number)){const d=te(ir(e.number),t);l.set(d,a.get(e.number)),n(d);return}a.set(e.number,e),s.set(e.number,[]),e.name&&Te(s,e.name,[]);const p=s.get(e.name??e.number);for(let d=0;df.type==="Group"&&!!f.flags)),d=p?tt(r.globalFlags,p):r.globalFlags;gu(d,r.currentFlags)||(u=H({flags:Eu(d)}),u.body[0].body.push(l))}n(I(u,t),{traverse:!a})}},mu={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(s=>_u(s,e));if(!o.length)n(I(oe({negate:!0}),t));else if(o.length>1){const s=H({atomic:!0,body:o.reverse().map(a=>le({body:[zt(a.number)]}))});n(I(s,t))}else e.ref=o[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Eu({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Ri(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ii(e){const t=e.find(n=>n.kind==="search_start"||vu(n,{negate:!1})||!bu(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=Ii(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function ki(e,t){const n=Ri(e)??[];for(const r of n)if(r===t||ki(r,t))return!0;return!1}function bu({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function wu(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function vu(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&pi(e.body[0],{type:"Assertion",kind:"search_start"})}function kt(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function J(e,t){const r=hi(e,{...t,unicodePropertyMap:gn}).body;return r.length>1||r[0].body.length>1?H({body:r}):r[0].body[0]}function Tt(e,t){return e.negate=t,e}function te(e,t){return e.parent=t,e}function I(e,t){return Ai(e),e.parent=t,e}function Cu(e,t){const n=wi(t),r=Kt(n.target,"ES2024"),i=Kt(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,a=null;if(!i){const h=[e.flags.ignoreCase];Se(e,Au,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(m){h.push(m)},setHasCasedChar(){h.at(-1)?s=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)};let u=e;const p={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(h){return p.lastNode=u,u=h,ru(Su[h.type],`Unexpected node type "${h.type}"`)(h,p,d)}const f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],p.captureMap.forEach((h,m)=>{h.hidden&&f._hiddenCaptures.push(m),h.transferTo&&Te(f._captureTransfers,h.transferTo,[]).push(m)}),f}var Au={"*":{enter({node:e},t){if(sr(e)){const n=t.getCurrentModI();t.pushModI(e.flags?tt({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){sr(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){_n(P(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Ti(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Ci.has(e.value)&&t.setHasCasedChar()}},Su={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?v`\B`:v`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(s.hidden=!0,o>a.number&&(s.transferTo=a.number)),t.captureMap.set(o,s),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=P(e),r=pe(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&_n(n)){const i=vi(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:o}=e;let{body:s}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");W.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(ar)&&(s=[ct(45),...s.filter(u=>!ar(u))]);const a=()=>`[${i?"^":""}${s.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||W.bugNestedClassIgnoresNegation)&&!i){const p=s.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(p.length){const d=H(),f=d.body[0];return d.parent=o,f.parent=d,s=s.filter(h=>!p.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):d.body.pop(),p.forEach(h=>{const m=le({body:[h]});h.parent=m,m.parent=d,d.body.push(m)}),n(d)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=s[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(W.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=pe(n,i),s=pe(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=Ti(e);Tu(l).forEach(p=>{a.add(Array.isArray(p)?`${pe(p[0],i)}-${pe(p[1],i)}`:pe(p,i))})}return`${o}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":v`[^\n]`;if(e==="digit")return t?v`\D`:v`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Ci.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?v`\P`:v`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?v`\W`:v`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,o){const s=i.currentFlags;n&&(i.currentFlags=tt(s,n));const a=t.map(o).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${Pu(e,n,i.useFlagMods)}${a})`;return i.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+Ou(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:v`\g<${t}&R=${r}>`}},Lu=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Ru=new Set(["-","\\","]","^","["]),Iu=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),or=new Map([[9,v`\t`],[10,v`\n`],[11,v`\v`],[12,v`\f`],[13,v`\r`],[8232,v`\u2028`],[8233,v`\u2029`],[65279,v`\uFEFF`]]),ku=/^\p{Cased}$/u;function _n(e){return ku.test(e)}function Ti(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,o=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return o;for(let s=r;s<=i;s++){const a=P(s);if(!_n(a))continue;const l=vi(a).filter(u=>{const p=u.codePointAt(0);return pi});if(l.length&&(o.push(...l),n))break}return o}function pe(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(or.has(e))return or.get(e);if(e<32||e>126&&e<160||e>262143||t&&xu(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?Iu:Ru:Lu,o=P(e);return(i.has(o)?"\\":"")+o}function Tu(e){const t=e.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),n=[];let r=null;for(let i=0;i";let r="";if(t&&n){const{enable:i,disable:o}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function Ou({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function sr({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function xu(e){return e>47&&e<58}function ar({type:e,value:t}){return e==="Character"&&t===45}var Du=class Qt extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#r=o.source,o instanceof Qt&&(this.#t=o.#t,this.#n=o.#n,this.#i=o.#i,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#r=t,this.#t=Vu(o.hiddenCaptures,o.transfers),this.#i=o.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...o}=this.rawOptions;this.#e=new Qt(this.#r,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#o(t.slice(r));return i&&(Nu(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s{const a=o[s];a&&(o[s]=[a[0]+t,a[1]+t])})}}function Vu(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const o of i)Te(n,o,{}).transferTo=r;return n}function $u(e){const t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:a,name:l}}=o;s==="["?r++:r?s==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function Mu(e,t){const n=Gu(e,t);return n.options?new Du(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Gu(e,t){const n=wi(t),r=hi(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:gn}),i=pu(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Cu(i,n),s=tu(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=Yl(s.pattern),l=Zl(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),u={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=l.hiddenCaptures.sort((m,b)=>m-b),d=Array.from(l.captureTransfers),f=i._strategy,h=u.pattern.length>=n.lazyCompileLength;(p.length||d.length||f||h)&&(u.options={...p.length&&{hiddenCaptures:p},...d.length&&{transfers:d},...f&&{strategy:f},...h&&{lazyCompile:h}})}return u}function Pi(e,t){return Mu(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Bu(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Pi(n,{target:t.target}),{createScanner(n){return new nl(n,t)},createString(n){return{content:n}}}}lr(Jt({bundledLanguages:()=>en,bundledLanguagesAlias:()=>Yt,bundledLanguagesBase:()=>Zt,bundledLanguagesInfo:()=>nt,bundledThemes:()=>nn,bundledThemesInfo:()=>tn,codeToHast:()=>ti,codeToHtml:()=>ei,codeToTokens:()=>ni,codeToTokensBase:()=>ri,codeToTokensWithThemes:()=>ii,createHighlighter:()=>pn,createJavaScriptRegexEngine:()=>Bu,createOnigurumaEngine:()=>dr,defaultJavaScriptRegexConstructor:()=>Pi,getLastGrammarState:()=>si,getSingletonHighlighter:()=>oi,loadWasm:()=>on}),tl);export{R as ShikiError,Jr as addClassToHast,ne as applyColorReplacements,en as bundledLanguages,Yt as bundledLanguagesAlias,Zt as bundledLanguagesBase,nt as bundledLanguagesInfo,nn as bundledThemes,tn as bundledThemesInfo,ti as codeToHast,ei as codeToHtml,ni as codeToTokens,ri as codeToTokensBase,ii as codeToTokensWithThemes,Za as createBundledHighlighter,pn as createHighlighter,Ja as createHighlighterCore,Bu as createJavaScriptRegexEngine,dr as createOnigurumaEngine,Aa as createPositionConverter,Wo as createShikiPrimitive,zo as createShikiPrimitiveAsync,el as createSingletonShorthands,Pi as defaultJavaScriptRegexConstructor,ka as flatTokenVariants,si as getLastGrammarState,oi as getSingletonHighlighter,Je as getTokenStyleObject,Sa as guessEmbeddedLanguages,Ka as hastToHtml,st as isNoneTheme,ot as isPlainLang,kr as isSpecialLang,Tr as isSpecialTheme,on as loadWasm,Ya as makeSingletonHighlighter,Ir as normalizeGetter,an as normalizeTheme,Qe as resolveColorReplacements,at as splitLines,Ra as splitToken,Ia as splitTokens,jt as stringifyTokenStyle,Uo as toArray,Fa as tokenizeAnsiWithTheme,Zo as tokenizeWithTheme,Wa as tokensToHast,Ta as transformerDecorations}; diff --git a/apps/kimi-code/dist-web/assets/index-Cm9Q4xVi.js b/apps/kimi-code/dist-web/assets/index-Cm9Q4xVi.js new file mode 100644 index 0000000000..7e9b87772f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-Cm9Q4xVi.js @@ -0,0 +1,3 @@ +class b{options;tokensStable=[];tokensUnstable=[];lastUnstableCodeChunk="";lastStableGrammarState;constructor(t){this.options=t}async enqueue(t){const a=(this.lastUnstableCodeChunk+t).split(` +`),s=[];let e=[];const n=this.tokensUnstable.length;return a.forEach((o,i)=>{const r=i===a.length-1,l=this.options.highlighter.codeToTokens(o,{...this.options,grammarState:this.lastStableGrammarState}),h=l.tokens[0];r||h.push({content:` +`,offset:0}),r?(e=h,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=l.grammarState,s.push(...h))}),this.tokensStable.push(...s),this.tokensUnstable=e,{recall:n,stable:s,unstable:e}}close(){const t=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:t}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const t=new b(this.options);return t.lastUnstableCodeChunk=this.lastUnstableCodeChunk,t.tokensUnstable=this.tokensUnstable,t.tokensStable=this.tokensStable,t.lastStableGrammarState=this.lastStableGrammarState,t}}class u extends TransformStream{tokenizer;options;constructor(t){const a=new b(t),{allowRecalls:s=!1}=t;super({async transform(e,n){const{stable:o,unstable:i,recall:r}=await a.enqueue(e);s&&r>0&&n.enqueue({recall:r});for(const l of o)n.enqueue(l);if(s)for(const l of i)n.enqueue(l)},async flush(e){const{stable:n}=a.close();if(!s)for(const o of n)e.enqueue(o)}}),this.tokenizer=a,this.options=t}}export{u as CodeToTokenTransformStream,b as ShikiStreamTokenizer}; diff --git a/apps/kimi-code/dist-web/assets/index-DtRfJ0vw.js b/apps/kimi-code/dist-web/assets/index-DtRfJ0vw.js new file mode 100644 index 0000000000..ec899714fd --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-DtRfJ0vw.js @@ -0,0 +1,325 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-BnyYC1m0.js","assets/DesignSystemView-CuTwm3PV.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-BZ3nIcUJ.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js","assets/index8-BSZNwbg_.js","assets/index11-CwW_hjK7.js"])))=>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 Zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},Nc=[],ki=()=>{},f4=()=>!1,zd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qp=e=>e.startsWith("onUpdate:"),kn=Object.assign,ay=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},vE=Object.prototype.hasOwnProperty,ln=(e,t)=>vE.call(e,t),xt=Array.isArray,Ic=e=>ou(e)==="[object Map]",Ra=e=>ou(e)==="[object Set]",Lb=e=>ou(e)==="[object Date]",yE=e=>ou(e)==="[object RegExp]",$t=e=>typeof e=="function",Cn=e=>typeof e=="string",Js=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",cy=e=>(an(e)||$t(e))&&$t(e.then)&&$t(e.catch),h4=Object.prototype.toString,ou=e=>h4.call(e),kE=e=>ou(e).slice(8,-1),Xp=e=>ou(e)==="[object Object]",Jp=e=>Cn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wa=Zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),em=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},bE=/-\w/g,No=em(e=>e.replace(bE,t=>t.slice(1).toUpperCase())),xE=/\B([A-Z])/g,Is=em(e=>e.replace(xE,"-$1").toLowerCase()),tm=em(e=>e.charAt(0).toUpperCase()+e.slice(1)),mh=em(e=>e?`on${tm(e)}`:""),qo=(e,t)=>!Object.is(e,t),Lc=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},nm=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dh=e=>{const t=Cn(e)?Number(e):NaN;return isNaN(t)?e:t};let $b;const om=()=>$b||($b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wE="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",_E=Zp(wE);function Yt(e){if(xt(e)){const t={};for(let n=0;n{if(n){const o=n.split(CE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(Cn(e))t=e;else if(xt(e))for(let n=0;nBr(n,t))}const g4=e=>!!(e&&e.__v_isRef===!0),O=e=>Cn(e)?e:e==null?"":xt(e)||an(e)&&(e.toString===h4||!$t(e.toString))?g4(e)?O(e.value):JSON.stringify(e,v4,2):String(e),v4=(e,t)=>g4(t)?v4(e,t.value):Ic(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Y1(o,i)+" =>"]=s,n),{})}:Ra(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Y1(n))}:Js(t)?Y1(t):an(t)&&!xt(t)&&!Xp(t)?String(t):t,Y1=(e,t="")=>{var n;return Js(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function IE(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 To;class y4{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&&To&&(To.active?(this.parent=To,this.index=(To.scopes||(To.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(To===this)To=this.prevScope;else{let t=To;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(Qu){let t=Qu;for(Qu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Zu;){let t=Zu;for(Zu=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 x4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function w4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),py(o),$E(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Mg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===md)||(e.globalVersion=md,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Mg(e))))return;e.flags|=2;const t=e.dep,n=Dn,o=Oi;Dn=e,Oi=!0;try{x4(e);const s=e.fn(e._value);(t.version===0||qo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Dn=n,Oi=o,w4(e),e.flags&=-3}}function py(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)py(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $E(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Jxe(e,t){e.effect instanceof Ph&&(e=e.effect.fn);const n=new Ph(e);t&&kn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function ewe(e){e.effect.stop()}let Oi=!0;const S4=[];function Dr(){S4.push(Oi),Oi=!1}function Pr(){const e=S4.pop();Oi=e===void 0?!0:e}function Fb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dn;Dn=void 0;try{t()}finally{Dn=n}}}let md=0;class FE{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 im{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(!Dn||!Oi||Dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dn)n=this.activeLink=new FE(Dn,this),Dn.deps?(n.prevDep=Dn.depsTail,Dn.depsTail.nextDep=n,Dn.depsTail=n):Dn.deps=Dn.depsTail=n,C4(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=Dn.depsTail,n.nextDep=void 0,Dn.depsTail.nextDep=n,Dn.depsTail=n,Dn.deps===n&&(Dn.deps=o)}return n}trigger(t){this.version++,md++,this.notify(t)}notify(t){fy();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{hy()}}}function C4(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)C4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hh=new WeakMap,_a=Symbol(""),Eg=Symbol(""),gd=Symbol("");function Jo(e,t,n){if(Oi&&Dn){let o=Hh.get(e);o||Hh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new im),s.map=o,s.key=n),s.track()}}function Tr(e,t,n,o,s,i){const r=Hh.get(e);if(!r){md++;return}const l=a=>{a&&a.trigger()};if(fy(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&Jp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===gd||!Js(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(gd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"delete":a||(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"set":Ic(e)&&l(r.get(_a));break}}hy()}function OE(e,t){const n=Hh.get(e);return n&&n.get(t)}function oc(e){const t=en(e);return t===e?t:(Jo(t,"iterate",gd),Ks(e)?t:t.map(Di))}function rm(e){return Jo(e=en(e),"iterate",gd),e}function er(e,t){return Hr(e)?Gc(_l(e)?Di(t):t):Di(t)}const RE={__proto__:null,[Symbol.iterator](){return Q1(this,Symbol.iterator,e=>er(this,e))},concat(...e){return oc(this).concat(...e.map(t=>xt(t)?oc(t):t))},entries(){return Q1(this,"entries",e=>(e[1]=er(this,e[1]),e))},every(e,t){return gr(this,"every",e,t,void 0,arguments)},filter(e,t){return gr(this,"filter",e,t,n=>n.map(o=>er(this,o)),arguments)},find(e,t){return gr(this,"find",e,t,n=>er(this,n),arguments)},findIndex(e,t){return gr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gr(this,"findLast",e,t,n=>er(this,n),arguments)},findLastIndex(e,t){return gr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gr(this,"forEach",e,t,void 0,arguments)},includes(...e){return X1(this,"includes",e)},indexOf(...e){return X1(this,"indexOf",e)},join(e){return oc(this).join(e)},lastIndexOf(...e){return X1(this,"lastIndexOf",e)},map(e,t){return gr(this,"map",e,t,void 0,arguments)},pop(){return Tu(this,"pop")},push(...e){return Tu(this,"push",e)},reduce(e,...t){return Ob(this,"reduce",e,t)},reduceRight(e,...t){return Ob(this,"reduceRight",e,t)},shift(){return Tu(this,"shift")},some(e,t){return gr(this,"some",e,t,void 0,arguments)},splice(...e){return Tu(this,"splice",e)},toReversed(){return oc(this).toReversed()},toSorted(e){return oc(this).toSorted(e)},toSpliced(...e){return oc(this).toSpliced(...e)},unshift(...e){return Tu(this,"unshift",e)},values(){return Q1(this,"values",e=>er(this,e))}};function Q1(e,t,n){const o=rm(e),s=o[t]();return o!==e&&!Ks(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const BE=Array.prototype;function gr(e,t,n,o,s,i){const r=rm(e),l=r!==e&&!Ks(e),a=r[t];if(a!==BE[t]){const d=a.apply(e,i);return l?Di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,er(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 Ob(e,t,n,o){const s=rm(e),i=s!==e&&!Ks(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=er(e,c)),n.call(this,c,er(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?er(e,a):a}function X1(e,t,n){const o=en(e);Jo(o,"iterate",gd);const s=o[t](...n);return(s===-1||s===!1)&&cm(n[0])?(n[0]=en(n[0]),o[t](...n)):s}function Tu(e,t,n=[]){Dr(),fy();const o=en(e)[t].apply(e,n);return hy(),Pr(),o}const DE=Zp("__proto__,__v_isRef,__isVue"),A4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Js));function PE(e){Js(e)||(e=String(e));const t=en(this);return Jo(t,"has",e),t.hasOwnProperty(e)}class M4{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?$4:L4:i?I4:N4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xt(t);if(!s){let a;if(r&&(a=RE[n]))return a;if(n==="hasOwnProperty")return PE}const l=Reflect.get(t,n,ho(t)?t:o);if((Js(n)?A4.has(n):DE(n))||(s||Jo(t,"get",n),i))return l;if(ho(l)){const a=r&&Jp(n)?l:l.value;return s&&an(a)?Wh(a):a}return an(l)?s?Wh(l):Bo(l):l}}class E4 extends M4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xt(t)&&Jp(n);if(!this._isShallow){const c=Hr(i);if(!Ks(o)&&!Hr(o)&&(i=en(i),o=en(o)),!r&&ho(i)&&!ho(o))return c||(i.value=o),!0}const l=r?Number(n)e,Tf=e=>Reflect.getPrototypeOf(e);function qE(e,t,n){return function(...o){const s=this.__v_raw,i=en(s),r=Ic(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Tg:t?Gc:Di;return!t&&Jo(i,"iterate",a?Eg:_a),kn(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 Nf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jE(e,t){const n={get(s){const i=this.__v_raw,r=en(i),l=en(s);e||(qo(s,l)&&Jo(r,"get",s),Jo(r,"get",l));const{has:a}=Tf(r),c=t?Tg:e?Gc:Di;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&&Jo(en(s),"iterate",_a),s.size},has(s){const i=this.__v_raw,r=en(i),l=en(s);return e||(qo(s,l)&&Jo(r,"has",s),Jo(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=en(l),c=t?Tg:e?Gc:Di;return!e&&Jo(a,"iterate",_a),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return kn(n,e?{add:Nf("add"),set:Nf("set"),delete:Nf("delete"),clear:Nf("clear")}:{add(s){const i=en(this),r=Tf(i),l=en(s),a=!t&&!Ks(s)&&!Hr(s)?l:s;return r.has.call(i,a)||qo(s,a)&&r.has.call(i,s)||qo(l,a)&&r.has.call(i,l)||(i.add(a),Tr(i,"add",a,a)),this},set(s,i){!t&&!Ks(i)&&!Hr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=Tf(r);let c=l.call(r,s);c||(s=en(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?qo(i,u)&&Tr(r,"set",s,i):Tr(r,"add",s,i),this},delete(s){const i=en(this),{has:r,get:l}=Tf(i);let a=r.call(i,s);a||(s=en(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Tr(i,"delete",s,void 0),c},clear(){const s=en(this),i=s.size!==0,r=s.clear();return i&&Tr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=qE(s,e,t)}),n}function lm(e,t){const n=jE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(ln(n,s)&&s in o?n:o,s,i)}const VE={get:lm(!1,!1)},KE={get:lm(!1,!0)},GE={get:lm(!0,!1)},YE={get:lm(!0,!0)},N4=new WeakMap,I4=new WeakMap,L4=new WeakMap,$4=new WeakMap;function ZE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return Hr(e)?e:am(e,!1,HE,VE,N4)}function QE(e){return am(e,!1,zE,KE,I4)}function Wh(e){return am(e,!0,WE,GE,L4)}function twe(e){return am(e,!0,UE,YE,$4)}function am(e,t,n,o,s){if(!an(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=ZE(kE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function _l(e){return Hr(e)?_l(e.__v_raw):!!(e&&e.__v_isReactive)}function Hr(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function cm(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function pt(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&p4(e,"__v_skip",!0),e}const Di=e=>an(e)?Bo(e):e,Gc=e=>an(e)?Wh(e):e;function ho(e){return e?e.__v_isRef===!0:!1}function X(e){return F4(e,!1)}function Ba(e){return F4(e,!0)}function F4(e,t){return ho(e)?e:new XE(e,t)}class XE{constructor(t,n){this.dep=new im,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:Di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ks(t)||Hr(t);t=o?t:en(t),qo(t,n)&&(this._rawValue=t,this._value=o?t:Di(t),this.dep.trigger())}}function nwe(e){e.dep&&e.dep.trigger()}function C(e){return ho(e)?e.value:e}function O4(e){return $t(e)?e():C(e)}const JE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return ho(s)&&!ho(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function R4(e){return _l(e)?e:new Proxy(e,JE)}class eT{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new im,{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 tT(e){return new eT(e)}function owe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=B4(e,n);return t}class nT{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Js(n)?n:String(n),this._raw=en(t);let s=!0,i=t;if(!xt(t)||Js(this._key)||!Jp(this._key))do s=!cm(i)||Ks(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ho(this._raw[this._key])){const n=this._object[this._key];if(ho(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return OE(this._raw,this._key)}}class oT{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 swe(e,t,n){return ho(e)?e:$t(e)?new oT(e):an(e)&&arguments.length>1?B4(e,t,n):X(e)}function B4(e,t,n){return new nT(e,t,n)}class sT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new im(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=md-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Dn!==this)return b4(this,!0),!0}get value(){const t=this.dep.track();return _4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function iT(e,t,n=!1){let o,s;return $t(e)?o=e:(o=e.get,s=e.set),new sT(o,s,n)}const iwe={GET:"get",HAS:"has",ITERATE:"iterate"},rwe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},If={},zh=new WeakMap;let hl;function lwe(){return hl}function rT(e,t=!1,n=hl){if(n){let o=zh.get(n);o||zh.set(n,o=[]),o.push(e)}}function lT(e,t,n=Qt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Ks(k)||s===!1||s===0?Nr(k,1):Nr(k);let u,d,f,h,p=!1,g=!1;if(ho(e)?(d=()=>e.value,p=Ks(e)):_l(e)?(d=()=>c(e),p=!0):xt(e)?(g=!0,p=e.some(k=>_l(k)||Ks(k)),d=()=>e.map(k=>{if(ho(k))return k.value;if(_l(k))return c(k);if($t(k))return a?a(k,2):k()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Dr();try{f()}finally{Pr()}}const k=hl;hl=u;try{return a?a(e,3,[h]):e(h)}finally{hl=k}}:d=ki,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Nr(k(),A)}const b=uy(),v=()=>{u.stop(),b&&b.active&&ay(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(If):If;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,N)=>qo($,m[N])):qo(A,m))){f&&f();const $=hl;hl=u;try{const N=[A,m===If?void 0:g&&m[0]===If?[]:m,h];m=A,a?a(t,3,N):t(...N)}finally{hl=$}}}else u.run()};return l&&l(y),u=new Ph(d),u.scheduler=r?()=>r(y,!1):y,h=k=>rT(k,!1,u),f=u.onStop=()=>{const k=zh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();zh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Nr(e,t=1/0,n){if(t<=0||!an(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ho(e))Nr(e.value,t,n);else if(xt(e))for(let o=0;o{Nr(o,t,n)});else if(Xp(e)){for(const o in e)Nr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Nr(e[o],t,n)}return e}/** +* @vue/runtime-core v3.5.35 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const D4=[];function aT(e){D4.push(e)}function cT(){D4.pop()}function awe(e,t){}const cwe={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"},uT={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 Ud(e,t,n,o){try{return o?e(...o):e()}catch(s){su(s,t,n)}}function wi(e,t,n,o){if($t(e)){const s=Ud(e,t,n,o);return s&&cy(s)&&s.catch(i=>{su(i,t,n)}),s}if(xt(e)){const s=[];for(let i=0;i>>1,s=ps[o],i=vd(s);i=vd(n)?ps.push(e):ps.splice(fT(t),0,e),e.flags|=1,H4()}}function H4(){Uh||(Uh=P4.then(W4))}function qh(e){xt(e)?$c.push(...e):pl&&e.id===-1?pl.splice(pc+1,0,e):e.flags&1||($c.push(e),e.flags|=1),H4()}function Rb(e,t,n=Qi+1){for(;nvd(n)-vd(o));if($c.length=0,pl){pl.push(...t);return}for(pl=t,pc=0;pce.id==null?e.flags&2?-1:1/0:e.id;function W4(e){try{for(Qi=0;Qimc.emit(s,...i)),Lf=[]):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=>{z4(i,t)}),setTimeout(()=>{mc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Lf=[])},3e3)):Lf=[]}let Ko=null,um=null;function yd(e){const t=Ko;return Ko=e,um=e&&e.type.__scopeId||null,t}function uwe(e){um=e}function dwe(){um=null}const fwe=e=>Ee;function Ee(e,t=Ko,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Zh(-1);const i=yd(t);let r;try{r=e(...s)}finally{yd(i),o._d&&Zh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Fn(e,t){if(Ko===null)return e;const n=Kd(Ko),o=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&$t(t)?t.call(o&&o.proxy):t}}function hwe(){return!!(Yo()||Sa)}const hT=Symbol.for("v-scx"),pT=()=>Kt(hT);function mT(e,t){return qd(e,null,t)}function pwe(e,t){return qd(e,null,{flush:"post"})}function gT(e,t){return qd(e,null,{flush:"sync"})}function Qe(e,t,n){return qd(e,t,n)}function qd(e,t,n=Qt){const{immediate:o,deep:s,flush:i,once:r}=n,l=kn({},n),a=t&&o||!t&&i!=="post";let c;if(Ta){if(i==="sync"){const h=pT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ki,h.resume=ki,h.pause=ki,h}}const u=Vo;l.call=(h,p,g)=>wi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{vo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():my(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=lT(e,t,l);return Ta&&(c?c.push(f):a&&f()),f}function vT(e,t,n){const o=this.proxy,s=Cn(e)?e.includes(".")?U4(o,e):()=>o[e]:e.bind(o,o);let i;$t(t)?i=t:(i=t.handler,n=t);const r=iu(this),l=qd(s,i.bind(o),n);return r(),l}function U4(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;se.__isTeleport,fa=e=>e&&(e.disabled||e.disabled===""),yT=e=>e&&(e.defer||e.defer===""),Bb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Db=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ng=(e,t)=>{const n=e&&e.to;return Cn(n)?t?t(n):null:n},kT={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:b,parentNode:v}}=c,m=fa(t.props);let{dynamicChildren:y}=t;const k=(N,x,I)=>{N.shapeFlag&16&&u(N.children,x,I,s,i,r,l,a)},A=(N=t)=>{const x=fa(N.props),I=N.target=Ng(N.props,p),E=Ig(I,N,g,h);I&&(r!=="svg"&&Bb(I)?r="svg":r!=="mathml"&&Db(I)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(I),x||(k(N,I,E),Hu(N,!1)))},$=N=>{const x=()=>{if(ul.get(N)===x){if(ul.delete(N),fa(N.props)){const I=v(N.el)||n;k(N,I,N.anchor),Hu(N,!0)}A(N)}};ul.set(N,x),vo(x,i)};if(e==null){const N=t.el=g(""),x=t.anchor=g("");if(h(N,n,o),h(x,n,o),yT(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,x),Hu(t,!0)),A()}else{t.el=e.el;const N=t.anchor=e.anchor,x=ul.get(e);if(x){x.flags|=8,ul.delete(e),$(t);return}t.targetStart=e.targetStart;const I=t.target=e.target,E=t.targetAnchor=e.targetAnchor,F=fa(e.props),S=F?n:I,L=F?N:E;if(r==="svg"||Bb(I)?r="svg":(r==="mathml"||Db(I))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),Cy(e,t,!0)):a||d(e,t,S,L,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$f(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Ng(t.props,p);R&&$f(t,R,null,c,0)}else F&&$f(t,I,E,c,1);Hu(t,m)}},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,h=i||!fa(f),p=ul.get(e);if(p&&(p.flags|=8,ul.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g{e.isMounted=!0}),po(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],K4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},G4=e=>{const t=e.subTree;return t.component?G4(t.component):t},xT={name:"BaseTransition",props:K4,setup(e,{slots:t}){const n=Yo(),o=V4();return()=>{const s=t.default&&gy(t.default(),!0),i=s&&s.length?Y4(s):n.subTree?ae():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(o.isLeaving)return J1(i);const a=Pb(i);if(!a)return J1(i);let c=kd(a,r,o,n,d=>c=d);a.type!==bo&&Tl(a,c);let u=n.subTree&&Pb(n.subTree);if(u&&u.type!==bo&&!Ii(u,a)&&G4(n).type!==bo){let d=kd(u,r,o,n);if(Tl(u,d),l==="out-in"&&a.type!==bo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},J1(i);l==="in-out"&&a.type!==bo?d.delayLeave=(f,h,p)=>{const g=Z4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function Y4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==bo){t=n;break}}return t}const wT=xT;function Z4(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 kd(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=Z4(n,e),$=(I,E)=>{I&&wi(I,o,9,E)},N=(I,E)=>{const F=E[1];$(I,E),xt(I)?I.every(S=>S.length<=1)&&F():I.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(I){let E=a;if(!n.isMounted)if(i)E=b||a;else return;I[fi]&&I[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(E,[I])},enter(I){if(A[k]===e)return;let E=c,F=u,S=d;if(!n.isMounted)if(i)E=v||c,F=m||u,S=y||d;else return;let L=!1;I[Nu]=D=>{L||(L=!0,D?$(S,[I]):$(F,[I]),x.delayedLeave&&x.delayedLeave(),I[Nu]=void 0)};const R=I[Nu].bind(null,!1);E?N(E,[I,R]):R()},leave(I,E){const F=String(e.key);if(I[Nu]&&I[Nu](!0),n.isUnmounting)return E();$(f,[I]);let S=!1;I[fi]=R=>{S||(S=!0,E(),R?$(g,[I]):$(p,[I]),I[fi]=void 0,A[F]===e&&delete A[F])};const L=I[fi].bind(null,!1);A[F]=e,h?N(h,[I,L]):L()},clone(I){const E=kd(I,t,n,o,s);return s&&s(E),E}};return x}function J1(e){if(jd(e))return e=Wr(e),e.children=null,e}function Pb(e){if(!jd(e))return j4(e.type)&&e.children?Y4(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&&$t(n.default))return n.default()}}function Tl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tl(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 gy(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 Hb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vh=new WeakMap;function Fc(e,t,n,o,s=!1){if(xt(e)){e.forEach((g,b)=>Fc(g,t&&(xt(t)?t[b]:t),n,o,s));return}if(Or(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Fc(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Kd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Qt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Qt?f4:g=>Hb(u,g)?!1:ln(f,g),p=(g,b)=>!(b&&Hb(u,b));if(c!=null&&c!==a){if(Wb(t),Cn(c))u[c]=null,h(c)&&(d[c]=null);else if(ho(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if($t(a))Ud(a,l,12,[r,u]);else{const g=Cn(a),b=ho(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)xt(m)&&ay(m,i);else if(xt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Vh.delete(e)};m.id=-1,Vh.set(e,m),vo(m,n)}else Wb(e),v()}}}function Wb(e){const t=Vh.get(e);t&&(t.flags|=8,Vh.delete(e))}let zb=!1;const sc=()=>{zb||(console.error("Hydration completed but contains mismatches."),zb=!0)},_T=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",ST=e=>e.namespaceURI.includes("MathML"),Ff=e=>{if(e.nodeType===1){if(_T(e))return"svg";if(ST(e))return"mathml"}},wc=e=>e.nodeType===8;function CT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),jh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),jh(),k._vnode=y},d=(y,k,A,$,N,x=!1)=>{x=x||!!k.dynamicChildren;const I=wc(y)&&y.data==="[",E=()=>g(y,k,A,$,N,I),{type:F,ref:S,shapeFlag:L,patchFlag:R}=k;let D=y.nodeType;k.el=y,R===-2&&(x=!1,k.dynamicChildren=null);let z=null;switch(F){case Sl:D!==3?k.children===""?(a(k.el=s(""),r(y),y),z=y):z=E():(y.data!==k.children&&(sc(),y.data=k.children),z=i(y));break;case bo:m(y)?(z=i(y),v(k.el=y.content.firstChild,y,A)):D!==8||I?z=E():z=i(y);break;case Rc:if(I&&(y=i(y),D=y.nodeType),D===1||D===3){z=y;const H=!k.children.length;for(let U=0;U{x=x||!!k.dynamicChildren;const{type:I,props:E,patchFlag:F,shapeFlag:S,dirs:L,transition:R}=k,D=I==="input"||I==="option";if(D||F!==-1){L&&Xi(k,null,A,"created");let z=!1;if(m(y)){z=g3(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const U=y.content.firstChild;if(z){const Z=U.getAttribute("class");Z&&(U.$cls=Z),R.beforeEnter(U)}v(U,y,A),k.el=y=U}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let U=h(y.firstChild,k,y,A,$,N,x);for(U&&!Of(y,1)&&sc();U;){const Z=U;U=U.nextSibling,l(Z)}}else if(S&8){let U=k.children;U[0]===` +`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Z}=y;Z!==U&&Z!==U.replace(/\r\n|\r/g,` +`)&&(Of(y,0)||sc(),y.textContent=k.children)}if(E){if(D||!x||F&48){const U=y.tagName.includes("-");for(const Z in E)(D&&(Z.endsWith("value")||Z==="indeterminate")||zd(Z)&&!wa(Z)||Z[0]==="."||U&&!wa(Z))&&o(y,Z,null,E[Z],void 0,A)}else if(E.onClick)o(y,"onClick",null,E.onClick,void 0,A);else if(F&4&&_l(E.style))for(const U in E.style)E.style[U]}let H;(H=E&&E.onVnodeBeforeMount)&&Es(H,A,k),L&&Xi(k,null,A,"beforeMount"),((H=E&&E.onVnodeMounted)||L||z)&&b3(()=>{H&&Es(H,A,k),z&&R.enter(y),L&&Xi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,N,x,I)=>{I=I||!!k.dynamicChildren;const E=k.children,F=E.length;let S=!1;for(let L=0;L{const{slotScopeIds:I}=k;I&&(N=N?N.concat(I):I);const E=r(y),F=h(i(y),k,E,A,$,N,x);return F&&wc(F)&&F.data==="]"?i(k.anchor=F):(sc(),a(k.anchor=c("]"),E,F),F)},g=(y,k,A,$,N,x)=>{if(Of(y.parentElement,1)||sc(),k.el=null,x){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const I=i(y),E=r(y);return l(y),n(null,k,E,I,A,$,Ff(E),N),A&&(A.vnode.el=k.el,pm(A,k.el)),I},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&wc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let N=A;for(;N;)N.vnode.el===k&&(N.vnode.el=N.subTree.el=y),N=N.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Ub="data-allow-mismatch",AT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Of(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Ub);)e=e.parentElement;const n=e&&e.getAttribute(Ub);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(AT[t])}}const MT=om().requestIdleCallback||(e=>setTimeout(e,1)),ET=om().cancelIdleCallback||(e=>clearTimeout(e)),vwe=(e=1e4)=>t=>{const n=MT(t,{timeout:e});return()=>ET(n)};function TT(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(TT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},kwe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},bwe=(e=[])=>(t,n)=>{Cn(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 NT(e,t){if(wc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(wc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Or=e=>!!e.type.__asyncLoader;function Li(e){$t(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,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>NT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Vo;if(vy(p),u)return()=>Rf(u,p);const g=y=>{c=null,su(y,p,13,!o)};if(l&&p.suspense||Ta)return h().then(y=>()=>Rf(y,p)).catch(y=>(g(y),()=>o?re(o,{error:y}):null));const b=X(!1),v=X(),m=X(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&jd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return Rf(u,p);if(v.value&&o)return re(o,{error:v.value});if(n&&!m.value)return Rf(n,p)}}})}function Rf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=re(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const jd=e=>e.type.__isKeepAlive,IT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Yo(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};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=(m,y,k,A,$)=>{const N=m.component;c(m,y,k,0,l),a(N.vnode,m,y,k,N,l,A,m.slotScopeIds,$),vo(()=>{N.isDeactivated=!1,N.a&&Lc(N.a);const x=m.props&&m.props.onVnodeMounted;x&&Es(x,N.parent,m)},l)},o.deactivate=m=>{const y=m.component;Gh(y.m),Gh(y.a),c(m,f,null,1,l),vo(()=>{y.da&&Lc(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Es(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){e0(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=Hg(Or(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&e0(r),s.delete(m),i.delete(m)}Qe(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Wu(m,k)),y&&p(k=>!Wu(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(Yh(n.subTree.type)?vo(()=>{s.set(b,Bf(n.subTree))},n.subTree.suspense):s.set(b,Bf(n.subTree)))};return cn(v),yy(v),po(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=Bf(y);if(m.type===A.type&&m.key===A.key){e0(A);const $=A.component.da;$&&vo($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!Nl(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Bf(y);if(k.type===bo)return r=null,k;const A=k.type,$=Hg(Or(k)?k.type.__asyncResolved||{}:A),{include:N,exclude:x,max:I}=e;if(N&&(!$||!Wu(N,$))||x&&$&&Wu(x,$))return k.shapeFlag&=-257,r=k,y;const E=k.key==null?A:k.key,F=s.get(E);return k.el&&(k=Wr(k),y.shapeFlag&128&&(y.ssContent=k)),b=E,F?(k.el=F.el,k.component=F.component,k.transition&&Tl(k,k.transition),k.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),I&&i.size>parseInt(I,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,Yh(y.type)?y:k}}},xwe=IT;function Wu(e,t){return xt(e)?e.some(n=>Wu(n,t)):Cn(e)?e.split(",").includes(t):yE(e)?(e.lastIndex=0,e.test(t)):!1}function LT(e,t){Q4(e,"a",t)}function $T(e,t){Q4(e,"da",t)}function Q4(e,t,n=Vo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(fm(t,o,n),n){let s=n.parent;for(;s&&s.parent;)jd(s.parent.vnode)&&FT(o,t,n,s),s=s.parent}}function FT(e,t,n,o){const s=fm(t,e,o,!0);bn(()=>{ay(o[t],s)},n)}function e0(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Bf(e){return e.shapeFlag&128?e.ssContent:e}function fm(e,t,n=Vo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Dr();const l=iu(n),a=wi(t,n,e,r);return l(),Pr(),a});return o?s.unshift(i):s.push(i),i}}const Ur=e=>(t,n=Vo)=>{(!Ta||e==="sp")&&fm(e,(...o)=>t(...o),n)},OT=Ur("bm"),cn=Ur("m"),X4=Ur("bu"),yy=Ur("u"),po=Ur("bum"),bn=Ur("um"),RT=Ur("sp"),BT=Ur("rtg"),DT=Ur("rtc");function PT(e,t=Vo){fm("ec",e,t)}const ky="components",HT="directives";function WT(e,t){return by(ky,e,!0,t)||e}const J4=Symbol.for("v-ndc");function jo(e){return Cn(e)?by(ky,e,!1)||e:e||J4}function wwe(e){return by(HT,e)}function by(e,t,n=!0,o=!1){const s=Ko||Vo;if(s){const i=s.type;if(e===ky){const l=Hg(i,!1);if(l&&(l===t||l===No(t)||l===tm(No(t))))return i}const r=qb(s[e]||i[e],t)||qb(s.appContext[e],t);return!r&&o?i:r}}function qb(e,t){return e&&(e[t]||e[No(t)]||e[tm(No(t))])}function ot(e,t,n,o){let s;const i=n&&n[o],r=xt(e);if(r||Cn(e)){const l=r&&_l(e);let a=!1,c=!1;l&&(a=!Ks(e),c=Hr(e),e=rm(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 On(e,t,n={},o,s){if(Ko.ce||Ko.parent&&Or(Ko.parent)&&Ko.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),xe(Pe,null,[re("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&xy(i(n)),l=n.key||r&&r.key,a=xe(Pe,{key:(l&&!Js(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 xy(e){return e.some(t=>Nl(t)?!(t.type===bo||t.type===Pe&&!xy(t.children)):!0)?e:null}function _we(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:mh(o)]=e[o];return n}const Lg=e=>e?C3(e)?Kd(e):Lg(e.parent):null,Xu=kn(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=>Lg(e.parent),$root:e=>Lg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wy(e),$forceUpdate:e=>e.f||(e.f=()=>{my(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>vT.bind(e)}),t0=(e,t)=>e!==Qt&&!e.__isScriptSetup&&ln(e,t),$g={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(t0(o,t))return r[t]=1,o[t];if(s!==Qt&&ln(s,t))return r[t]=2,s[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Qt&&ln(n,t))return r[t]=4,n[t];Fg&&(r[t]=0)}}const c=Xu[t];let u,d;if(c)return t==="$attrs"&&Jo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Qt&&ln(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,ln(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return t0(s,t)?(s[t]=n,!0):o!==Qt&&ln(o,t)?(o[t]=n,!0):ln(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!==Qt&&l[0]!=="$"&&ln(e,l)||t0(t,l)||ln(i,l)||ln(o,l)||ln(Xu,l)||ln(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ln(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},zT=kn({},$g,{get(e,t){if(t!==Symbol.unscopables)return $g.get(e,t,e)},has(e,t){return t[0]!=="_"&&!_E(t)}});function Swe(){return null}function Cwe(){return null}function Awe(e){}function Mwe(e){}function Ewe(){return null}function Twe(){}function Nwe(e,t){return null}function Iwe(){return t3().slots}function Vd(){return t3().attrs}function t3(e){const t=Yo();return t.setupContext||(t.setupContext=E3(t))}function bd(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Lwe(e,t){const n=bd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?xt(s)||$t(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 $we(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):kn({},bd(e),bd(t))}function Fwe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Owe(e){const t=Yo(),n=Ta;let o=e();wd(),n&&Bc(!1);const s=()=>{iu(t),n&&Bc(!0)},i=()=>{Yo()!==t&&t.scope.off(),wd(),n&&Bc(!1)};return cy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Fg=!0;function UT(e){const t=wy(e),n=e.proxy,o=e.ctx;Fg=!1,t.beforeCreate&&jb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:N,errorCaptured:x,serverPrefetch:I,expose:E,inheritAttrs:F,components:S,directives:L,filters:R}=t;if(c&&qT(c,o,null),r)for(const H in r){const U=r[H];$t(U)&&(o[H]=U.bind(n))}if(s){const H=s.call(n,n);an(H)&&(e.data=Bo(H))}if(Fg=!0,i)for(const H in i){const U=i[H],Z=$t(U)?U.bind(n,n):$t(U.get)?U.get.bind(n,n):ki,K=!$t(U)&&$t(U.set)?U.set.bind(n):ki,V=B({get:Z,set:K});Object.defineProperty(o,H,{enumerable:!0,configurable:!0,get:()=>V.value,set:J=>V.value=J})}if(l)for(const H in l)n3(l[H],o,n,H);if(a){const H=$t(a)?a.call(n):a;Reflect.ownKeys(H).forEach(U=>{Ln(U,H[U])})}u&&jb(u,e,"c");function z(H,U){xt(U)?U.forEach(Z=>H(Z.bind(n))):U&&H(U.bind(n))}if(z(OT,d),z(cn,f),z(X4,h),z(yy,p),z(LT,g),z($T,b),z(PT,x),z(DT,$),z(BT,N),z(po,m),z(bn,k),z(RT,I),xt(E))if(E.length){const H=e.exposed||(e.exposed={});E.forEach(U=>{Object.defineProperty(H,U,{get:()=>n[U],set:Z=>n[U]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===ki&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),L&&(e.directives=L),I&&vy(e)}function qT(e,t,n=ki){xt(e)&&(e=Og(e));for(const o in e){const s=e[o];let i;an(s)?"default"in s?i=Kt(s.from||o,s.default,!0):i=Kt(s.from||o):i=Kt(s),ho(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function jb(e,t,n){wi(xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function n3(e,t,n,o){let s=o.includes(".")?U4(n,o):()=>n[o];if(Cn(e)){const i=t[e];$t(i)&&Qe(s,i)}else if($t(e))Qe(s,e.bind(n));else if(an(e))if(xt(e))e.forEach(i=>n3(i,t,n,o));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Qe(s,i,e)}}function wy(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=>Kh(a,c,r,!0)),Kh(a,t,r)),an(t)&&i.set(t,a),a}function Kh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Kh(e,i,n,!0),s&&s.forEach(r=>Kh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=jT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const jT={data:Vb,props:Kb,emits:Kb,methods:zu,computed:zu,beforeCreate:cs,created:cs,beforeMount:cs,mounted:cs,beforeUpdate:cs,updated:cs,beforeDestroy:cs,beforeUnmount:cs,destroyed:cs,unmounted:cs,activated:cs,deactivated:cs,errorCaptured:cs,serverPrefetch:cs,components:zu,directives:zu,watch:KT,provide:Vb,inject:VT};function Vb(e,t){return t?e?function(){return kn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function VT(e,t){return zu(Og(e),Og(t))}function Og(e){if(xt(e)){const t={};for(let n=0;n{let u,d=Qt,f;return gT(()=>{const h=e[s];qo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!qo(p,u)&&!(d!==Qt&&qo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),qo(h,p)&&qo(h,d)&&!qo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Qt:l,done:!1}:{done:!0}}}},l}const s3=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${No(t)}Modifiers`]||e[`${Is(t)}Modifiers`];function ZT(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Qt;let s=n;const i=t.startsWith("update:"),r=i&&s3(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Cn(u)?u.trim():u)),r.number&&(s=n.map(nm)));let l,a=o[l=mh(t)]||o[l=mh(No(t))];!a&&i&&(a=o[l=mh(Is(t))]),a&&wi(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,wi(c,e,6,s)}}const QT=new WeakMap;function i3(e,t,n=!1){const o=n?QT:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=i3(c,t,!0);u&&(l=!0,kn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(an(e)&&o.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):kn(r,i),an(e)&&o.set(e,r),r)}function hm(e,t){return!e||!zd(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,Is(t))||ln(e,t))}function gh(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:h,ctx:p,inheritAttrs:g}=e,b=yd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ns(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ns(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:JT(l)}}catch(k){Ju.length=0,su(k,e,1),v=re(bo)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Qp)&&(m=e9(m,i)),y=Wr(y,m,!1,!0))}return n.dirs&&(y=Wr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Tl(y,n.transition),v=y,yd(b),v}function XT(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||zd(n))&&((t||(t={}))[n]=e[n]);return t},e9=(e,t)=>{const n={};for(const o in e)(!Qp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function t9(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?Gb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;dObject.create(l3),c3=e=>Object.getPrototypeOf(e)===l3;function n9(e,t,n,o=!1){const s={},i=a3();e.propsDefaults=Object.create(null),u3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:QE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function o9(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=en(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,h]=d3(d,t,!0);kn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return an(e)&&o.set(e,Nc),Nc;if(xt(i))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Sy=e=>xt(e)?e.map(Ns):[Ns(e)],i9=(e,t,n)=>{if(t._n)return t;const o=Ee((...s)=>Sy(t(...s)),n);return o._c=!1,o},f3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(_y(s))continue;const i=e[s];if($t(i))t[s]=i9(s,i,o);else if(i!=null){const r=Sy(i);t[s]=()=>r}}},h3=(e,t)=>{const n=Sy(t);e.slots.default=()=>n},p3=(e,t,n)=>{for(const o in t)(n||!_y(o))&&(e[o]=t[o])},r9=(e,t,n)=>{const o=e.slots=a3();if(e.vnode.shapeFlag&32){const s=t._;s?(p3(o,t,n),n&&p4(o,"_",s,!0)):f3(t,o)}else t&&h3(e,t)},l9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Qt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:p3(s,t,n):(i=!t.$stable,f3(t,s)),r=t}else t&&(h3(e,t),r={default:1});if(i)for(const l in s)!_y(l)&&r[l]==null&&delete s[l]},vo=b3;function a9(e){return m3(e)}function c9(e){return m3(e,CT)}function m3(e,t){const n=om();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:h=ki,insertStaticContent:p}=e,g=(q,ee,ge,de=null,ve=null,j=null,te=void 0,pe=null,Ce=!!ee.dynamicChildren)=>{if(q===ee)return;q&&!Ii(q,ee)&&(de=Se(q),J(q,ve,j,!0),q=null),ee.patchFlag===-2&&(Ce=!1,ee.dynamicChildren=null);const{type:$e,ref:De,shapeFlag:me}=ee;switch($e){case Sl:b(q,ee,ge,de);break;case bo:v(q,ee,ge,de);break;case Rc:q==null&&m(ee,ge,de,te);break;case Pe:S(q,ee,ge,de,ve,j,te,pe,Ce);break;default:me&1?A(q,ee,ge,de,ve,j,te,pe,Ce):me&6?L(q,ee,ge,de,ve,j,te,pe,Ce):(me&64||me&128)&&$e.process(q,ee,ge,de,ve,j,te,pe,Ce,P)}De!=null&&ve?Fc(De,q&&q.ref,j,ee||q,!ee):De==null&&q&&q.ref!=null&&Fc(q.ref,null,j,q,!0)},b=(q,ee,ge,de)=>{if(q==null)o(ee.el=l(ee.children),ge,de);else{const ve=ee.el=q.el;ee.children!==q.children&&c(ve,ee.children)}},v=(q,ee,ge,de)=>{q==null?o(ee.el=a(ee.children||""),ge,de):ee.el=q.el},m=(q,ee,ge,de)=>{[q.el,q.anchor]=p(q.children,ee,ge,de,q.el,q.anchor)},y=({el:q,anchor:ee},ge,de)=>{let ve;for(;q&&q!==ee;)ve=f(q),o(q,ge,de),q=ve;o(ee,ge,de)},k=({el:q,anchor:ee})=>{let ge;for(;q&&q!==ee;)ge=f(q),s(q),q=ge;s(ee)},A=(q,ee,ge,de,ve,j,te,pe,Ce)=>{if(ee.type==="svg"?te="svg":ee.type==="math"&&(te="mathml"),q==null)$(ee,ge,de,ve,j,te,pe,Ce);else{const $e=q.el&&q.el._isVueCE?q.el:null;try{$e&&$e._beginPatch(),I(q,ee,ve,j,te,pe,Ce)}finally{$e&&$e._endPatch()}}},$=(q,ee,ge,de,ve,j,te,pe)=>{let Ce,$e;const{props:De,shapeFlag:me,transition:Ie,dirs:et}=q;if(Ce=q.el=r(q.type,j,De&&De.is,De),me&8?u(Ce,q.children):me&16&&x(q.children,Ce,null,de,ve,n0(q,j),te,pe),et&&Xi(q,null,de,"created"),N(Ce,q,q.scopeId,te,de),De){for(const _t in De)_t!=="value"&&!wa(_t)&&i(Ce,_t,null,De[_t],j,de);"value"in De&&i(Ce,"value",null,De.value,j),($e=De.onVnodeBeforeMount)&&Es($e,de,q)}et&&Xi(q,null,de,"beforeMount");const rt=g3(ve,Ie);rt&&Ie.beforeEnter(Ce),o(Ce,ee,ge),(($e=De&&De.onVnodeMounted)||rt||et)&&vo(()=>{try{$e&&Es($e,de,q),rt&&Ie.enter(Ce),et&&Xi(q,null,de,"mounted")}finally{}},ve)},N=(q,ee,ge,de,ve)=>{if(ge&&h(q,ge),de)for(let j=0;j{for(let $e=Ce;$e{const pe=ee.el=q.el;let{patchFlag:Ce,dynamicChildren:$e,dirs:De}=ee;Ce|=q.patchFlag&16;const me=q.props||Qt,Ie=ee.props||Qt;let et;if(ge&&na(ge,!1),(et=Ie.onVnodeBeforeUpdate)&&Es(et,ge,ee,q),De&&Xi(ee,q,ge,"beforeUpdate"),ge&&na(ge,!0),(me.innerHTML&&Ie.innerHTML==null||me.textContent&&Ie.textContent==null)&&u(pe,""),$e?E(q.dynamicChildren,$e,pe,ge,de,n0(ee,ve),j):te||U(q,ee,pe,null,ge,de,n0(ee,ve),j,!1),Ce>0){if(Ce&16)F(pe,me,Ie,ge,ve);else if(Ce&2&&me.class!==Ie.class&&i(pe,"class",null,Ie.class,ve),Ce&4&&i(pe,"style",me.style,Ie.style,ve),Ce&8){const rt=ee.dynamicProps;for(let _t=0;_t{et&&Es(et,ge,ee,q),De&&Xi(ee,q,ge,"updated")},de)},E=(q,ee,ge,de,ve,j,te)=>{for(let pe=0;pe{if(ee!==ge){if(ee!==Qt)for(const j in ee)!wa(j)&&!(j in ge)&&i(q,j,ee[j],null,ve,de);for(const j in ge){if(wa(j))continue;const te=ge[j],pe=ee[j];te!==pe&&j!=="value"&&i(q,j,pe,te,ve,de)}"value"in ge&&i(q,"value",ee.value,ge.value,ve)}},S=(q,ee,ge,de,ve,j,te,pe,Ce)=>{const $e=ee.el=q?q.el:l(""),De=ee.anchor=q?q.anchor:l("");let{patchFlag:me,dynamicChildren:Ie,slotScopeIds:et}=ee;et&&(pe=pe?pe.concat(et):et),q==null?(o($e,ge,de),o(De,ge,de),x(ee.children||[],ge,De,ve,j,te,pe,Ce)):me>0&&me&64&&Ie&&q.dynamicChildren&&q.dynamicChildren.length===Ie.length?(E(q.dynamicChildren,Ie,ge,ve,j,te,pe),(ee.key!=null||ve&&ee===ve.subTree)&&Cy(q,ee,!0)):U(q,ee,ge,De,ve,j,te,pe,Ce)},L=(q,ee,ge,de,ve,j,te,pe,Ce)=>{ee.slotScopeIds=pe,q==null?ee.shapeFlag&512?ve.ctx.activate(ee,ge,de,te,Ce):R(ee,ge,de,ve,j,te,Ce):D(q,ee,Ce)},R=(q,ee,ge,de,ve,j,te)=>{const pe=q.component=S3(q,de,ve);if(jd(q)&&(pe.ctx.renderer=P),A3(pe,!1,te),pe.asyncDep){if(ve&&ve.registerDep(pe,z,te),!q.el){const Ce=pe.subTree=re(bo);v(null,Ce,ee,ge),q.placeholder=Ce.el}}else z(pe,q,ee,ge,ve,j,te)},D=(q,ee,ge)=>{const de=ee.component=q.component;if(t9(q,ee,ge))if(de.asyncDep&&!de.asyncResolved){H(de,ee,ge);return}else de.next=ee,de.update();else ee.el=q.el,de.vnode=ee},z=(q,ee,ge,de,ve,j,te)=>{const pe=()=>{if(q.isMounted){let{next:me,bu:Ie,u:et,parent:rt,vnode:_t}=q;{const un=v3(q);if(un){me&&(me.el=_t.el,H(q,me,te)),un.asyncDep.then(()=>{vo(()=>{q.isUnmounted||$e()},ve)});return}}let gt=me,It;na(q,!1),me?(me.el=_t.el,H(q,me,te)):me=_t,Ie&&Lc(Ie),(It=me.props&&me.props.onVnodeBeforeUpdate)&&Es(It,rt,me,_t),na(q,!0);const Ut=gh(q),ht=q.subTree;q.subTree=Ut,g(ht,Ut,d(ht.el),Se(ht),q,ve,j),me.el=Ut.el,gt===null&&pm(q,Ut.el),et&&vo(et,ve),(It=me.props&&me.props.onVnodeUpdated)&&vo(()=>Es(It,rt,me,_t),ve)}else{let me;const{el:Ie,props:et}=ee,{bm:rt,m:_t,parent:gt,root:It,type:Ut}=q,ht=Or(ee);if(na(q,!1),rt&&Lc(rt),!ht&&(me=et&&et.onVnodeBeforeMount)&&Es(me,gt,ee),na(q,!0),Ie&&ne){const un=()=>{q.subTree=gh(q),ne(Ie,q.subTree,q,ve,null)};ht&&Ut.__asyncHydrate?Ut.__asyncHydrate(Ie,q,un):un()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Ut,q.parent?q.parent.type:void 0);const un=q.subTree=gh(q);g(null,un,ge,de,q,ve,j),ee.el=un.el}if(_t&&vo(_t,ve),!ht&&(me=et&&et.onVnodeMounted)){const un=ee;vo(()=>Es(me,gt,un),ve)}(ee.shapeFlag&256||gt&&Or(gt.vnode)&>.vnode.shapeFlag&256)&&q.a&&vo(q.a,ve),q.isMounted=!0,ee=ge=de=null}};q.scope.on();const Ce=q.effect=new Ph(pe);q.scope.off();const $e=q.update=Ce.run.bind(Ce),De=q.job=Ce.runIfDirty.bind(Ce);De.i=q,De.id=q.uid,Ce.scheduler=()=>my(De),na(q,!0),$e()},H=(q,ee,ge)=>{ee.component=q;const de=q.vnode.props;q.vnode=ee,q.next=null,o9(q,ee.props,de,ge),l9(q,ee.children,ge),Dr(),Rb(q),Pr()},U=(q,ee,ge,de,ve,j,te,pe,Ce=!1)=>{const $e=q&&q.children,De=q?q.shapeFlag:0,me=ee.children,{patchFlag:Ie,shapeFlag:et}=ee;if(Ie>0){if(Ie&128){K($e,me,ge,de,ve,j,te,pe,Ce);return}else if(Ie&256){Z($e,me,ge,de,ve,j,te,pe,Ce);return}}et&8?(De&16&&ue($e,ve,j),me!==$e&&u(ge,me)):De&16?et&16?K($e,me,ge,de,ve,j,te,pe,Ce):ue($e,ve,j,!0):(De&8&&u(ge,""),et&16&&x(me,ge,de,ve,j,te,pe,Ce))},Z=(q,ee,ge,de,ve,j,te,pe,Ce)=>{q=q||Nc,ee=ee||Nc;const $e=q.length,De=ee.length,me=Math.min($e,De);let Ie;for(Ie=0;IeDe?ue(q,ve,j,!0,!1,me):x(ee,ge,de,ve,j,te,pe,Ce,me)},K=(q,ee,ge,de,ve,j,te,pe,Ce)=>{let $e=0;const De=ee.length;let me=q.length-1,Ie=De-1;for(;$e<=me&&$e<=Ie;){const et=q[$e],rt=ee[$e]=Ce?Mr(ee[$e]):Ns(ee[$e]);if(Ii(et,rt))g(et,rt,ge,null,ve,j,te,pe,Ce);else break;$e++}for(;$e<=me&&$e<=Ie;){const et=q[me],rt=ee[Ie]=Ce?Mr(ee[Ie]):Ns(ee[Ie]);if(Ii(et,rt))g(et,rt,ge,null,ve,j,te,pe,Ce);else break;me--,Ie--}if($e>me){if($e<=Ie){const et=Ie+1,rt=etIe)for(;$e<=me;)J(q[$e],ve,j,!0),$e++;else{const et=$e,rt=$e,_t=new Map;for($e=rt;$e<=Ie;$e++){const Wt=ee[$e]=Ce?Mr(ee[$e]):Ns(ee[$e]);Wt.key!=null&&_t.set(Wt.key,$e)}let gt,It=0;const Ut=Ie-rt+1;let ht=!1,un=0;const dn=new Array(Ut);for($e=0;$e=Ut){J(Wt,ve,j,!0);continue}let Hn;if(Wt.key!=null)Hn=_t.get(Wt.key);else for(gt=rt;gt<=Ie;gt++)if(dn[gt-rt]===0&&Ii(Wt,ee[gt])){Hn=gt;break}Hn===void 0?J(Wt,ve,j,!0):(dn[Hn-rt]=$e+1,Hn>=un?un=Hn:ht=!0,g(Wt,ee[Hn],ge,null,ve,j,te,pe,Ce),It++)}const ns=ht?u9(dn):Nc;for(gt=ns.length-1,$e=Ut-1;$e>=0;$e--){const Wt=rt+$e,Hn=ee[Wt],lo=ee[Wt+1],it=Wt+1{const{el:j,type:te,transition:pe,children:Ce,shapeFlag:$e}=q;if($e&6){V(q.component.subTree,ee,ge,de);return}if($e&128){q.suspense.move(ee,ge,de);return}if($e&64){te.move(q,ee,ge,P);return}if(te===Pe){o(j,ee,ge);for(let me=0;mepe.enter(j),ve));else{const{leave:me,delayLeave:Ie,afterLeave:et}=pe,rt=()=>{q.ctx.isUnmounted?s(j):o(j,ee,ge)},_t=()=>{const gt=j._isLeaving||!!j[fi];j._isLeaving&&j[fi](!0),pe.persisted&&!gt?rt():me(j,()=>{rt(),et&&et()})};Ie?Ie(j,rt,_t):_t()}else o(j,ee,ge)},J=(q,ee,ge,de=!1,ve=!1)=>{const{type:j,props:te,ref:pe,children:Ce,dynamicChildren:$e,shapeFlag:De,patchFlag:me,dirs:Ie,cacheIndex:et,memo:rt}=q;if(me===-2&&(ve=!1),pe!=null&&(Dr(),Fc(pe,null,ge,q,!0),Pr()),et!=null&&(ee.renderCache[et]=void 0),De&256){ee.ctx.deactivate(q);return}const _t=De&1&&Ie,gt=!Or(q);let It;if(gt&&(It=te&&te.onVnodeBeforeUnmount)&&Es(It,ee,q),De&6)ce(q.component,ge,de);else{if(De&128){q.suspense.unmount(ge,de);return}_t&&Xi(q,null,ee,"beforeUnmount"),De&64?q.type.remove(q,ee,ge,P,de):$e&&!$e.hasOnce&&(j!==Pe||me>0&&me&64)?ue($e,ee,ge,!1,!0):(j===Pe&&me&384||!ve&&De&16)&&ue(Ce,ee,ge),de&&fe(q)}const Ut=rt!=null&&et==null;(gt&&(It=te&&te.onVnodeUnmounted)||_t||Ut)&&vo(()=>{It&&Es(It,ee,q),_t&&Xi(q,null,ee,"unmounted"),Ut&&(q.el=null)},ge)},fe=q=>{const{type:ee,el:ge,anchor:de,transition:ve}=q;if(ee===Pe){oe(ge,de);return}if(ee===Rc){k(q);return}const j=()=>{s(ge),ve&&!ve.persisted&&ve.afterLeave&&ve.afterLeave()};if(q.shapeFlag&1&&ve&&!ve.persisted){const{leave:te,delayLeave:pe}=ve,Ce=()=>te(ge,j);pe?pe(q.el,j,Ce):Ce()}else j()},oe=(q,ee)=>{let ge;for(;q!==ee;)ge=f(q),s(q),q=ge;s(ee)},ce=(q,ee,ge)=>{const{bum:de,scope:ve,job:j,subTree:te,um:pe,m:Ce,a:$e}=q;Gh(Ce),Gh($e),de&&Lc(de),ve.stop(),j&&(j.flags|=8,J(te,q,ee,ge)),pe&&vo(pe,ee),vo(()=>{q.isUnmounted=!0},ee)},ue=(q,ee,ge,de=!1,ve=!1,j=0)=>{for(let te=j;te{if(q.shapeFlag&6)return Se(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ee=f(q.anchor||q.el),ge=ee&&ee[q4];return ge?f(ge):ee};let Te=!1;const Ae=(q,ee,ge)=>{let de;q==null?ee._vnode&&(J(ee._vnode,null,null,!0),de=ee._vnode.component):g(ee._vnode||null,q,ee,null,null,null,ge),ee._vnode=q,Te||(Te=!0,Rb(de),jh(),Te=!1)},P={p:g,um:J,m:V,r:fe,mt:R,mc:x,pc:U,pbc:E,n:Se,o:e};let le,ne;return t&&([le,ne]=t(P)),{render:Ae,hydrate:le,createApp:YT(Ae,le)}}function n0({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 na({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function g3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Cy(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 v3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:v3(t)}function Gh(e){if(e)for(let t=0;te.__isSuspense;let Bg=0;const d9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)f9(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}h9(e,t,n,o,s,r,l,a,c)}},hydrate:p9,normalize:m9},Bwe=d9;function xd(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function f9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=k3(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?(xd(e,"onPending"),xd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Oc(f,e.ssFallback)):f.resolve(!1,!0)}function h9(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,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Oc(d,h)))):(d.pendingId=Bg++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),Oc(d,h))):p&&Ii(p,f)?(a(p,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(p&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Oc(d,f);else if(xd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Bg++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function k3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=g9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Dh(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Bg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,N=!1){const{vnode:x,activeBranch:I,pendingBranch:E,pendingId:F,effects:S,parentComponent:L,container:R,isInFallback:D}=A;let z=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){z=I&&E.transition&&E.transition.mode==="out-in";let Z=!1;z&&(I.transition.afterLeave=()=>{F===A.pendingId&&(f(E,R,i===k&&!Z?p(I):i,0),qh(S),D&&x.ssFallback&&(x.ssFallback.el=null))}),I&&!A.isFallbackMountPending&&(g(I.el)===R&&(i=p(I),Z=!0),h(I,L,A,!0),!z&&D&&x.ssFallback&&vo(()=>x.ssFallback.el=null,A)),z||f(E,R,i,0)}A.isFallbackMountPending=!1,Oc(A,E),A.pendingBranch=null,A.isInFallback=!1;let H=A.parent,U=!1;for(;H;){if(H.pendingBranch){H.effects.push(...S),U=!0;break}H=H.parent}!U&&!z&&qh(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),xd(x,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:N,activeBranch:x,parentComponent:I,container:E,namespace:F}=A;xd(N,"onFallback");const S=p(x),L=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,E,S,I,null,F,l,a),Oc(A,$))},R=$.transition&&$.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,x.transition.afterLeave=L),A.isInFallback=!0,h(x,I,null,!0),R||L()},move($,N,x){A.activeBranch&&f(A.activeBranch,$,N,x),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,N,x){const I=!!A.pendingBranch;I&&A.deps++;const E=$.vnode.el;$.asyncDep.catch(F=>{su(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;wd(),$.asyncResolved=!0;const{vnode:S}=$;Dg($,F,!1),E&&(S.el=E);const L=!E&&$.subTree.el;N($,S,g(E||$.subTree.el),E?null:p($.subTree),A,r,x),L&&(S.placeholder=null,b(L)),pm($,S.el),I&&--A.deps===0&&A.resolve()})},unmount($,N){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,N),A.pendingBranch&&h(A.pendingBranch,n,$,N)}};return A}function p9(e,t,n,o,s,i,r,l,a){const c=t.suspense=k3(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 m9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Zb(o?n.default:n),e.ssFallback=o?Zb(n.fallback):re(bo)}function Zb(e){let t;if($t(e)){const n=Ea&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=es,x3())}return xt(e)&&(e=XT(e)),e=Ns(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function b3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):qh(e)}function Oc(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,pm(o,s))}function g9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),bo=Symbol.for("v-cmt"),Rc=Symbol.for("v-stc"),Ju=[];let es=null;function w(e=!1){Ju.push(es=e?null:[])}function x3(){Ju.pop(),es=Ju[Ju.length-1]||null}let Ea=1;function Zh(e,t=!1){Ea+=e,e<0&&es&&t&&(es.hasOnce=!0)}function w3(e){return e.dynamicChildren=Ea>0?es||Nc:null,x3(),Ea>0&&es&&es.push(e),e}function T(e,t,n,o,s,i){return w3(_(e,t,n,o,s,i,!0))}function xe(e,t,n,o,s){return w3(re(e,t,n,o,s,!0))}function Nl(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Dwe(e){}const _3=({key:e})=>e??null,vh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Cn(e)||ho(e)||$t(e)?{i:Ko,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_3(t),ref:t&&vh(t),scopeId:um,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:Ko};return l?(My(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Cn(n)?8:16),Ea>0&&!r&&es&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&es.push(a),a}const re=v9;function v9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===J4)&&(e=bo),Nl(e)){const l=Wr(e,t,!0);return n&&My(l,n),Ea>0&&!i&&es&&(l.shapeFlag&6?es[es.indexOf(e)]=l:es.push(l)),l.patchFlag=-2,l}if(_9(e)&&(e=e.__vccOpts),t){t=y9(t);let{class:l,style:a}=t;l&&!Cn(l)&&(t.class=We(l)),an(a)&&(cm(a)&&!xt(a)&&(a=kn({},a)),t.style=Yt(a))}const r=Cn(e)?1:Yh(e)?128:j4(e)?64:an(e)?4:$t(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function y9(e){return e?cm(e)||c3(e)?kn({},e):e:null}function Wr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?yn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&_3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(vh(t)):[i,vh(t)]:vh(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!==Pe?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&&Wr(e.ssContent),ssFallback:e.ssFallback&&Wr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Tl(u,a.clone(u)),u}function Je(e=" ",t=0){return re(Sl,null,e,t)}function Ay(e,t){const n=re(Rc,null,e);return n.staticCount=t,n}function ae(e="",t=!1){return t?(w(),xe(bo,null,e)):re(bo,null,e)}function Ns(e){return e==null||typeof e=="boolean"?re(bo):xt(e)?re(Pe,null,e.slice()):Nl(e)?Mr(e):re(Sl,null,String(e))}function Mr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wr(e)}function My(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),My(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!c3(t)?t._ctx=Ko:s===3&&Ko&&(Ko.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ko},n=32):(t=String(t),o&64?(n=16,t=[Je(t)]):n=8);e.children=t,e.shapeFlag|=n}function yn(...e){const t={};for(let n=0;nVo||Ko;let Qh,Bc;{const e=om(),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)}};Qh=t("__VUE_INSTANCE_SETTERS__",n=>Vo=n),Bc=t("__VUE_SSR_SETTERS__",n=>Ta=n)}const iu=e=>{const t=Vo;return Qh(e),e.scope.on(),()=>{e.scope.off(),Qh(t)}},wd=()=>{Vo&&Vo.scope.off(),Qh(null)};function C3(e){return e.vnode.shapeFlag&4}let Ta=!1;function A3(e,t=!1,n=!1){t&&Bc(t);const{props:o,children:s}=e.vnode,i=C3(e);n9(e,o,i,t),r9(e,s,n||t);const r=i?x9(e,t):void 0;return t&&Bc(!1),r}function x9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$g);const{setup:o}=n;if(o){Dr();const s=e.setupContext=o.length>1?E3(e):null,i=iu(e),r=Ud(o,e,0,[e.props,s]),l=cy(r);if(Pr(),i(),(l||e.sp)&&!Or(e)&&vy(e),l){if(r.then(wd,wd),t)return r.then(a=>{Dg(e,a,t)}).catch(a=>{su(a,e,0)});e.asyncDep=r}else Dg(e,r,t)}else M3(e,t)}function Dg(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=R4(t)),M3(e,n)}let Xh,Pg;function Pwe(e){Xh=e,Pg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,zT))}}const Hwe=()=>!Xh;function M3(e,t,n){const o=e.type;if(!e.render){if(!t&&Xh&&!o.render){const s=o.template||wy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=kn(kn({isCustomElement:i,delimiters:l},r),a);o.render=Xh(s,c)}}e.render=o.render||ki,Pg&&Pg(e)}{const s=iu(e);Dr();try{UT(e)}finally{Pr(),s()}}}const w9={get(e,t){return Jo(e,"get",""),e[t]}};function E3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,w9),slots:e.slots,emit:e.emit,expose:t}}function Kd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(R4(pt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Xu)return Xu[n](e)},has(t,n){return n in t||n in Xu}})):e.proxy}function Hg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function _9(e){return $t(e)&&"__vccOpts"in e}const B=(e,t)=>iT(e,t,Ta);function mn(e,t,n){try{Zh(-1);const o=arguments.length;return o===2?an(t)&&!xt(t)?Nl(t)?re(e,null,[t]):re(e,t):re(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Nl(n)&&(n=[n]),re(e,t,n))}finally{Zh(1)}}function Wwe(){}function zwe(e,t,n,o){const s=n[o];if(s&&S9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function S9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o0&&es&&es.push(e),!0}const C9="3.5.35",Uwe=ki,qwe=uT,jwe=mc,Vwe=z4,A9={createComponentInstance:S3,setupComponent:A3,renderComponentRoot:gh,setCurrentRenderingInstance:yd,isVNode:Nl,normalizeVNode:Ns,getComponentPublicInstance:Kd,ensureValidVNode:xy,pushWarningContext:aT,popWarningContext:cT},Kwe=A9,Gwe=null,Ywe=null,Zwe=null;/** +* @vue/runtime-dom v3.5.35 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Wg;const Qb=typeof window<"u"&&window.trustedTypes;if(Qb)try{Wg=Qb.createPolicy("vue",{createHTML:e=>e})}catch{}const T3=Wg?e=>Wg.createHTML(e):e=>e,M9="http://www.w3.org/2000/svg",E9="http://www.w3.org/1998/Math/MathML",wr=typeof document<"u"?document:null,Xb=wr&&wr.createElement("template"),T9={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"?wr.createElementNS(M9,e):t==="mathml"?wr.createElementNS(E9,e):n?wr.createElement(e,{is:n}):wr.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>wr.createTextNode(e),createComment:e=>wr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wr.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{Xb.innerHTML=T3(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const l=Xb.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]}},tl="transition",Iu="animation",Yc=Symbol("_vtc"),N3={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},I3=kn({},K4,N3),N9=e=>(e.displayName="Transition",e.props=I3,e),Il=N9((e,{slots:t})=>mn(wT,L3(e),t)),oa=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Jb=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function L3(e){const t={};for(const S in e)S in N3||(t[S]=e[S]);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:h=`${n}-leave-to`}=e,p=I9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:N=m,onAppearCancelled:x=y}=t,I=(S,L,R,D)=>{S._enterCancelled=D,dl(S,L?u:l),dl(S,L?c:r),R&&R()},E=(S,L)=>{S._isLeaving=!1,dl(S,d),dl(S,h),dl(S,f),L&&L()},F=S=>(L,R)=>{const D=S?N:m,z=()=>I(L,S,R);oa(D,[L,z]),ex(()=>{dl(L,S?a:i),Zi(L,S?u:l),Jb(D)||tx(L,o,g,z)})};return kn(t,{onBeforeEnter(S){oa(v,[S]),Zi(S,i),Zi(S,r)},onBeforeAppear(S){oa($,[S]),Zi(S,a),Zi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,L){S._isLeaving=!0;const R=()=>E(S,L);Zi(S,d),S._enterCancelled?(Zi(S,f),zg(S)):(zg(S),Zi(S,f)),ex(()=>{S._isLeaving&&(dl(S,d),Zi(S,h),Jb(k)||tx(S,o,b,R))}),oa(k,[S,R])},onEnterCancelled(S){I(S,!1,void 0,!0),oa(y,[S])},onAppearCancelled(S){I(S,!0,void 0,!0),oa(x,[S])},onLeaveCancelled(S){E(S),oa(A,[S])}})}function I9(e){if(e==null)return null;if(an(e))return[o0(e.enter),o0(e.leave)];{const t=o0(e);return[t,t]}}function o0(e){return Dh(e)}function Zi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yc]||(e[Yc]=new Set)).add(t)}function dl(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 ex(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let L9=0;function tx(e,t,n,o){const s=e._endId=++L9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=$3(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[p]||"").split(", "),s=o(`${tl}Delay`),i=o(`${tl}Duration`),r=nx(s,i),l=o(`${Iu}Delay`),a=o(`${Iu}Duration`),c=nx(l,a);let u=null,d=0,f=0;t===tl?r>0&&(u=tl,d=r,f=i.length):t===Iu?c>0&&(u=Iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?tl:Iu:null,f=u?u===tl?i.length:a.length:0);const h=u===tl&&/\b(?:transform|all)(?:,|$)/.test(o(`${tl}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function nx(e,t){for(;e.lengthox(n)+ox(e[o])))}function ox(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function zg(e){return(e?e.ownerDocument:document).body.offsetHeight}function $9(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 Jh=Symbol("_vod"),F3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Lu(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),Lu(e,!0),o.enter(e)):o.leave(e,()=>{Lu(e,!1)}):Lu(e,t))},beforeUnmount(e,{value:t}){Lu(e,t)}};function Lu(e,t){e.style.display=t?e[Jh]:"none",e[F3]=!t}function F9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const O3=Symbol("");function Qwe(e){const t=Yo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ep(i,s))},o=()=>{const s=e(t.proxy);t.ce?ep(t.ce,s):Ug(t.subTree,s),n(s)};X4(()=>{qh(o)}),cn(()=>{Qe(o,ki,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),bn(()=>s.disconnect())})}function Ug(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Ug(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ep(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Ug(n,t));else if(e.type===Rc){let{el:n,anchor:o}=e;for(;n&&(ep(n,t),n!==o);)n=n.nextSibling}}function ep(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=IE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[O3]=o}}const O9=/(?:^|;)\s*display\s*:/;function R9(e,t,n){const o=e.style,s=Cn(n);let i=!1;if(n&&!s){if(t)if(Cn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Uu(o,l,"")}else for(const r in t)n[r]==null&&Uu(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?D9(e,r,!Cn(t)&&t?t[r]:void 0,l)||Uu(o,r,l):Uu(o,r,"")}}else if(s){if(t!==n){const r=o[O3];r&&(n+=";"+r),o.cssText=n,i=O9.test(n)}}else t&&e.removeAttribute("style");Jh in e&&(e[Jh]=i?o.display:"",e[F3]&&(o.display="none"))}const sx=/\s*!important$/;function Uu(e,t,n){if(xt(n))n.forEach(o=>Uu(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=B9(e,t);sx.test(n)?e.setProperty(Is(o),n.replace(sx,""),"important"):e[o]=n}}const ix=["Webkit","Moz","ms"],s0={};function B9(e,t){const n=s0[t];if(n)return n;let o=No(t);if(o!=="filter"&&o in e)return s0[t]=o;o=tm(o);for(let s=0;si0||(z9.then(()=>i0=0),i0=Date.now());function q9(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,j9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?$9(e,o,r):t==="style"?R9(e,n,o):zd(t)?Qp(t)||H9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):V9(e,t,o,r))?(ax(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&lx(e,t,o,r,i,t!=="value")):e._isVueCE&&(K9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Cn(o)))?ax(e,No(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),lx(e,t,o,r))};function V9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&dx(t)&&$t(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 dx(t)&&Cn(n)?!1:t in e}function K9(e,t){const n=e._def.props;if(!n)return!1;const o=No(t);return Array.isArray(n)?n.some(s=>No(s)===o):Object.keys(n).some(s=>No(s)===o)}const fx={};function G9(e,t,n){let o=Ze(e,t);Xp(o)&&(o=kn({},o,t));class s extends Ey{constructor(r){super(o,r,n)}}return s.def=o,s}const Xwe=((e,t)=>G9(e,t,dN)),Y9=typeof HTMLElement<"u"?HTMLElement:class{};class Ey extends Y9{constructor(t,n={},o=op){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!==op?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kn({},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 Ey){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,mt(()=>{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]=Dh(this._props[a])),(l||(l=Object.create(null)))[No(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)ln(this,o)||Object.defineProperty(this,o,{get:()=>C(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(No))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):fx;const s=No(t);n&&this._numberProps&&this._numberProps[s]&&(o=Dh(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===fx?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(Is(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Is(t),n+""):n||this.removeAttribute(Is(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),uN(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,kn(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,Xp(r[0])?kn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Is(i)!==i&&s(Is(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),X9=Q9({name:"TransitionGroup",props:kn({},I3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yo(),o=V4();let s,i;return yy(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!oN(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(eN),s.forEach(tN);const l=s.filter(nN);zg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Zi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[tp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[tp]=null,dl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=en(e),l=L3(r);let a=r.tag||Pe;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}=$3(o);return i.removeChild(o),r}const Ll=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Lc(t,n):t};function sN(e){e.target.composing=!0}function px(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function mx(e,t,n){return t&&(e=e.trim()),n&&(e=nm(e)),e}const _s={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[bi]=Ll(s);const i=o||s.props&&s.props.type==="number";Ir(e,t?"change":"input",r=>{r.target.composing||e[bi](mx(e.value,n,i))}),(n||i)&&Ir(e,"change",()=>{e.value=mx(e.value,n,i)}),t||(Ir(e,"compositionstart",sN),Ir(e,"compositionend",px),Ir(e,"change",px))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[bi]=Ll(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?nm(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)}},np={deep:!0,created(e,t,n){e[bi]=Ll(n),Ir(e,"change",()=>{const o=e._modelValue,s=Zc(e),i=e.checked,r=e[bi];if(xt(o)){const l=sm(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(Ra(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(H3(e,i))})},mounted:gx,beforeUpdate(e,t,n){e[bi]=Ll(n),gx(e,t,n)}};function gx(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xt(t))s=sm(t,o.props.value)>-1;else if(Ra(t))s=t.has(o.props.value);else{if(t===n)return;s=Br(t,H3(e,!0))}e.checked!==s&&(e.checked=s)}const P3={created(e,{value:t},n){e.checked=Br(t,n.props.value),e[bi]=Ll(n),Ir(e,"change",()=>{e[bi](Zc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[bi]=Ll(o),t!==n&&(e.checked=Br(t,o.props.value))}},qg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Ra(t);Ir(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?nm(Zc(r)):Zc(r));e[bi](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[bi]=Ll(o)},mounted(e,{value:t}){vx(e,t)},beforeUpdate(e,t,n){e[bi]=Ll(n)},updated(e,{value:t}){e._assigning||vx(e,t)}};function vx(e,t){const n=e.multiple,o=xt(t);if(!(n&&!o&&!Ra(t))){for(let s=0,i=e.options.length;sString(c)===String(l)):r.selected=sm(t,l)>-1}else r.selected=t.has(l);else if(Br(Zc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zc(e){return"_value"in e?e._value:e.value}function H3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iN={created(e,t,n){Df(e,t,n,null,"created")},mounted(e,t,n){Df(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Df(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Df(e,t,n,o,"updated")}};function W3(e,t){switch(e){case"SELECT":return qg;case"TEXTAREA":return _s;default:switch(t){case"checkbox":return np;case"radio":return P3;default:return _s}}}function Df(e,t,n,o,s){const r=W3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function rN(){_s.getSSRProps=({value:e})=>({value:e}),P3.getSSRProps=({value:e},t)=>{if(t.props&&Br(t.props.value,e))return{checked:!0}},np.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&sm(e,t.props.value)>-1)return{checked:!0}}else if(Ra(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iN.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=W3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const lN=["ctrl","shift","alt","meta"],aN={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)=>lN.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(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=Is(s.key);if(t.some(r=>r===i||cN[r]===i))return e(s)}))},z3=kn({patchProp:j9},T9);let ed,yx=!1;function U3(){return ed||(ed=a9(z3))}function q3(){return ed=yx?ed:c9(z3),yx=!0,ed}const uN=((...e)=>{U3().render(...e)}),t_e=((...e)=>{q3().hydrate(...e)}),op=((...e)=>{const t=U3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(!s)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,j3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),dN=((...e)=>{const t=q3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(s)return n(s,!0,j3(s))},t});function j3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function V3(e){return Cn(e)?document.querySelector(e):e}let kx=!1;const n_e=()=>{kx||(kx=!0,rN(),F9())};/*! + * shared v11.4.5 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function fN(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const sp=typeof window<"u",Bl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),hN=(e,t,n)=>pN({l:e,k:t,s:n}),pN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),wo=e=>typeof e=="number"&&isFinite(e),K3=e=>Ny(e)==="[object Date]",Qc=e=>Ny(e)==="[object RegExp]",mm=e=>Jt(e)&&Object.keys(e).length===0,_o=Object.assign,mN=Object.create,Sn=(e=null)=>mN(e);let bx;const ya=()=>bx||(bx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Sn());function xx(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function gN(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const vN=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,yN=/^(?:href|src|action|formaction)$/i;function Ty(e){return vN.test(e)}function kN(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`${o}="${wx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${wx(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>Ty(s)?`${o}about:blank`:n),e}const xN=Object.prototype.hasOwnProperty;function yi(e,t){return xN.call(e,t)}const io=Array.isArray,Kn=e=>typeof e=="function",yt=e=>typeof e=="string",nn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",wN=e=>on(e)&&Kn(e.then)&&Kn(e.catch),G3=Object.prototype.toString,Ny=e=>G3.call(e),Jt=e=>Ny(e)==="[object Object]",_N=e=>e==null?"":io(e)||Jt(e)&&e.toString===G3?JSON.stringify(e,null,2):String(e);function Iy(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Pf=e=>!on(e)||io(e);function yh(e,t){if(Pf(e)||Pf(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__"&&(on(o[i])&&!on(s[i])&&(s[i]=Array.isArray(o[i])?[]:Sn()),Pf(s[i])||Pf(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*! + * message-compiler v11.4.5 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function SN(e,t,n){return{line:e,column:t,offset:n}}function jg(e,t,n){return{start:e,end:t}}const hn={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},CN=17;function gm(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 AN(e){throw e}const Ki=" ",MN="\r",Qo=` +`,EN="\u2028",TN="\u2029";function NN(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===MN&&t[N+1]===Qo,l=N=>t[N]===Qo,a=N=>t[N]===TN,c=N=>t[N]===EN,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=N=>r(N)||a(N)||c(N)?Qo:t[N],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(N=0){i=N}function $(){const N=n+i;for(;N!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const vr=void 0,IN=".",_x="'",LN="tokenizer";function $N(e,t={}){const n=t.location!==!1,o=NN(e),s=()=>o.index(),i=()=>SN(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(j,te,pe,...Ce){const $e=c();if(te.column+=pe,te.offset+=pe,u){const De=n?jg($e.startLoc,te):null,me=gm(j,De,{domain:LN,args:Ce});u(me)}}function f(j,te,pe){j.endLoc=i(),j.currentType=te;const Ce={type:te};return n&&(Ce.loc=jg(j.startLoc,j.endLoc)),pe!=null&&(Ce.value=pe),Ce}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(hn.EXPECTED_TOKEN,i(),0,te),"")}function g(j){let te="";for(;j.currentPeek()===Ki||j.currentPeek()===Qo;)te+=j.currentPeek(),j.peek();return te}function b(j){const te=g(j);return j.skipToPeek(),te}function v(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function m(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function y(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=v(j.currentPeek());return j.resetPeek(),Ce}function k(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=j.currentPeek()==="-"?j.peek():j.currentPeek(),$e=m(Ce);return j.resetPeek(),$e}function A(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=j.currentPeek()===_x;return j.resetPeek(),Ce}function $(j,te){const{currentType:pe}=te;if(pe!==7)return!1;g(j);const Ce=j.currentPeek()===".";return j.resetPeek(),Ce}function N(j,te){const{currentType:pe}=te;if(pe!==8)return!1;g(j);const Ce=v(j.currentPeek());return j.resetPeek(),Ce}function x(j,te){const{currentType:pe}=te;if(!(pe===7||pe===11))return!1;g(j);const Ce=j.currentPeek()===":";return j.resetPeek(),Ce}function I(j,te){const{currentType:pe}=te;if(pe!==9)return!1;const Ce=()=>{const De=j.currentPeek();return De==="{"?v(j.peek()):De==="@"||De==="|"||De===":"||De==="."||De===Ki||!De?!1:De===Qo?(j.peek(),Ce()):F(j,!1)},$e=Ce();return j.resetPeek(),$e}function E(j){g(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const pe=($e=!1,De="")=>{const me=j.currentPeek();return me==="{"||me==="@"||!me?$e:me==="|"?!(De===Ki||De===Qo):me===Ki?(j.peek(),pe(!0,Ki)):me===Qo?(j.peek(),pe(!0,Qo)):!0},Ce=pe();return te&&j.resetPeek(),Ce}function S(j,te){const pe=j.currentChar();return pe===vr?vr:te(pe)?(j.next(),pe):null}function L(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function R(j){return S(j,L)}function D(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function z(j){return S(j,D)}function H(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function U(j){return S(j,H)}function Z(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function K(j){return S(j,Z)}function V(j){let te="",pe="";for(;te=U(j);)pe+=te;return pe}function J(j){let te="";for(;;){const pe=j.currentChar();if(pe==="\\"){const Ce=j.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(te+=pe+Ce,j.next(),j.next()):(j.resetPeek(),te+=pe,j.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===Ki||pe===Qo)if(F(j))te+=pe,j.next();else{if(E(j))break;te+=pe,j.next()}else te+=pe,j.next()}}return te}function fe(j){b(j);let te="",pe="";for(;te=z(j);)pe+=te;const Ce=j.currentChar();if(Ce&&Ce!=="}"&&Ce!==vr&&Ce!==Ki&&Ce!==Qo&&Ce!==" "){const $e=P(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+$e),pe+$e}return j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function oe(j){b(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${V(j)}`):te+=V(j),j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function ce(j){return j!==_x&&j!==Qo}function ue(j){b(j),p(j,"'");let te="",pe="";for(;te=S(j,ce);)te==="\\"?pe+=Se(j):pe+=te;const Ce=j.currentChar();return Ce===Qo||Ce===vr?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ce===Qo&&(j.next(),p(j,"'")),pe):(p(j,"'"),pe)}function Se(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return Te(j,te,4);case"U":return Te(j,te,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function Te(j,te,pe){p(j,te);let Ce="";for(let $e=0;$e{const Ce=j.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===Ki?pe:(pe+=Ce,j.next(),te(pe))};return te("")}function q(j){b(j);const te=p(j,"|");return b(j),te}function ee(j,te){let pe=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),pe=f(te,2,"{"),b(j),te.braceNest++,pe;case"}":return te.braceNest>0&&te.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),pe=f(te,3,"}"),te.braceNest--,te.braceNest>0&&b(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),pe;case"@":return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ge(j,te)||h(te),te.braceNest=0,pe;default:{let $e=!0,De=!0,me=!0;if(E(j))return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,de(j,te);if($e=y(j,te))return pe=f(te,4,fe(j)),b(j),pe;if(De=k(j,te))return pe=f(te,5,oe(j)),b(j),pe;if(me=A(j,te))return pe=f(te,6,ue(j)),b(j),pe;if(!$e&&!De&&!me)return pe=f(te,12,P(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),b(j),pe;break}}return pe}function ge(j,te){const{currentType:pe}=te;let Ce=null;const $e=j.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&($e===Qo||$e===Ki)&&d(hn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return j.next(),Ce=f(te,7,"@"),te.inLinked=!0,Ce;case".":return b(j),j.next(),f(te,8,".");case":":return b(j),j.next(),f(te,9,":");default:return E(j)?(Ce=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Ce):$(j,te)||x(j,te)?(b(j),ge(j,te)):N(j,te)?(b(j),f(te,11,le(j))):I(j,te)?(b(j),$e==="{"?ee(j,te)||Ce:f(te,10,ne(j))):(pe===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,de(j,te))}}function de(j,te){let pe={type:13};if(te.braceNest>0)return ee(j,te)||h(te);if(te.inLinked)return ge(j,te)||h(te);switch(j.currentChar()){case"{":return ee(j,te)||h(te);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ge(j,te)||h(te);default:{if(E(j))return pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(F(j))return f(te,0,J(j));break}}return pe}function ve(){const{currentType:j,offset:te,startLoc:pe,endLoc:Ce}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=pe,a.lastEndLoc=Ce,a.offset=s(),a.startLoc=i(),o.currentChar()===vr?f(a,13):de(o,a)}return{nextToken:ve,currentOffset:s,currentPosition:i,context:c}}const FN="parser",ON=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,RN=/\\([\\@{}|])/g;function BN(e,t){return t}function DN(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 PN(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const N=t?jg(y,$):null,x=gm(m,N,{domain:FN,args:A});n(x)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace(RN,BN),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(ON,DN),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=c(v,k.value||"");break;default:{o(v,hn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const I=$||v.nextToken();switch($=null,I.type){case 0:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(r(v,I.value||""));break;case 5:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(l(v,I.value||""));break;case 4:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(a(v,I.value||""));break;case 6:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(c(v,I.value||""));break;case 7:{const E=f(v);A.items.push(E.node),$=E.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const N=m.currentType===1?m.lastOffset:v.currentOffset(),x=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,N,x),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const N=s(1,m,y);N.cases=[],N.cases.push(k);do{const x=h(v);$||($=x.items.length===0),N.cases.push(x)}while(A.currentType!==13);return $&&o(v,hn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(N,v.currentOffset(),v.currentPosition()),N}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=$N(v,_o({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function Gi(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 HN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Sx(e,t){for(let n=0;nCx(n)),e}function Cx(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(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function qN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Xc(e,t.key),t.modifier?(e.push(", "),Xc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function jN(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=yt(t.mode)?t.mode:"normal",o=yt(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=UN(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Iy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Xc(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 YN(e,t={}){const n=_o({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=PN(n).parse(e);return o?(i&&zN(l),s&&gc(l),{ast:l,code:""}):(WN(l,n),GN(l,n))}/*! + * core-base v11.4.5 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function ZN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function sr(e){return on(e)&&$y(e)===0&&(yi(e,"b")||yi(e,"body"))}const Y3=["b","body"];function QN(e){return Dl(e,Y3)}const Z3=["c","cases"];function XN(e){return Dl(e,Z3,[])}const Q3=["s","static"];function JN(e){return Dl(e,Q3)}const X3=["i","items"];function e7(e){return Dl(e,X3,[])}const J3=["t","type"];function $y(e){return Dl(e,J3)}const eA=["v","value"];function Hf(e,t){const n=Dl(e,eA);if(n!=null)return n;throw _d(t)}const tA=["m","modifier"];function t7(e){return Dl(e,tA)}const nA=["k","key"];function n7(e){const t=Dl(e,nA);if(t)return t;throw _d(6)}function Dl(e,t,n){for(let o=0;oo7(n,e)}function o7(e,t){const n=QN(t);if(n==null)throw _d(0);if($y(n)===1){const i=XN(n);return e.plural(i.reduce((r,l)=>[...r,Ax(e,l)],[]))}else return Ax(e,n)}function Ax(e,t){const n=JN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=e7(t).reduce((s,i)=>[...s,Vg(e,i)],[]);return e.normalize(o)}}function Vg(e,t){const n=$y(t);switch(n){case 3:return Hf(t,n);case 9:return Hf(t,n);case 4:{const o=t;if(yi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(yi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw _d(n)}case 5:{const o=t;if(yi(o,"i")&&wo(o.i))return e.interpolate(e.list(o.i));if(yi(o,"index")&&wo(o.index))return e.interpolate(e.list(o.index));throw _d(n)}case 6:{const o=t,s=t7(o),i=n7(o);return e.linked(Vg(e,i),s?Vg(e,s):void 0,e.type)}case 7:return Hf(t,n);case 8:return Hf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const s7=e=>e;let Wf=Sn();function i7(e,t={}){let n=!1;const o=t.onError||AN;return t.onError=s=>{n=!0,o(s)},{...YN(e,t),detectError:n}}function r7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){nn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||s7)(e),s=Wf[o];if(s)return s;const{ast:i,detectError:r}=i7(e,{...t,location:!1,jit:!0}),l=r0(i);return r?l:Wf[o]=l}else{const n=e.cacheKey;if(n){const o=Wf[n];return o||(Wf[n]=r0(e))}else return r0(e)}}let Sd=null;function l7(e){Sd=e}function a7(e,t,n){Sd&&Sd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const c7=u7("function:translate");function u7(e){return t=>Sd&&Sd.emit(e,t)}const Lr={INVALID_ARGUMENT:CN,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},d7=24;function $r(e){return gm(e,null,void 0)}function Fy(e,t){return t.locale!=null?Mx(t.locale):Mx(e.locale)}let l0;function Mx(e){if(yt(e))return e;if(Kn(e)){if(e.resolvedOnce&&l0!=null)return l0;if(e.constructor.name==="Function"){const t=e();if(wN(t))throw $r(Lr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return l0=t}else throw $r(Lr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $r(Lr.NOT_SUPPORT_LOCALE_TYPE)}function f7(e,t,n){return[...new Set([n,...io(t)?t:on(t)?Object.keys(t):yt(t)?[t]:[n]])]}function Kg(e,t,n){const o=yt(n)?n:Cd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;io(r);)r=Ex(i,r,t);const l=io(t)||!Jt(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,io(r)&&Ex(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Ex(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=k7(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=y7(i),d=Pl[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 Tx=new Map;function x7(e,t){return on(e)?e[t]:null}function w7(e,t){if(!on(e))return null;let n=Tx.get(t);if(n||(n=b7(t),n&&Tx.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 S7(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?Nx(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?Nx(e.children):e}}let sA;function C7(e){sA=e}let iA;function A7(e){iA=e}let rA;function M7(e){rA=e}let lA=null;const E7=e=>{lA=e},T7=()=>lA;let aA=null;const Ix=e=>{aA=e},N7=()=>aA;let Lx=0;function I7(e={}){const t=Kn(e.onWarn)?e.onWarn:fN,n=yt(e.version)?e.version:_7,o=yt(e.locale)||Kn(e.locale)?e.locale:Cd,s=Kn(o)?Cd:o,i=io(e.fallbackLocale)||Jt(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Jt(e.messages)?e.messages:a0(s),l=Jt(e.datetimeFormats)?e.datetimeFormats:a0(s),a=Jt(e.numberFormats)?e.numberFormats:a0(s),c=_o(Sn(),e.modifiers,S7()),u=e.pluralRules||Sn(),d=Kn(e.missing)?e.missing:null,f=nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Kn(e.postTranslation)?e.postTranslation:null,v=Jt(e.processor)?e.processor:null,m=nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Kn(e.messageCompiler)?e.messageCompiler:sA,A=Kn(e.messageResolver)?e.messageResolver:iA||x7,$=Kn(e.localeFallbacker)?e.localeFallbacker:rA||f7,N=on(e.fallbackContext)?e.fallbackContext:void 0,x=e,I=on(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,E=on(x.__numberFormatters)?x.__numberFormatters:new Map,F=on(x.__meta)?x.__meta:{};Lx++;const S={version:n,cid:Lx,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:N,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=I,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&a7(S,n,F),S}const a0=e=>({[e]:Sn()});function Oy(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return yt(l)?l:t}else return t}function $u(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function L7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function $7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o{cA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Fx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Ox(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!wo(t[0]))return ip;const[a,c,u,d]=Yg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Fy(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;${uA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Rx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const F7=e=>e,O7=e=>"",R7="text",B7=e=>e.length===0?"":Iy(e),D7=_N;function c0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function P7(e){const t=wo(e.pluralIndex)?e.pluralIndex:-1;return wo(e.named?.count)?e.named.count:wo(e.named?.n)?e.named.n:t}function H7(e={}){const t=e.locale,n=P7(e),o=yt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:c0,s=o===c0?void 0:c0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||Sn();wo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Kn(e.messages)?e.messages(v,!!m):on(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):O7)}const d=v=>e.modifiers?e.modifiers[v]:F7,f=Kn(e.processor?.normalize)?e.processor.normalize:B7,h=Kn(e.processor?.interpolate)?e.processor.interpolate:D7,p=yt(e.processor?.type)?e.processor.type:R7,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?on(y)?($=y.modifier||$,A=y.type||A):yt(y)&&($=y||$):m.length===2&&(yt(y)&&($=y||$),yt(k)&&(A=k||A));const N=u(v,!0)(b),x=N===""||N===void 0?v:N,I=A==="vnode"&&io(x)&&$?x[0]:x;return $?d($)(I,A):I},message:u,type:p,interpolate:h,normalize:f,values:_o(Sn(),r,a)};return b}const Bx=()=>"",hi=e=>Kn(e);function Dx(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Zg(...t),u=nn(c.missingWarn)?c.missingWarn:e.missingWarn,d=nn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=nn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||nn(c.default)?nn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(yt(p)||Kn(p)),b=Fy(e,c);f&&W7(c);let[v,m,y]=h?[a,b,l[b]||Sn()]:dA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(yt(k)||sr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(yt(k)||sr(k)||hi(k))||!yt(m)))return s?vm:a;let $=!1;const N=()=>{$=!0},x=hi(k)?k:fA(e,a,m,k,A,N);if($)return k;const I=q7(e,m,y,c),E=H7(I),F=z7(e,x,E);let S=o?o(F,a):F;if(f&&yt(S)&&(S=bN(S)),__INTLIFY_PROD_DEVTOOLS__){const L={timestamp:Date.now(),key:yt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:yt(k)?k:hi(k)?k.source:"",message:S};L.meta=_o({},e.__meta,T7()||{}),c7(L)}return S}function W7(e){io(e.list)?e.list=e.list.map(t=>yt(t)?xx(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=xx(e.named[t]))})}function dA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Sn(),f,h=null;const p="translate";for(let g=0;go);return c.locale=n,c.key=t,c}const a=r(o,U7(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function z7(e,t,n){return t(n)}function Zg(...e){const[t,n,o]=e,s=Sn();if(!yt(t)&&!wo(t)&&!hi(t)&&!sr(t))throw $r(Lr.INVALID_ARGUMENT);const i=wo(t)?String(t):(hi(t),t);return wo(n)?s.plural=n:yt(n)?s.default=n:Jt(n)&&!mm(n)?s.named=n:io(n)&&(s.list=n),wo(o)?s.plural=o:yt(o)?s.default=o:Jt(o)&&_o(s,o),[i,s]}function U7(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>hN(t,n,r)}}function q7(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:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[b,,v]=dA(u||e,h,t,l,a,c);g=b??r(v,h)}if(yt(g)||sr(g)){let b=!1;const m=fA(e,h,t,g,h,()=>{b=!0});return b?Bx:m}else return hi(g)?g:Bx}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),wo(o.plural)&&(f.pluralIndex=o.plural),f}ZN();/*! + * vue-i18n v11.4.5 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */const j7="11.4.5";function V7(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ya().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ya().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1)}const vs={UNEXPECTED_RETURN_TYPE:d7,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 Ls(e,...t){return gm(e,null,void 0)}const Qg=Bl("__translateVNode"),Xg=Bl("__datetimeParts"),Jg=Bl("__numberParts"),hA=Bl("__setPluralRules"),pA=Bl("__injectWithOption"),_c=Bl("__dispose");function Ad(e){if(!on(e)||sr(e))return e;for(const t in e)if(yi(e,t))if(!t.includes("."))on(e[t])&&Ad(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Sn(),yh(c,r[a])):yh(c,r)}else yt(l)&&yh(JSON.parse(l),r)}),s==null&&i)for(const l in r)yi(r,l)&&Ad(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let o=on(t.messages)?t.messages:Sn();"__i18nGlobal"in n&&(o=Ry(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(on(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(on(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Px(e){return re(Sl,null,e,0)}function Md(){return Yo()}const Hx="__INTLIFY_META__",Wx=()=>[],K7=()=>!1;let zx=0;function Ux(e){return((t,n,o,s)=>e(n,o,Md()||void 0,s))}const G7=()=>{const e=Md();let t=null;return e&&(t=mA(e)[Hx])?{[Hx]:t}:null};function rp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=sp?X:Ba;let r=nn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:Cd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ry(l.value,e)),u=i(Jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:nn(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Kn(e.missing)?e.missing:null,v=Kn(e.missing)?Ux(e.missing):null,m=Kn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Jt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&Ix(null);const me={version:j7,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};me.datetimeFormats=u.value,me.numberFormats=d.value,me.__datetimeFormatters=Jt(N)?N.__datetimeFormatters:void 0,me.__numberFormatters=Jt(N)?N.__numberFormatters:void 0;const Ie=I7(me);return o&&Ix(Ie),Ie})(),$u(N,l.value,a.value);function I(){return[l.value,a.value,c.value,u.value,d.value]}const E=B({get:()=>l.value,set:me=>{N.locale=me,l.value=me}}),F=B({get:()=>a.value,set:me=>{N.fallbackLocale=me,a.value=me,$u(N,l.value,me)}}),S=B(()=>c.value),L=B(()=>u.value),R=B(()=>d.value);function D(){return Kn(m)?m:null}function z(me){m=me,N.postTranslation=me}function H(){return b}function U(me){me!==null&&(v=Ux(me)),b=me,N.missing=v}const Z=(me,Ie,et,rt,_t,gt)=>{I();let It;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?N7():void 0),It=me(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(et!=="translate exists"&&wo(It)&&It===vm||et==="translate exists"&&!It){const[Ut,ht]=Ie();return t&&p?rt(t):_t(Ut)}else{if(gt(It))return It;throw Ls(vs.UNEXPECTED_RETURN_TYPE)}};function K(...me){return Z(Ie=>Reflect.apply(Dx,null,[Ie,...me]),()=>Zg(...me),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...me]),Ie=>Ie,Ie=>yt(Ie))}function V(...me){const[Ie,et,rt]=me;if(rt&&!on(rt))throw Ls(vs.INVALID_ARGUMENT);return K(Ie,et,_o({resolvedMessage:!0},rt||{}))}function J(...me){return Z(Ie=>Reflect.apply($x,null,[Ie,...me]),()=>Gg(...me),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...me]),()=>ip,Ie=>yt(Ie)||io(Ie))}function fe(...me){return Z(Ie=>Reflect.apply(Ox,null,[Ie,...me]),()=>Yg(...me),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...me]),()=>ip,Ie=>yt(Ie)||io(Ie))}function oe(me){return me.map(Ie=>yt(Ie)||wo(Ie)||nn(Ie)?Px(String(Ie)):Ie)}const ue={normalize:oe,interpolate:me=>me,type:"vnode"};function Se(...me){return Z(Ie=>{let et;const rt=Ie;try{rt.processor=ue,et=Reflect.apply(Dx,null,[rt,...me])}finally{rt.processor=null}return et},()=>Zg(...me),"translate",Ie=>Ie[Qg](...me),Ie=>[Px(Ie)],Ie=>io(Ie))}function Te(...me){return Z(Ie=>Reflect.apply(Ox,null,[Ie,...me]),()=>Yg(...me),"number format",Ie=>Ie[Jg](...me),Wx,Ie=>yt(Ie)||io(Ie))}function Ae(...me){return Z(Ie=>Reflect.apply($x,null,[Ie,...me]),()=>Gg(...me),"datetime format",Ie=>Ie[Xg](...me),Wx,Ie=>yt(Ie)||io(Ie))}function P(me){$=me,N.pluralRules=$}function le(me,Ie){return Z(()=>{if(!me)return!1;const et=yt(Ie)?Ie:l.value,rt=yt(Ie)?[et]:Kg(N,a.value,et);for(let _t=0;_t[me],"translate exists",et=>Reflect.apply(et.te,et,[me,Ie]),K7,et=>nn(et))}function ne(me){let Ie=null;const et=Kg(N,a.value,l.value);for(let rt=0;rt{r&&(l.value=me,N.locale=me,$u(N,l.value,a.value))}),Qe(t.fallbackLocale,me=>{r&&(a.value=me,N.fallbackLocale=me,$u(N,l.value,a.value))}));const De={id:zx,locale:E,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(me){r=me,me&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,$u(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(me){f=me,N.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(me){h=me,N.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(me){p=me},get fallbackFormat(){return g},set fallbackFormat(me){g=me,N.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(me){y=me,N.warnHtmlMessage=me},get escapeParameter(){return k},set escapeParameter(me){k=me,N.escapeParameter=me},t:K,getLocaleMessage:ee,setLocaleMessage:ge,mergeLocaleMessage:de,getPostTranslationHandler:D,setPostTranslationHandler:z,getMissingHandler:H,setMissingHandler:U,[hA]:P};return De.datetimeFormats=L,De.numberFormats=R,De.rt=V,De.te=le,De.tm=q,De.d=J,De.n=fe,De.getDateTimeFormat=ve,De.setDateTimeFormat=j,De.mergeDateTimeFormat=te,De.getNumberFormat=pe,De.setNumberFormat=Ce,De.mergeNumberFormat=$e,De[pA]=n,De[Qg]=Se,De[Xg]=Ae,De[Jg]=Te,De}function Y7(e){const t=yt(e.locale)?e.locale:Cd,n=yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Kn(e.missing)?e.missing:void 0,s=nn(e.silentTranslationWarn)||Qc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=nn(e.silentFallbackWarn)||Qc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=nn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=nn(e.sync)?e.sync:!0;let p=e.messages;if(Jt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((N,x)=>{const I=N[x]||(N[x]={});return _o(I,A[x]),N},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:b,__injectWithOption:v}}function ev(e={}){const t=rp(Y7(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 nn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=nn(s)?!s:s},get silentFallbackWarn(){return nn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=nn(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,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function Z7(e,t,n){return{beforeCreate(){const o=Md();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=qx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=ev(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=qx(e,s);else{this.$i18n=ev({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&gA(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=Md();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$i18n;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 qx(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[hA](t.pluralizationRules||e.pluralizationRules);const n=Ry(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 By={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Q7({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Sn())}function vA(){return Pe}const X7=Ze({name:"i18n-t",props:_o({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>wo(e)||!isNaN(e)}},By),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Sn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=Q7(t,a);return s[Qg](e.keypath,u,c)},r=_o(Sn(),o),l=yt(e.tag)||on(e.tag)?e.tag:vA();return on(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),jx=X7;function J7(e){return io(e)&&!yt(e[0])}function yA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Sn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:on(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?_o(Sn(),h,{[p]:e.format[p]}):h,Sn()));const d=o(e.value,c,u);let f=[c.key];return io(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return J7(b)&&(b[0].key=`${h.type}-${p}`),b}):yt(d)&&(f=[d]),f},l=_o(Sn(),i),a=yt(e.tag)||on(e.tag)?e.tag:vA();return on(a)?mn(a,l,{default:r}):mn(a,l,r())}}const eI=Ze({name:"i18n-n",props:_o({value:{type:Number,required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...o)=>n[Jg](...o))}}),Vx=eI;function tI(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 nI(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ls(vs.UNEXPECTED_ERROR);const c=tI(e,l.$),u=Kx(a);return[Reflect.apply(c.t,c,[...Gx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);sp&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{sp&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Kx(l);r.textContent=Reflect.apply(a.t,a,[...Gx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Kx(e){if(yt(e))return{path:e};if(Jt(e)){if(!("path"in e))throw Ls(vs.REQUIRED_VALUE,"path");return e}else throw Ls(vs.INVALID_VALUE)}function Gx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return yt(n)&&(r.locale=n),wo(s)&&(r.plural=s),wo(i)&&(r.plural=i),[t,l,r]}function oI(e,t,...n){const o=Jt(n[0])?n[0]:{};(nn(o.globalInstall)?o.globalInstall:!0)&&([jx.name,"I18nT"].forEach(i=>e.component(i,jx)),[Vx.name,"I18nN"].forEach(i=>e.component(i,Vx)),[Qx.name,"I18nD"].forEach(i=>e.component(i,Qx))),e.directive("t",nI(t))}const sI=Bl("global-vue-i18n");function iI(e={}){const t=__VUE_I18N_LEGACY_API__&&nn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=nn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=rI(e,t),r=Bl("");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__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Jt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=hI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&oI(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(Z7(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Tt(e={}){const t=Md();if(t==null)throw Ls(vs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ls(vs.NOT_INSTALLED);const n=lI(t),o=cI(n),s=mA(t),i=aI(e,s);if(i==="global")return gA(o,e,s),o;if(i==="parent"){let a=Yx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ls(vs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=_o({},e),u=Yx(n,t);c.__root=u||o;const d=rp(c);return a.__composerExtend&&(d[_c]=a.__composerExtend(d)),uy()&&dy(()=>{const h=d[_c];h&&(h(),delete d[_c])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=_o({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=rp(a),r.__composerExtend&&(l[_c]=r.__composerExtend(l)),dI(r,t,l),r.__setInstance(t,l)}return l}function rI(e,t){const n=LE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>ev(e)):n.run(()=>rp(e));if(o==null)throw Ls(vs.UNEXPECTED_ERROR);return[n,o]}function lI(e){const t=Kt(e.isCE?sI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ls(e.isCE?vs.NOT_INSTALLED_WITH_PROVIDE:vs.UNEXPECTED_ERROR);return t}function aI(e,t){return mm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function cI(e){return e.mode==="composition"?e.global:e.global.__composer}function Yx(e,t,n=!1){let o=null;const s=t.root;let i=uI(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[pA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function uI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function dI(e,t,n){cn(()=>{},t),bn(()=>{const o=n;e.__deleteInstance(t);const s=o[_c];s&&(s(),delete o[_c])},t)}const fI=["locale","fallbackLocale","availableLocales"],Zx=["t","rt","d","n","tm","te"];function hI(e,t){const n=Object.create(null);return fI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ls(vs.UNEXPECTED_ERROR);const r=ho(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,Zx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ls(vs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Zx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const pI=Ze({name:"i18n-d",props:_o({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...o)=>n[Xg](...o))}}),Qx=pI;V7();C7(r7);A7(w7);M7(Kg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ya();e.__INTLIFY__=!0,l7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const mI="modulepreload",gI=function(e){return"/"+e},Xx={},ms=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=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=r(n.map(c=>{if(c=gI(c),c in Xx)return;Xx[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":mI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Ft={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking"};function Jx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function mo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function So(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Na(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ym(e){const t=mo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Gd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Dy(){const e=mo(Ft.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 Py(e){const n={...Dy()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];So(Ft.unread,JSON.stringify(n))}function vI(){const e=ym(Ft.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function u0(e){Gd(Ft.collapsedWorkspaces,Array.from(e))}function yI(){const e=ym(Ft.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){Gd(Ft.workspaceOrder,Array.from(e))}function zf(){const e=ym(Ft.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 ew(e){Gd(Ft.workspaceNameOverrides,e)}function kI(){return mo(Ft.workspaceSort)}function bA(e){So(Ft.workspaceSort,e)}const tw=Ft.clientId,bI="kimi-code-web",xI="web";function wI(){return{serverHttpUrl:SI(),clientId:EI(),clientName:bI,clientVersion:TI(),clientUiMode:xI}}function _I(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function SI(e){const t=_I(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function CI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function AI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return CI(e)}function Sc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function MI(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 EI(){const e=mo(tw);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return So(tw,t),t}function TI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function NI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function II(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Go(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 $I(e)}function LI(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Go(e)}function $I(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}function FI(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function OI(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 RI(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const DI={"&":"&","<":"<",">":">",'"':""","'":"'"};function nw(e){return e.replace(/[&<>"']/g,t=>DI[t]??t)}function PI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function HI(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 ow(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return ow(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l`${i}`)}const vc=X(0),WI=["type","disabled","aria-label"],zI=Ze({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(w(),T("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[On(o.$slots,"default",{},void 0,!0)],10,WI))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Pn=ct(zI,[["__scopeId","data-v-c9e67023"]]),UI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qI(e,t){return w(),T("svg",UI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const jI=pt({name:"kimi-add-conversation",render:qI}),VI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KI(e,t){return w(),T("svg",VI,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const GI=pt({name:"kimi-folder",render:KI}),YI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZI=["clip-path"],QI=["id"];function XI(e,t){return w(),T("svg",YI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,ZI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,QI)])])}const JI=pt({name:"kimi-folder-open",render:XI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),eL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tL(e,t){return w(),T("svg",eL,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const nL=pt({name:"kimi-more",render:tL}),oL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sL(e,t){return w(),T("svg",oL,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const iL=pt({name:"kimi-search",render:sL}),rL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lL(e,t){return w(),T("svg",rL,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const aL=pt({name:"kimi-setting",render:lL}),cL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uL(e,t){return w(),T("svg",cL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const dL=pt({name:"tabler-layout-sidebar-left-collapse",render:uL}),fL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hL(e,t){return w(),T("svg",fL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const pL=pt({name:"tabler-layout-sidebar-left-expand",render:hL}),mL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gL(e,t){return w(),T("svg",mL,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const vL=pt({name:"tabler-paperclip",render:gL}),yL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kL(e,t){return w(),T("svg",yL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const bL=pt({name:"ri-add-line",render:kL}),xL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wL(e,t){return w(),T("svg",xL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const _L=pt({name:"ri-alert-line",render:wL}),SL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CL(e,t){return w(),T("svg",SL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const AL=pt({name:"ri-archive-line",render:CL}),ML={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EL(e,t){return w(),T("svg",ML,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const TL=pt({name:"ri-arrow-down-line",render:EL}),NL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IL(e,t){return w(),T("svg",NL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const LL=pt({name:"ri-arrow-down-s-line",render:IL}),$L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FL(e,t){return w(),T("svg",$L,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const OL=pt({name:"ri-arrow-go-back-line",render:FL}),RL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BL(e,t){return w(),T("svg",RL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const DL=pt({name:"ri-arrow-right-line",render:BL}),PL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HL(e,t){return w(),T("svg",PL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const WL=pt({name:"ri-arrow-right-s-line",render:HL}),zL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UL(e,t){return w(),T("svg",zL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const sw=pt({name:"ri-arrow-up-line",render:UL}),qL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jL(e,t){return w(),T("svg",qL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const VL=pt({name:"ri-arrow-up-s-line",render:jL}),KL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GL(e,t){return w(),T("svg",KL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const YL=pt({name:"ri-braces-line",render:GL}),ZL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QL(e,t){return w(),T("svg",ZL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const XL=pt({name:"ri-calendar-close-line",render:QL}),JL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e$(e,t){return w(),T("svg",JL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const t$=pt({name:"ri-calendar-schedule-line",render:e$}),n$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o$(e,t){return w(),T("svg",n$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const s$=pt({name:"ri-calendar-todo-line",render:o$}),i$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r$(e,t){return w(),T("svg",i$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const l$=pt({name:"ri-check-line",render:r$}),a$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c$(e,t){return w(),T("svg",a$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const u$=pt({name:"ri-close-line",render:c$}),d$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f$(e,t){return w(),T("svg",d$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const h$=pt({name:"ri-code-line",render:f$}),p$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m$(e,t){return w(),T("svg",p$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const g$=pt({name:"ri-collapse-diagonal-line",render:m$}),v$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y$(e,t){return w(),T("svg",v$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const k$=pt({name:"ri-download-line",render:y$}),b$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x$(e,t){return w(),T("svg",b$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const w$=pt({name:"ri-draggable",render:x$}),_$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S$(e,t){return w(),T("svg",_$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const C$=pt({name:"ri-equalizer-line",render:S$}),A$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M$(e,t){return w(),T("svg",A$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const E$=pt({name:"ri-expand-diagonal-line",render:M$}),T$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N$(e,t){return w(),T("svg",T$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const I$=pt({name:"ri-external-link-line",render:N$}),L$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $$(e,t){return w(),T("svg",L$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const F$=pt({name:"ri-file-add-line",render:$$}),O$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R$(e,t){return w(),T("svg",O$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const B$=pt({name:"ri-file-copy-line",render:R$}),D$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P$(e,t){return w(),T("svg",D$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const H$=pt({name:"ri-file-edit-line",render:P$}),W$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z$(e,t){return w(),T("svg",W$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const iw=pt({name:"ri-file-line",render:z$}),U$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q$(e,t){return w(),T("svg",U$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const j$=pt({name:"ri-file-text-line",render:q$}),V$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K$(e,t){return w(),T("svg",V$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const G$=pt({name:"ri-flashlight-line",render:K$}),Y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z$(e,t){return w(),T("svg",Y$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const Q$=pt({name:"ri-folder-add-line",render:Z$}),X$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J$(e,t){return w(),T("svg",X$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const eF=pt({name:"ri-folder-fill",render:J$}),tF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nF(e,t){return w(),T("svg",tF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const oF=pt({name:"ri-git-fork-line",render:nF}),sF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iF(e,t){return w(),T("svg",sF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const rF=pt({name:"ri-git-pull-request-line",render:iF}),lF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aF(e,t){return w(),T("svg",lF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const cF=pt({name:"ri-global-line",render:aF}),uF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dF(e,t){return w(),T("svg",uF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const rw=pt({name:"ri-image-line",render:dF}),fF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hF(e,t){return w(),T("svg",fF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const pF=pt({name:"ri-information-line",render:hF}),mF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gF(e,t){return w(),T("svg",mF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const vF=pt({name:"ri-links-line",render:gF}),yF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kF(e,t){return w(),T("svg",yF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const bF=pt({name:"ri-list-check",render:kF}),xF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wF(e,t){return w(),T("svg",xF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const _F=pt({name:"ri-list-unordered",render:wF}),SF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CF(e,t){return w(),T("svg",SF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const AF=pt({name:"ri-login-box-line",render:CF}),MF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EF(e,t){return w(),T("svg",MF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const TF=pt({name:"ri-mail-line",render:EF}),NF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IF(e,t){return w(),T("svg",NF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const LF=pt({name:"ri-message-line",render:IF}),$F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FF(e,t){return w(),T("svg",$F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const OF=pt({name:"ri-pause-fill",render:FF}),RF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BF(e,t){return w(),T("svg",RF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const DF=pt({name:"ri-pencil-line",render:BF}),PF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HF(e,t){return w(),T("svg",PF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const WF=pt({name:"ri-play-fill",render:HF}),zF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UF(e,t){return w(),T("svg",zF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const qF=pt({name:"ri-question-line",render:UF}),jF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VF(e,t){return w(),T("svg",jF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const KF=pt({name:"ri-sort-desc",render:VF}),GF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YF(e,t){return w(),T("svg",GF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const ZF=pt({name:"ri-sparkling-line",render:YF}),QF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return w(),T("svg",QF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const JF=pt({name:"ri-star-fill",render:XF}),eO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tO(e,t){return w(),T("svg",eO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const nO=pt({name:"ri-star-line",render:tO}),oO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sO(e,t){return w(),T("svg",oO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const iO=pt({name:"ri-stop-fill",render:sO}),rO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lO(e,t){return w(),T("svg",rO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const aO=pt({name:"ri-subtract-line",render:lO}),cO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uO(e,t){return w(),T("svg",cO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const dO=pt({name:"ri-target-line",render:uO}),fO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hO(e,t){return w(),T("svg",fO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const pO=pt({name:"ri-terminal-box-line",render:hO}),mO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gO(e,t){return w(),T("svg",mO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const vO=pt({name:"ri-time-line",render:gO}),yO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kO(e,t){return w(),T("svg",yO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const bO=pt({name:"ri-tools-line",render:kO}),xO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wO(e,t){return w(),T("svg",xO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const _O=pt({name:"ri-user-line",render:wO}),SO=` + + + +`,CO=` + + +`,AO=` + + + + + + + + + +`,MO=` + + + + +`,EO=` + + +`,TO=` + + + +`,NO='',IO='',LO='',$O='',FO='',OO='',RO='',BO='',DO='',PO='',HO='',lw='',WO='',zO='',UO='',qO='',jO='',VO='',KO='',GO='',YO='',ZO='',QO='',XO='',JO='',eR='',tR='',nR='',oR='',aw='',sR='',iR='',rR='',lR='',aR='',cR='',uR='',cw='',dR='',fR='',hR='',pR='',mR='',gR='',vR='',yR='',kR='',bR='',xR='',wR='',_R='',SR='',CR='',AR='',MR='',ER='',TR='',NR='',IR='',LR='',xA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const wA={plus:vt(bL,$O),"chat-new":vt(jI,SO),"calendar-close":vt(XL,UO),"calendar-schedule":vt(t$,qO),"calendar-todo":vt(s$,jO),close:vt(u$,KO),check:vt(l$,VO),archive:vt(AL,OO),search:vt(iL,EO),copy:vt(B$,nR),link:vt(vF,fR),"external-link":vt(I$,eR),download:vt(k$,ZO),undo:vt(OL,DO),send:vt(sw,lw),image:vt(rw,cw),settings:vt(aL,TO),sliders:vt(C$,XO),"log-in":vt(AF,mR),"chevron-down":vt(LL,BO),"chevron-right":vt(WL,HO),"chevron-up":vt(VL,WO),"arrow-up":vt(sw,lw),"arrow-down":vt(TL,RO),"arrow-right":vt(DL,PO),minus:vt(aO,MR),"panel-collapse":vt(dL,NO),"panel-expand":vt(pL,IO),expand:vt(E$,JO),collapse:vt(g$,YO),list:vt(_F,pR),sort:vt(KF,wR),grip:vt(w$,QO),folder:vt(JI,AO),"folder-closed":vt(GI,CO),"folder-plus":vt(Q$,rR),"folder-solid":vt(eF,lR),file:vt(iw,aw),"file-text":vt(j$,sR),"file-edit":vt(H$,oR),"file-plus":vt(F$,tR),"file-off":vt(iw,aw),attachment:vt(vL,LO),"image-off":vt(rw,cw),code:vt(h$,GO),terminal:vt(pO,TR),pencil:vt(DF,kR),tool:vt(bO,IR),glob:vt(YL,zO),globe:vt(cF,uR),"check-list":vt(bF,hR),bolt:vt(G$,iR),"git-fork":vt(oF,aR),"git-pull-request":vt(rF,cR),message:vt(LF,vR),mail:vt(TF,gR),user:vt(_O,LR),info:vt(pF,dR),"help-circle":vt(qF,xR),"alert-triangle":vt(_L,FO),clock:vt(vO,NR),sparkles:vt(ZF,_R),target:vt(dO,ER),pause:vt(OF,yR),play:vt(WF,bR),stop:vt(iO,AR),star:vt(JF,SR),"star-outline":vt(nO,CR),"dots-horizontal":vt(nL,MO)};function $R(e){return wA[e]}function FR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^

([\s\S]*?)<\/summary>/,OH=/([\s\S]*?)<\/resume_hint>/,h0=/]*)>|<\/subagent>/g,RH="",gw=/(completed|failed|aborted):\s*(\d+)/g,vw=/([a-z_]+)="([^"]*)"/g;function BH(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function DH(e){const t={};vw.lastIndex=0;let n;for(;(n=vw.exec(e))!==null;)t[n[1]]=BH(n[2]);return t}function PH(e){const t={completed:0,failed:0,aborted:0};gw.lastIndex=0;let n;for(;(n=gw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function HH(e,t){const n=DH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function WH(e){const t=[],n=[];h0.lastIndex=0;let o;for(;(o=h0.exec(e))!==null;)if(o[0]===RH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(HH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:h0.lastIndex}):n.push(null);return t}function zH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` +`):e;if(!t.includes(""))return null;const n=FH.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=PH(n),r=OH.exec(t)?.[1]?.trim(),l=WH(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function yw(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function UH(e){return e.suspendedReason||yw(e.text)||yw(e.outputLines?.join(` +`))||e.summary||""}function qH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function jH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function kw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:jH(e.outcome),body:e.body}}function VH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function KH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:UH(s),phase:s.phase,body:qH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>VH(i,s))).map((s,i)=>kw(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>kw(s,i))}const GH=["aria-expanded"],YH={class:"title"},ZH={key:0,class:"meta"},QH={key:1,class:"sum-txt"},XH={class:"rt"},JH={class:"status"},eW={key:0,class:"chip"},tW={key:1,class:"tm"},nW={class:"body"},oW={class:"overview"},sW={class:"overview-line"},iW={class:"big"},rW={key:0,class:"lbl"},lW={key:1,class:"lbl"},aW={key:2,class:"lbl"},cW={key:0,class:"seg","aria-hidden":"true"},uW={key:1,class:"legend"},dW=["aria-expanded","onClick"],fW={class:"mname"},hW={class:"mact"},pW={class:"mphase"},mW={key:1,class:"fallback-output"},gW={key:2,class:"waiting"},vW=Ze({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function o(E){if(!E)return{};try{const F=JSON.parse(E),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Kt("resolveSwarmMembers"),i=B(()=>o(n.tool.arg)),r=B(()=>Pa(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>s?.(n.tool.id)??[]),c=B(()=>zH(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>KH(a.value,c.value)),h=B(()=>{const E={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)E[F.phase]++;return E}),p=B(()=>f.value.length||i.value.itemCount||0),g=B(()=>h.value.completed+h.value.failed),b=B(()=>h.value.working+h.value.suspended+h.value.queued),v=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],m=B(()=>v.map(({phase:E,cls:F})=>({phase:E,count:h.value[E],cls:F})).filter(E=>E.count>0)),y=X(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(` +`).trim()),$=X(new Set);function N(E){const F=new Set($.value);F.has(E)?F.delete(E):F.add(E),$.value=F}function x(E){return $.value.has(E)}function I(E){return t(`tools.swarm.phase${E[0].toUpperCase()}${E.slice(1)}`)}return(E,F)=>(w(),T("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",YH,O(r.value),1),l.value?(w(),T("span",ZH,"·")):ae("",!0),l.value?(w(),T("span",QH,O(l.value),1)):ae("",!0),_("span",XH,[_("span",JH,[d.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),xe(Ve,{key:1,name:"close",size:"sm"})):(w(),xe(Td,{key:2,status:"running"}))]),g.value>0||p.value>0?(w(),T("span",eW,O(g.value)+" / "+O(p.value),1)):ae("",!0),e.tool.timing?(w(),T("span",tW,O(e.tool.timing),1)):ae("",!0)]),re(Ve,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,GH),Fn(_("div",nW,[_("div",oW,[_("div",sW,[_("span",iW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),T("span",rW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(w(),T("span",lW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),T("span",aW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(w(),T("div",cW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase,class:We(S.cls),style:Yt({flex:S.count})},null,6))),128))])):ae("",!0),m.value.length>1?(w(),T("div",uW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Je(O(I(S.phase))+" "+O(S.count),1)]))),128))])):ae("",!0)]),f.value.length>0?(w(!0),T(Pe,{key:0},ot(f.value,S=>(w(),T("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:L=>N(S.id)},[re(Td,{class:"row-dot",status:S.phase},null,8,["status"]),re(Xt,{text:S.name},{default:Ee(()=>[_("span",fW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),xe(Xt,{key:0,text:S.activity},{default:Ee(()=>[_("span",hW,O(S.activity),1)]),_:2},1032,["text"])):ae("",!0),_("span",pW,O(I(S.phase)),1),re(Ve,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,dW),Fn(_("div",{class:"member-body"},O(S.body),513),[[mi,x(S.id)]])],2))),128)):A.value?(w(),T("div",mW,O(A.value),1)):(w(),T("div",gW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),yW=ct(vW,[["__scopeId","data-v-4b58e128"]]);function kW(e){if(e.media&&e.status==="ok")return $H;const t=Da(e.name);return t==="edit"||t==="write"||t==="multi_edit"?_H:t==="task"?zP:t==="agentswarm"?yW:t==="askuserquestion"?fH:MH}const TA=Ze({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>kW(n.tool));return(i,r)=>(w(),xe(jo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function ir(e){if(e>=1024*1024)return`${bw(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):bw(t)}k`}return String(e)}function bw(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function bW(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function xm(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function xW(e){return!(e.tool.status==="ok"&&e.tool.media)}function wW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function _W(e){const t=xm(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(xW(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function SW(e){return xm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(` + +`)}function CW(e){const t=[];for(const n of xm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking** +> ${n.thinking.split(` +`).join(` +> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(` +`);t.push(`\`\`\` +[${n.tool.name}] +${o} +\`\`\``)}return t.join(` + +`)}function NA(e){return e.tool.id||`tool-${e.sourceIndex}`}function AW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?NA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const MW=["aria-expanded"],EW={class:"tg-title"},TW={class:"tg-meta"},NW=["inert"],IW={class:"tool-group-body-inner"},LW=Ze({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=X(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=B(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Kt("pinScroll",()=>{}),d=X(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(w(),T("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[re(Td,{status:r.value},null,8,["status"]),re(Ve,{class:"tg-ic",name:"list",size:"sm"}),_("span",EW,O(C(l)("tools.group.title",i.value)),1),_("span",TW,"· "+O(a.value),1),re(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,MW),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",IW,[(w(!0),T(Pe,null,ot(e.tools,(g,b)=>(w(),xe(TA,{key:C(NA)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(wW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,NW)],2))}}),$W=ct(LW,[["__scopeId","data-v-37eb334f"]]);var FW=Object.create,Hy=Object.defineProperty,OW=Object.getOwnPropertyDescriptor,IA=Object.getOwnPropertyNames,RW=Object.getPrototypeOf,BW=Object.prototype.hasOwnProperty,LA=(e,t)=>function(){return t||(0,e[IA(e)[0]])((t={exports:{}}).exports,t),t.exports},$A=e=>{let t={};for(var n in e)Hy(t,n,{get:e[n],enumerable:!0});return t},DW=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=IA(t),i=0,r=s.length,l;it[a]).bind(null,l),enumerable:!(o=OW(t,l))||o.enumerable});return e},FA=(e,t,n)=>(n=e!=null?FW(RW(e)):{},DW(Hy(n,"default",{value:e,enumerable:!0}),e));function PW(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function HW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function WW(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function zW(e,t,n){return(n.xhtmlOut?`
+`:`
+`)+`
+
    +`}function UW(){return`
+
+`}function qW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`
  • `}function jW(){return`
  • +`}function VW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` ↩︎`}function KW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=WW,e.renderer.rules.footnote_block_open=zW,e.renderer.rules.footnote_block_close=UW,e.renderer.rules.footnote_open=qW,e.renderer.rules.footnote_close=jW,e.renderer.rules.footnote_anchor=VW,e.renderer.rules.footnote_caption=HW,e.renderer.rules.footnote_anchor_name=PW;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,g=h.length;p0?h[p].count:1;for(let y=0;y?@[\]^_`{|}~-])/g;function QW(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos?@[\]^_`{|}~-])/g;function ez(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),oz=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),sz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),p0;const iz=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),rz=(p0=String.fromCodePoint)!==null&&p0!==void 0?p0:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function lz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=iz.get(e))!==null&&t!==void 0?t:e}var Ro;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ro||(Ro={}));const az=32;var bl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bl||(bl={}));function nv(e){return e>=Ro.ZERO&&e<=Ro.NINE}function cz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_F||e>=Ro.LOWER_A&&e<=Ro.LOWER_F}function uz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_Z||e>=Ro.LOWER_A&&e<=Ro.LOWER_Z||nv(e)}function dz(e){return e===Ro.EQUALS||uz(e)}var Oo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Oo||(Oo={}));var vl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vl||(vl={}));var fz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vl.Strict}startEntity(e){this.decodeMode=e,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Oo.EntityStart:return e.charCodeAt(t)===Ro.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(e,t));case Oo.NumericStart:return this.stateNumericStart(e,t);case Oo.NumericDecimal:return this.stateNumericDecimal(e,t);case Oo.NumericHex:return this.stateNumericHex(e,t);case Oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|az)===Ro.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t>14;for(;t>14,s!==0){if(i===Ro.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&bl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~bl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}};function OA(e){let t="";const n=new fz(e,o=>t+=rz(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function hz(e,t,n,o){const s=(t&bl.BRANCH_LENGTH)>>7,i=t&bl.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(co)l=a-1;else return e[a+s]}return-1}const pz=OA(oz);OA(sz);function Wy(e,t=vl.Legacy){return pz(e,t)}var mz=FA(nz());const xw={};function gz(e){let t=xw[e];if(t)return t;t=xw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+91114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}wm.defaultChars=";/?:@&=+$,#";wm.componentChars="";var ov=wm;const ww={};function vz(e){let t=ww[e];if(t)return t;t=ww[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const o=vz(t);let s="";for(let i=0,r=e.length;i=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}_m.defaultChars=";/?:@&=+$,-_.!~*'()#";_m.componentChars="-_.!~*'()";var RA=_m;function zy(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function lp(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const yz=/^([a-z0-9.+-]+:)/i,kz=/:[0-9]*$/,bz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),wz=["'"].concat(xz),_w=["%","/","?",";","#"].concat(wz),Sw=["/","?","#"],_z=255,Cw=/^[+a-z0-9A-Z_-]{0,63}$/,Sz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Aw={javascript:!0,"javascript:":!0},Mw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Cz(e,t){if(e&&e instanceof lp)return e;const n=new lp;return n.parse(e,t),n}lp.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=bz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=yz.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&Aw[r])&&(i=i.substr(2),this.slashes=!0)),!Aw[r]&&(s||r&&!Mw[r])){let c=-1;for(let p=0;p127?m+="x":m+=v[y];if(!m.match(Cw)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(Sz);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>_z&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Mw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lp.prototype.parseHost=function(e){let t=kz.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Uy=Cz,BA=$A({decode:()=>ov,encode:()=>RA,format:()=>zy,parse:()=>Uy}),DA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PA=/[\0-\x1F\x7F-\x9F]/,Az=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,HA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Mz=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,WA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Ez=$A({Any:()=>DA,Cc:()=>PA,Cf:()=>Az,P:()=>HA,S:()=>Mz,Z:()=>WA}),Tz=Object.defineProperty,zA=e=>{let t={};for(var n in e)Tz(t,n,{get:e[n],enumerable:!0});return t},xo=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Nz=zA({arrayReplaceAt:()=>Bz,assign:()=>Oz,countLines:()=>so,escapeHtml:()=>Vz,escapeRE:()=>Gz,fromCodePoint:()=>Id,has:()=>Fz,isMdAsciiPunct:()=>up,isPunctChar:()=>cp,isPunctCode:()=>sv,isSpace:()=>Rz,isString:()=>Lz,isValidEntityCode:()=>Cm,isWhiteSpace:()=>Nd,lib:()=>Yz,mdurl:()=>BA,normalizeReference:()=>Sm,ucmicro:()=>ap,unescapeAll:()=>Ld,unescapeMd:()=>Wz});const ap=Ez;function Iz(e){return Object.prototype.toString.call(e)}function Lz(e){return Iz(e)==="[object String]"}const $z=Object.prototype.hasOwnProperty;function Fz(e,t){return $z.call(e,t)}function Oz(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function Rz(e){return e===9||e===32}function Nd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function cp(e){return ap.P.test(e)||ap.S.test(e)}const Ew=new Map;function sv(e){if(up(e))return!0;const t=Ew.get(e);if(t!==void 0)return t;const n=cp(String.fromCharCode(e));return Ew.set(e,n),n}function up(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Sm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Bz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Cm(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Id(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const UA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Dz=new RegExp(`${UA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Pz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Hz(e,t){if(t.charCodeAt(0)===35&&Pz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Cm(o)?Id(o):e}const n=Wy(e);return n!==e?n:e}function Wz(e){return e.includes("\\")?e.replace(UA,"$1"):e}function Ld(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Dz,(t,n,o)=>n||Hz(t,o))}const zz=/[&<>"]/,Uz=/[&<>"]/g,qz={"&":"&","<":"<",">":">",'"':"""};function jz(e){return qz[e]}function Vz(e){return zz.test(e)?e.replace(Uz,jz):e}const Kz=/[.?*+^$[\]\\(){}|-]/g;function Gz(e){return e.replace(Kz,"\\$&")}const Yz={mdurl:BA,ucmicro:ap};function so(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Zz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Qz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Xz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,qy=["references","footnotes","abbreviations","abbr","abbrs"],jy=Symbol.for("markdown-it-ts.global-state"),Vy=Object.prototype.hasOwnProperty;function Tw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Cl(e){if(Array.isArray(e))return e.map(t=>Cl(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=Cl(e[n]);return t}return e}function dp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function iv(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ni.has(r)?!iv(s[r],qA(o.value,r)):!0)}}function zr(e){const t=Ky(e);if(t){for(const n of qy){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){eU(e,n,o);continue}o.existed?e[n]=Jz(e[n],o.value):delete e[n]}delete e[jy]}}const rv=Symbol.for("markdown-it-ts.diagnostics");function Am(e,t){if(e)try{const n=e[rv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[rv]=o,o}catch{return}}function _r(e){return Am(e,!1)}function nU(e){if(e)try{const t=e[rv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function us(e){nU(e)}function yo(e,t){const n=Am(e,!0);n&&(n.strategy=t)}function m0(e,t){const n=Am(e,!0);n&&(n.chunk=t)}function jA(e,t){const n=Am(e,!0);n&&(n.unbounded=t)}function oU(e){const t={};e=e||{},t.src_Any=DA.source,t.src_Cc=PA.source,t.src_Z=WA.source,t.src_P=HA.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function lv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Mm(e){return Object.prototype.toString.call(e)}function sU(e){return Mm(e)==="[object String]"}function iU(e){return Mm(e)==="[object Object]"}function rU(e){return Mm(e)==="[object RegExp]"}function Nw(e){return Mm(e)==="[object Function]"}function lU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const VA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function aU(e){return Object.keys(e||{}).reduce(function(t,n){return t||VA.hasOwnProperty(n)},!1)}const cU={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},uU="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",dU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function fU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Iw(){return function(e,t){t.normalize(e)}}function fp(e){const t=e.re=oU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(uU),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,iU(a)){rU(a.validate)?c.validate=fU(a.validate):Nw(a.validate)?c.validate=a.validate:i(l,a),Nw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Iw();return}if(sU(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Iw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(lU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function KA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||aU(e)&&(t=e,e={}),this.__opts__=lv({},VA,t),this.__schemas__=lv({},cU,e),this.__compiled__={},this.__tlds__=dU,this.__tlds_replaced__=!1,this.re={},fp(this)}ei.prototype.add=function(t,n){return this.__schemas__[t]=n,fp(this),this};ei.prototype.set=function(t){return this.__opts__=lv(this.__opts__,t),this};ei.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ei.prototype.pretest=function(t){return this.re.pretest.test(t)};ei.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ei.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,b=Math.floor,v=String.fromCharCode;function m(D){throw new RangeError(p[D])}function y(D,z){const H=[];let U=D.length;for(;U--;)H[U]=z(D[U]);return H}function k(D,z){const H=D.split("@");let U="";H.length>1&&(U=H[0]+"@",D=H[1]),D=D.replace(h,".");const Z=y(D.split("."),z).join(".");return U+Z}function A(D){const z=[];let H=0;const U=D.length;for(;H=55296&&Z<=56319&&HString.fromCodePoint(...D),N=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},x=function(D,z){return D+22+75*(D<26)-((z!=0)<<5)},I=function(D,z,H){let U=0;for(D=H?b(D/700):D>>1,D+=b(D/z);D>g*26>>1;U+=36)D=b(D/g);return b(U+(g+1)*D/(D+38))},E=function(D){const z=[],H=D.length;let U=0,Z=128,K=72,V=D.lastIndexOf("-");V<0&&(V=0);for(let J=0;J=128&&m("not-basic"),z.push(D.charCodeAt(J));for(let J=V>0?V+1:0;J=H&&m("invalid-input");const Se=N(D.charCodeAt(J++));Se>=36&&m("invalid-input"),Se>b((2147483647-U)/ce)&&m("overflow"),U+=Se*ce;const Te=ue<=K?1:ue>=K+26?26:ue-K;if(Seb(2147483647/Ae)&&m("overflow"),ce*=Ae}const oe=z.length+1;K=I(U-fe,oe,fe==0),b(U/oe)>2147483647-Z&&m("overflow"),Z+=b(U/oe),U%=oe,z.splice(U++,0,Z)}return String.fromCodePoint(...z)},F=function(D){const z=[];D=A(D);const H=D.length;let U=128,Z=0,K=72;for(const fe of D)fe<128&&z.push(v(fe));const V=z.length;let J=V;for(V&&z.push("-");J=U&&ceb((2147483647-Z)/oe)&&m("overflow"),Z+=(fe-U)*oe,U=fe;for(const ce of D)if(ce2147483647&&m("overflow"),ce===U){let ue=Z;for(let Se=36;;Se+=36){const Te=Se<=K?1:Se>=K+26?26:Se-K;if(ue32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Ld(e.slice(t,s)),i.pos=s,i.ok=!0),i}var ZA=Zy;const bh=-2;function pU(e,t,n,o){let s=1,i=t+1;for(;i=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=pU(l,t,a,n);if(f!==bh)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i=0?e.attrs[n][1]:null}function vU(e,t,n){const o=Em(e,t);o<0?Jy(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var yU=zA({attrGet:()=>gU,attrIndex:()=>Em,attrJoin:()=>vU,attrPush:()=>Jy,attrSet:()=>mU,parseLinkDestination:()=>Zy,parseLinkLabel:()=>Qy,parseLinkTitle:()=>Xy});function kU(e){return e.includes("\r")||e.includes("\0")}function XA(e){return typeof e=="string"?e:e.toString()}function bU(e){if(e.inlineMode){const t=new xo("inline","",0);t.content=XA(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const xU=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,wU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function _U(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(wU.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(xU.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var SU=_U;function CU(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var AU=CU;function Lw(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;ra;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function MU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lw(e.delimiters);for(let o=0;o=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function NU(e){const t=e.tokens_meta,n=e.tokens_meta.length;$w(e,e.delimiters);for(let o=0;o=48&&e<=57}function IU(e){const t=e|32;return ek(e)||t>=97&&t<=102}function e6(e){const t=e|32;return t>=97&&t<=122}function LU(e){return e6(e)||ek(e)}function $U(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function FU(e,t,n){let o=t+1;if(o>=n||!e6(e.charCodeAt(o)))return null;for(o++;o=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return JA(s)!==s?s:null}function OU(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=$U(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=Cm(i)?Id(i):Id(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=FU(e.src,n,o);if(s){const i=JA(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var RU=OU;const t6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),av=new Array(128),n6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);av[e]=`\\${t}`,n6[e]=t6[e]?t:av[e]}function Ow(e,t,n){e.pending&&e.pushPending();const o=new xo("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function BU(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Ow(e,i<256&&t6[i]?r:l,l),e.pos=n+1,!0}var DU=BU;function PU(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t0&&o++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,s6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",WU=new RegExp(`^(?:${o6}|${s6}||<\\?[\\s\\S]*?\\?>|]*>|)`),zU=new RegExp(`^(?:${o6}|${s6})`);function i6(e){return e===32||e===9||e===10||e===12||e===13}function UU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||i6(t)}function qU(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function VU(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!jU(i))return!1;const r=s.slice(o).match(WU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,UU(l)&&e.linkLevel++,qU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var KU=VU;function GU(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=hp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i=f)return!1;if(l=ZA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[Sm(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var YU=GU;function ZU(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=hp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p=d)return!1;if(s=ZA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[Sm(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var QU=ZU;function r6(e){const t=e|32;return t>=97&&t<=122}function XU(e){return e>=48&&e<=57}function JU(e){return r6(e)||XU(e)||e===43||e===45||e===46}function eq(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&JU(e.charCodeAt(t));)t--;return t++,t>=e.length||!r6(e.charCodeAt(t))?null:e.slice(t)}function tq(e,t,n){let o=t;for(;o0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=eq(e.pending);if(!s)return!1;const i=tq(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function oq(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=s||Dw(n.charCodeAt(o)))return!1;let i=o+1;for(;io-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function uq(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function l6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:tk(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Hc(e,t,n,o,s,i){const r=l6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=uq(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=tk()}function dq(e){const t=l6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;os.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},a6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new xo("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new xo(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new xo(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i0?n.charCodeAt(e-1):32,a=i@[\]\\^_`{}~]/;function c6(e){return!fq.test(e)}var hq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Pw,this.ruler2=new Pw,this.ruler.push("text",aq),this.ruler.push("linkify",nq),this.ruler.push("newline",sq),this.ruler.push("escape",DU),this.ruler.push("backticks",AU),this.ruler.push("strikethrough",Bw.tokenize),this.ruler.push("emphasis",Fw.tokenize),this.ruler.push("link",QU),this.ruler.push("image",YU),this.ruler.push("autolink",SU),this.ruler.push("html_inline",KU),this.ruler.push("entity",RU),this.ruler2.push("balance_pairs",EU),this.ruler2.push("strikethrough",Bw.postProcess),this.ruler2.push("emphasis",Fw.postProcess),this.ruler2.push("fragments_join",HU),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&c6(e)){const a=new xo("text","",0);a.content=e,o.push(a);return}const s=new a6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a0&&c6(i.content)){const r=new xo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const mq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,gq=/[0-9a-z]/i;function vq(e){return/^\s]/i.test(e)}function yq(e){return/^<\/a\s*>/i.test(e)}function kq(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(vq(l.content)&&i>0&&i--,yq(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>kq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;hf){const A=new xo("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new xo("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new xo("text","",0);y.content=b,y.level=d,u.push(y);const k=new xo("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(Cq,Mq)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Tq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&u6.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Nq(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");Sq.test(o)&&Eq(n.children||[]),u6.test(o)&&Tq(n.children||[])}}var Iq=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Lq=/['"]/,Hw=/['"]/g,Ww="’";function qf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function $q(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=qf(r.content,d.index,Ww));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!Lq.test(o)||!n.children||$q(n.children,e)}}function Oq(e){const t=e.tokens||[],n=t.length;for(let o=0;o=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k=d)break;if(s.charCodeAt(u++)===62&&!I){let F=a[k]+1,S,L;s.charCodeAt(u)===32?(u++,F++,L=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,L=!1):L=!0):S=!1;let R=F;for(h.push(i[k]),i[k]=u;u=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=R-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let E=!1;for(let F=0,S=v.length;F";const N=[t,0];$.map=N,e.md.block.tokenize(e,t,k);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=m,N[1]=e.line;for(let I=0;I=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)} +`,i.map=[t,e.line],!0}function Wq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s=4)&&(s=e.skipChars(s,r),!(s-l=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a6||aa&&qw(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",zw[d],1);h.markup=Uw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",zw[d],-1);return g.markup=Uw[d],!0}function Uq(e){switch(e){case 9:case 32:return!0}return!1}function qq(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${zU.source}\\s*$`),/^$/,!1]];function jq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l=48&&e<=57}var m6=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;et;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;en;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,b=this.bsCount,v=this.tShift;for(;fn?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;dn?s[u]=new Array(f-n+1).join(" ")+i.slice(p,g):s[u]=i.slice(p,g)}return s.join("")}};m6.prototype.Token=xo;function Kq(e,t,n){for(let o=t;o=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:Kq(n,o,s)}const Vw=["","h1","h2"];function Gq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=g6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let N=k+1,x=N;for(;N=A){f=h===61?1:2;break}if(x-k>1)continue}if(a[p]<0||u&&!v6(e,p,s,k,A))continue;let $=!1;for(let N=0,x=o.length;Nk;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",Vw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",Vw[f],-1);return y.markup=b,e.parentType=d,!0}function y6(e){switch(e){case 9:case 32:return!0}return!1}function Kw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a0&&++s=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=Gw(e,l),f<0||(u=!0,r=y,d=Yq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=Kw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=$;let x=!1;const I=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l=s?D=1:D=L-S,D>4&&(D=1);const z=S+D,H=e.push("list_item_open","li",1);H.markup=$;const U=[l,0];H.map=U,u&&(H.info=f-r-1===1?Zq[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,K=e.tShift[l],V=e.sCount[l],J=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=z,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=L,R>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=J,e.tShift[l]=K,e.sCount[l]=V,e.tight=Z,e.push("list_item_close","li",-1).markup=$,l=e.line,U[1]=l,l>=n||e.sCount[l]=4)break;let fe=!1;for(let oe=0,ce=E.length;oe3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const y=r[f]+l[f],k=a[f];if(y=k||Yw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1=k){$=-1;break}const N=i.charCodeAt($++);if(N>=48&&N<=57){if($-y>=10){$=-1;break}continue}if((N===41||N===46)&&($>=k||Yw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!v6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y=4||e.src.charCodeAt(s)!==91)return!1;function a(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let I=!1;for(let E=0,F=l.length;E"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function g0(e){switch(e){case 9:case 32:return!0}return!1}const tj=65536;function v0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function nj(e,t){if(e.lineFlags)return(e.lineFlags[t]&td.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];nn)return!1;let s=t+1;if(e.sCount[s]=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!g0(l)||r===45&&g0(l)||!nj(e,t))return!1;for(;i=4)return!1;c=Zw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k=4||(c=Zw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>tj))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Hc(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Vf=[["table",oj,["paragraph","reference"]],["code",Hq],["fence",Wq,["paragraph","reference","blockquote","list"]],["blockquote",Pq,["paragraph","reference","blockquote","list"]],["hr",qq,["paragraph","reference","blockquote","list"]],["list",Xq,["paragraph","reference","blockquote"]],["reference",ej],["html_block",jq,["paragraph","reference","blockquote"]],["heading",zq,["paragraph","reference","blockquote"]],["lheading",Gq],["paragraph",Jq]];var ij=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new sj;for(let e=0;e=a[u];)u++;if(e.line=u,u>=n||c[u]=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u=a[u];)u++;if(e.line=u,u>=n||c[u]=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new m6(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},k6=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};k6.prototype.Token=xo;const Qw=[["normalize",_q],["block",bU],["inline",pq],["linkify",bq],["replacements",Nq],["smartquotes",Fq],["text_join",Oq]],rj={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},lj={parseLinkLabel:Qy,parseLinkDestination:Zy,parseLinkTitle:Xy};function aj(){return{...rj}}function cj(){return{...lj}}var uj=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new ij,this.inline=new hq,this.ruler=new Iq;for(let e=0;e@[\]\\^_`{}~]/;function pp(e){return!dj.test(e)}function qu(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function xh(e,t,n){for(let o=t;o3)return pp(e);for(let t=0;t=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!pp(u))return!1;const d=hj[i],f=pj[i],h=Vs("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(b6(u,s,1));const p=Vs("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function gj(e,t,n){const o=Vs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(b6(t,n,1)),e.push(Vs("paragraph_close","p",-1,0))}function vj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function x0(e,t){for(;t=1e5?Jw:b0,o="",s=!1,i=!1,r=0,l=0;for(;r"]/,e_=/[&<>"]/g,Sj=/&/g,Cj=/[<>"]/g,Aj={"&":"&","<":"<",">":">",'"':"""};function w0(e){return Aj[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return _j.test(e)?e.replace(e_,w0):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(Sj,"&"):t?e.replace(e_,w0):e.replace(Cj,w0)}const Mj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ej=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function x6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Mj,(t,n,o)=>{if(n)return n;if(Ej.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Cm(i)?Id(i):"�"}const s=Wy(t);return s!==t?s:t})}const Tj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Nj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Ij=/"/g;function Cc(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function mp(e,t,n){for(let o=t;o=e.length||e.charCodeAt(t)===10?!1:!mp(e,t,Cc(e,t))}function t_(e,t,n){return t+2=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;ii&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=nk(e.slice(i,r));return a===null?null:`${a} +`}function n_(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • +`}function Rj(e,t,n){const o=t+2;if(n===o+1)return Oj(e,o);const s=nk(e.slice(t+2,n));return s===null?null:`
  • ${s}
  • +`}function Bj(e,t,n){for(;tt;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s`:"
    ",o.lang=s,o.open=u),{html:`${u}${$n(c)}
    +`,nextPos:a=25e4,s=[],i={lang:"",open:"
    "};let r="",l="",a="",c="";for(;t
    +`;y
    +`,r=b,l=v}let m=Kf(e,g);for(;m${g}

    +`,a=f,c=h}const p=ue.core.parse(t,n,e).tokens);let r=wh(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Uj(r,s.maxChunks)),_h(t,r))return m0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Pc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return m0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Pc(n,i,()=>{for(let c=0;c=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function _h(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;se.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function zj(e,t){for(let n=0;n=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function sl(e){return e.length===0?0:so(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Zj(e,t,n){for(let o=t;o=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function Xj(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return Zj(e,n+1,e.length-1)?!Qj(e,t):!1}function Jj(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??Kj:e.options.fullChunkSizeChars??jj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Gj:e.options.fullChunkSizeLines??Vj);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Zd=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=sl(this.pending);if(this.pending.length=o||n>=s}function A6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??w6))return"yes";const o=e.options.autoUnboundedThresholdLines??_6;return n!==void 0?n>=o?"yes":"no":t+1e.core.parse(t,n,e).tokens);const i=[],r=new Zd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){S6(i,l)}});if(s&&Gy(n,s),r.feed(t),r.flushForce(n),s&&(Yy(n),o.fallbackOnGlobalState===!1)){const l=_r(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Wc=(e,t,n)=>en?n:e;function M6(e){return e.experimental?{...e,...e.experimental}:e}const s_=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],i_=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function E6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function sV(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function r_(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var iV={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},rV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},lV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Tm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Sh(e,t){if(Tm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const l_=e=>Tm(e)?e:Promise.resolve(e);function od(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return $n(e)}}function $l(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${od(t[0])}="${$n(t[1])}"`;for(let o=1;o=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${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 vp(e){return!e.attrs||e.attrs.length===0?`${$n(e.content)}`:`${$n(e.content)}`}function cv(e){const t=$n(e.content);return e.attrs?`${t} +`:`
    ${t}
    +`}function aV(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 a_(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function cV(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 c_(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 yp(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 uV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Gf=Object.prototype.hasOwnProperty,Nn={code_inline(e,t){return vp(e[t])},code_block(e,t){return cv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?x6(i.info).trim():"",{langName:l,langAttrs:a}=T6(r),c=n.highlight,u=$n(i.content);if(!c)return sd(i,u,r,l,n);const d=c(i.content,l,a);return Tm(d)?d.then(f=>sd(i,f||u,r,l,n)):sd(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]],yp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`:`
    +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    +`:`
    +`:` +`},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function u_(e,t,n){const o=e.info?x6(e.info).trim():"",{langName:s,langAttrs:i}=T6(o),r=t.highlight,l=$n(e.content);if(!r)return sd(e,l,o,s,t);const a=r(e.content,s,i);if(Tm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return sd(e,a||l,o,s,t)}function Yf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Nn.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(s.text_special===Nn.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(s.softbreak===Nn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Nn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Nn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Nn.code_inline)return vp(l);break}const a=s[l.type];if(!a)return yp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Sh(c,l.type)}var dV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Nn}}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,h="",p="",g=!1,b="";for(let v=0;v0&&e[v-1].hidden?` +`:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3${this.renderInlineTokens(x.children||[],o,s)}`,v+=3;continue}}if(v+2 +`,v+=2;continue}}}if(y==="inline"){const N=m.children||[];if(N.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`
    +`:`
    +`,p=o.breaks?h:` +`,g=!0);const x=N[0];switch(x.type){case"text":if(l===Nn.text){b+=$n(x.content);continue}break;case"text_special":if(a===Nn.text_special){b+=$n(x.content);continue}break;case"softbreak":if(c===Nn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Nn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Nn.html_inline){b+=x.content;continue}break;case"code_inline":if(f===Nn.code_inline){b+=vp(x);continue}break}}b+=this.renderInlineTokens(N,o,s);continue}const A=i[y];if(!A){const N=m.attrs;if(!m.hidden){if(!N||N.length===0)switch(y){case"hr":b+=r?`


    +`:`
    +`;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=` +`;continue;case"paragraph_open":b+=`${k}

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

    +`;continue;case"list_item_open":{const x=e[v+1];b+=k+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"
  • ":`
  • +`);continue}case"list_item_close":b+=`
  • +`;continue;case"bullet_list_open":b+=`${k}
      +`;continue;case"bullet_list_close":b+=`
    +`;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"
    ":`
    +`);continue;case"blockquote_close":b+=`
    +`;continue;case"ordered_list_open":b+=`${k}
      +`;continue;case"ordered_list_close":b+=`
    +`;continue;case"table_open":b+=`${k} +`;continue;case"table_close":b+=`
    +`;continue;case"thead_open":b+=`${k} +`;continue;case"thead_close":b+=` +`;continue;case"tbody_open":b+=`${k} +`;continue;case"tbody_close":b+=` +`;continue;case"tr_open":b+=`${k} +`;continue;case"tr_close":b+=` +`;continue;case"td_open":b+=`${k}`;continue;case"td_close":b+=` +`;continue;case"th_open":b+=`${k}`;continue;case"th_close":b+=` +`;continue}else if(N.length===1){const x=N[0];if(y==="ordered_list_open"&&x[0]==="start"){b+=`${k}
      +`;continue}if(y==="td_open"&&x[0]==="style"){b+=`${k}`;continue}if(y==="th_open"&&x[0]==="style"){b+=`${k}`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Nn.code_block){b+=cv(m);continue}if(y==="fence"&&A===Nn.fence){b+=u_(m,o);continue}if(y==="html_block"&&A===Nn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=Sh($,m.type)}return b}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 i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}(n||(n={...t}),n);if(Gf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Gf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Gf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Gf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...uV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Nn.code_block)return cv(t);if(i==="html_block"&&s.html_block===Nn.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):yp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Nn.fence)return u_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Sh(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`
      +`:`
      +`,m=t.breaks?v:` +`;if(e.length===1)return Yf(e,t,n,this,o,v,m);let y="";for(let k=0;k`;if(r===Nn.softbreak&&k+3`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2${Yf([x],t,n,this,o,v,m)}`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2${Yf([x],t,n,this,o,v,m)}`,k+=2;continue}}switch(A.type){case"text":if(s===Nn.text){const x=A.content.length===0?"":$n(A.content);if(a===Nn.html_inline&&k+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=Te,!le&&Ae!==void 0&&(P=so(e),le=P>=Ae)),le){const q=this.parseFullDocument(e,L,n,P,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_r(L)?.unbounded}),q.tokens}else if(U){const q=(pe,Ce,$e)=>pe$e?$e:pe;P===void 0&&(P=so(e));const ee=ce&&!oe?r_(e.length,P,n.options):null,ge=ee?.maxChunkChars??(Z?q(Math.ceil(e.length/K),8e3,64e3):V??1e4),de=ee?.maxChunkLines??(Z?q(Math.ceil(P/K),150,700):J??200),ve=ee?.maxChunks??(Z?q(Math.ceil(e.length/64e3),K,32):fe),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=H&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ee?.strategy!=="plain";if((z||te)&&(e.length>=ge*2||P>=de*2)&&j){const pe=gp(n,e,L,{maxChunkChars:ge,maxChunkLines:de,fenceAware:ee?.fenceAware??ue,maxChunks:ve});return this.cache={src:e,tokens:pe,env:L,lineCount:P,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,P),this.recordChunkedParseResult(L,z?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const ne=this.parseFullDocument(e,L,n,P);return P=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:L,lineCount:P,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_r(L)?.unbounded}),ne.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",yo(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=Ts(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ts(e),a=r||l;if(a){const L=o??s.env;zr(L);const R=Ts(e),D=this.parseFullDocument(e,L,n),z=D.tokens,H=D.lineCount;return this.cache={src:e,tokens:z,env:L,lineCount:H,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!_r(L)?.unbounded}),z}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,L);let D=null;const z=n.options?.streamContextParseStrategy??"chars",H=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Z;const K=()=>(Z===void 0&&(Z=so(u)),Z),V=this.canDirectlyParseAppend(s),J=V&&this.shouldUseUnboundedAppend(e,s,u);let fe=!1;if(!V)switch(z){case"lines":fe=K()>=U;break;case"constructs":if(u.length>=H){fe=!0;break}if(pV(u)){fe=!0;break}fe=K()>=U;break;case"chars":default:fe=u.length>=H}if(R>0&&fe){const ue=this.getTailLines(s.src,R)+u;try{const Se=this.core.parse(ue,s.env,n).tokens,Te=Se.findIndex(Ae=>Ae.map&&typeof Ae.map[1]=="number"&&Ae.map[1]>R);if(Te!==-1){const Ae=Se.slice(Te),P=L-R;P!==0&&this.shiftTokenLines(Ae,P),D={tokens:Ae}}}catch{D=null}}else D=null;if(!D){const ue=L;if(J)D={tokens:nd(n,u,s.env,{mode:"stream"})},ue>0&&this.shiftTokenLines(D.tokens,ue);else{const Se=this.core.parse(u,s.env,n);ue>0&&this.shiftTokenLines(Se.tokens,ue),D=Se}}let oe=0;if(s.tokens.length>0&&D.tokens.length>0){const ue=s.tokens[s.tokens.length-1],Se=D.tokens[0];try{ue.type==="inline"&&Se.type==="inline"&&(Se.children&&Se.children.length>0&&(ue.children||(ue.children=[]),this.appendTokens(ue.children,Se.children)),ue.content=(ue.content||"")+(Se.content||""),oe=1)}catch{oe=0}}const ce=s.tokens.length;if(D.tokens.length>oe){const ue=s.tokens,Se=D.tokens,Te=Math.min(ue.length,Se.length-oe);let Ae=0;for(let P=Te;P>0;P--){let le=!0;for(let ne=0;ne0&&(oe+=Ae),Se.length>oe&&this.appendTokens(s.tokens,Se,oe)}if(s.src=e,s.globalStateReason=null,s.lineCount=L+(Z??K()),s.tokens.length>ce){const ue=this.getLastSegment(s.tokens,e,ce,s.tokens.length,e.length-u.length,L);ue?s.lastSegment=ue:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,J&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",yo(s.env,{area:"stream",path:J?"stream-unbounded-append":"stream-append",reason:J?"large-delta":"safe-append",unbounded:J}),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",yo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,I=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+so(u):void 0;if(v){E===void 0&&(E=so(e));const L=(K,V,J)=>KJ?J:K,R=x&&!N?r_(e.length,E,n.options):null,D=R?.maxChunkChars??(m?L(Math.ceil(e.length/y),8e3,64e3):k??1e4),z=R?.maxChunkLines??(m?L(Math.ceil(E/y),150,700):A??200),H=R?.maxChunks??(m?L(Math.ceil(e.length/64e3),y,32):$),U=e.length>0&&e.charCodeAt(e.length-1)===10,Z=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((g||Z)&&(e.length>=D*2||E>=z*2)&&U){const K=gp(n,e,d,{maxChunkChars:D,maxChunkLines:z,fenceAware:R?.fenceAware??I,maxChunks:H});return this.cache={src:e,tokens:K,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const F=this.parseFullDocument(e,d,n,E),S=F.tokens;return E=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_r(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=_r(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",yo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!_r(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",yo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ts(e);Yd(t)&&zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?A6(n,e.length,o):"no";if(r==="yes"){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?so(e):0)}}let l=o;if(r==="need-lines"&&(l=so(e),C6(n,e.length,l))){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?so(e):0),{tokens:Pc(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:so(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+so(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??hV}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s_0?n.slice(n.length-_0):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 h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="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 g=f+so(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,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(p.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??so(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+so(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,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 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=so(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 f_={default:rV,zero:lV,commonmark:iV};function yV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function kV(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 h_(e){return e.experimental?{...e,...e.experimental}:e}function ui(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 p_(e,t,n){for(let o=0;o=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=p_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=p_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=m_(i?.options,s,"fullChunkedFallback"),c=m_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new uj;let p=null;const g=()=>(p||(p=new fV(n)),p);let b=null;const v=()=>(b||(b=new vV(h)),b);let m=null;const y=()=>(m||(m=new GA),m),k=x=>!u&&!!d&&!kV(x,d),A=(x,I)=>o==="default"&&!u&&p===null&&f!==null&&x.parse===f&&k(x)&&!x.stream.enabled&&I<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,$=(x,I)=>o==="default"&&!u&&k(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&I<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,N={core:h,block:h.block,inline:h.inline,get linkify(){const x=y();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=g();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(x){const I=h_(x);return this.options={...this.options,...I},(ui(x,"fullChunkSizeChars")||ui(x,"fullChunkSizeLines")||ui(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(x,"streamChunkSizeChars")||ui(x,"streamChunkSizeLines")||ui(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(I),typeof I.stream=="boolean"&&(this.stream.enabled=I.stream,b&&(b.reset(),b.resetStats())),this},configure(x){const I=typeof x=="string"?f_[x]:x;if(!I)throw new Error("Wrong `markdown-it` preset, can't be empty");if(I.options&&this.set(I.options),I.components){const E=I.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(x,I){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const L of F){if(!L)continue;const R=L.enable(E,!0);for(let D=0;D!S.has(R));if(L.length)throw new Error(`Rules manager: invalid rule name ${L.join(", ")}`)}return this},disable(x,I){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const L of F){if(!L)continue;const R=L.disable(E,!0);for(let D=0;D!S.has(R));if(L.length)throw new Error(`Rules manager: invalid rule name ${L.join(", ")}`)}return this},use(x,...I){const E=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...I],S=x;return u=!0,E.apply(S,F),this},render(x,I){if(A(this,x.length)){I!==void 0&&us(I);const S=o_(x);if(S!==null)return I!==void 0&&yo(I,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=I??{},F=this.parse(x,E);return g().render(F,this.options,E)},async renderAsync(x,I){if(A(this,x.length)){I!==void 0&&us(I);const S=o_(x);if(S!==null)return I!==void 0&&yo(I,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=I??{},F=this.parse(x,E);return g().renderAsync(F,this.options,E)},renderIterable(x,I={}){const E=this.parseIterable(x,I);return g().render(E,this.options,I)},async renderAsyncIterable(x,I={}){const E=await this.parseAsyncIterable(x,I);return g().renderAsync(E,this.options,I)},renderInline(x,I={}){const E=this.parseInline(x,I);return g().render(E,this.options,I)},validateLink:f6,normalizeLink:h6,normalizeLinkText:p6,utils:Nz,helpers:{...yU},parse(x,I){if(typeof x!="string")throw new TypeError("Input data should be a String");if(I!==void 0&&us(I),$(this,x.length)){const L=wj(x);if(L!==null)return I!==void 0&&yo(I,{area:"parse",path:"stock-fast",reason:"stock-subset"}),L}const E=I??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const L=A6(this,x.length);if(L==="yes"){const R=nd(this,x,E);return yo(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}L==="need-lines"&&(F=so(x))}if(!this.stream.enabled){const L=x.length,R=this.options.autoTuneChunks!==!1,D=r,z=!a&&k(this),H=!!this.options.fullChunkedFallback,U=z&&L>=2e5;let Z;(H||U||F!==void 0)&&(Z=F??so(x));const K=(H||U)&&R&&!D?sV(L,Z,this.options):null;if(H||U){const V=Z??0;if(H?L>=(this.options.fullChunkThresholdChars??2e4)||V>=(this.options.fullChunkThresholdLines??400):U){if(K&&K.strategy!=="plain"){const J=gp(this,x,E,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return I&&g_(I,H?"explicit-full-chunk":"default-large-string"),J}if(H){const J=(le,ne,q)=>leq?q:le,fe=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,ce=J(Math.ceil(L/oe),8e3,64e3),ue=J(Math.ceil(V/oe),150,700),Se=fe?ce:this.options.fullChunkSizeChars??1e4,Te=fe?ue:this.options.fullChunkSizeLines??200,Ae=fe?J(Math.ceil(L/64e3),oe,32):this.options.fullChunkMaxChunks,P=gp(this,x,E,{maxChunkChars:Se,maxChunkLines:Te,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ae});return I&&g_(I,"explicit-full-chunk"),P}}}if(F!==void 0&&k(this)&&C6(this,L,Z??F)){const V=nd(this,x,E);return yo(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const S=Ts(x);return yo(I,{area:"parse",path:"plain",reason:"default-plain"}),Pc(E,S,()=>h.parse(x,E,this).tokens)},parseIterable(x,I={}){return us(I),eV(this,x,I)},parseAsyncIterable(x,I={}){return us(I),tV(this,x,I)},parseIterableToSink(x,I,E={}){return us(E),nV(this,x,I,E)},parseAsyncIterableToSink(x,I,E={}){return us(E),oV(this,x,I,E)},parseInline(x,I={}){if(typeof x!="string")throw new TypeError("Input data should be a String");us(I),Yd(I)&&zr(I);const E=h.createState(x,I,this);return E.inlineMode=!0,h.process(E),E.tokens}};if(N.stream={enabled:!!n.stream,parse(x,I){return N.stream.enabled?v().parse(x,I,N):N.parse(x,I??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const x=i.components;x.core?.rules&&N.core.ruler.enableOnly(x.core.rules),x.block?.rules&&N.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&N.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&N.inline.ruler2.enableOnly(x.inline2.rules)}return d=yV(N),f=N.parse,N}var xV=bV;const I6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],wV=["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"],L6=["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"],_V=["svg","g","path"],SV=["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"],CV=["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","srcdoc","ping"],AV=["action","data","href","src","srcset","poster","xlink:href","formaction"],MV=["script"],EV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ha=new Set(I6),TV=new Set(L6),$d=new Set([...I6,...wV,...L6,..._V]),$6=new Set([...$d,...SV]),NV=new Set(CV),IV=new Set(AV),Qd=new Set(MV),F6=new Set(EV);function O6(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 LV={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function R6(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 LV[String(s??"").toLowerCase()]??t})}const Zf=new Set(["http","https","mailto","tel"]),$V=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),sa=new Set(["http","https"]);function B6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function FV(e,t,n){if(!id(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function id(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function OV(e,t){return t==="href"||t==="xlink:href"?id(e,t)?Zf:sa:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sa:(id(e,t),Zf)}function Ca(e,t={}){const n=O6(R6(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=B6(n);return i?i==="file"?!FV(n,o,s):id(o,s)?$V.has(i):!OV(o,s).has(i):!1}function RV(e){const t=R6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=B6(O6(t).toLowerCase());return n==="http"||n==="https"}function BV(e,t={}){const n=String(e??"").trim();return n?Ca(n,t)?"":n:""}function v_(e){return BV(e,{tagName:"img",attrName:"src"})}function DV(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}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,h,p,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k=p||(m=f.bMarks[N]+f.tShift[N],y=f.eMarks[N],m=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a){e.use(DV,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,h;const p=d.indexOf("{"),g=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,g?.startsWith("{")){let A=0,$=-1;for(let N=0;N0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,N]of Object.entries(A)){const x=N!=null&&typeof N=="object";y.attrSet(`data-${$}`,x?JSON.stringify(N):String(N))}}catch{const A=PV(h);if(A)for(const[$,N]of Object.entries(A)){const x=N!=null&&typeof N=="object";y.attrSet(`data-${$}`,x?JSON.stringify(N):String(N))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;AA.trim().length>0)){let A=k.join(` +`);A.endsWith(` +`)||(A+=` +`),A.endsWith(` + +`)||(A+=` +`);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const N=[];i.md.block.parse(A,i.md,i.env,N),i.tokens.push(...N)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jn(e){let t=!1,n=!1;for(let o=0;o")return o}return-1}function Nm(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 WV=/^[a-z][a-z0-9_-]*$/;function y_(e){return WV.test(String(e??"").trim().toLowerCase())}function _i(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return y_(t)?t.toLowerCase():"";let n=1;for(;n]/.test(i)?"":y_(s)?s:""}function ru(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=_i(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function zV(...e){const t=new Set,n=[];for(const o of e)for(const s of ru(o))t.has(s)||(t.add(s),n.push(s));return n}function UV(e){const t=ru(e);return{key:t.join(","),tags:t}}function D6(e){return _i(e)}function qV(e,t){const n=String(e??""),o=_i(t);if(!o)return!1;const s=Gs(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 P6(e,t){const n=_i(t);return!!n&&!$d.has(n)&&!qV(e,n)}function jV(e,t){const n=String(e??""),o=_i(t);if(!o)return n;const s=Gs(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 H6=Ha,VV=$d,W6=new Set(TV);W6.delete("details");const KV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,GV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,uv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,YV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function kp(e){return(e.match(uv)?.[1]??"").toLowerCase()}function ok(e){return/^\s*<\s*\//.test(e)}function sk(e,t){return H6.has(t)||/\/\s*>\s*$/.test(e)}function ZV(e,t){let n=0;for(let o=0;o0&&n--;continue}sk(s,i)||n++}}return n}function k_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 XV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 bp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function JV(e){const t=e;return t.meta||(t.meta={}),t.meta}function S0(e,t,n){const o=JV(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function eK(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Gs(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(` +`),s=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Gs(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?kp(p):"");if(!(b&&t.has(b))){r(p);return}const v=ok(p),m=!v&&sk(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){S0(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let g=0,b=!0;for(const v of h.children){const m=bp(v),y=v.type==="html_inline"?kp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g0;continue}if(o.length&&typeof h.content=="string"){const p=bp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?` +`:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)S0(h.token,h.raw,h.inner)}function tK(e){return/^\s*<\s*[!?]/.test(e)}function nK(e){const t=new Set(VV);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 b_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function oK(e,t){let n=null;for(const i of e.matchAll(KV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();b_(l,t)&&Jn(e.slice(r))===-1&&(!n||r")&&(!n||i")&&(!n||i{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=_i(String(y??""));k&&p.add(k)}const b=nK(Array.from(p)),v=new Set(rK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||W6.has(y)}},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 h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=iK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}eK(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const N=String(y.content??y.raw??"");if(N){const x=h[$],I=`${String(x.content||"")} +${N}`,E=Jn(I),F=E===-1?null:k_(I,A,E+1);if(F){const S=I.slice(0,F.end),L=I.slice(F.end);x.content=S,x.loading=!1,h.splice(m,1),v.pop();const R=d(x,L)?[]:c(L,u(h,m,"paragraph"));R.length&&h.splice(m,0,...R),m--;continue}x.content=I,x.loading!==!1&&(x.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(tK(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&XV(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,N]=v[v.length-1],x=h[N];x.content=`${String(x.content||"")} +${k}`,x.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,N]=v[v.length-1],x=h[N];x.content=`${x.content||""} +${A}`,x.loading!==!1&&(x.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=N=>{let x=m.get(N);return x||(x=new RegExp(`<\\s*${N}\\b`,"i"),m.set(N,x)),x},A=N=>{let x=y.get(N);return x||(x=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),y.set(N,x)),x},$=[];for(let N=0;N0){const F=$[$.length-1],S=h[F.index],L=x.type==="html_block"?A(F.tag).exec(I):null;if(L){const z=L.index+L[0].length,H=I.slice(0,z),U=I.slice(z);S.content=`${String(S.content??"")} +${H}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:``,raw:``}),$.pop();const Z=d(S,U)?[]:c(U,u(h,N,"paragraph"));Z.length?h.splice(N,1,...Z):(h.splice(N,1),N--);continue}if(x.type!=="inline")continue;const R=Array.isArray(x.children)?x.children:[],D=ZV(R,F.tag);if(D!==-1){const z=R.slice(0,D+1),H=R.slice(D+1),U=z.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")} +${U}`,Array.isArray(S.children)&&S.children.push(...z),H.length){const Z=H.map(K=>String(K.content??K.raw??"")).join("");if(Z.trim()){const K=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(N,1),N--;else if(K.startsWith("<"))h.splice(N,1,{type:"html_block",content:K});else{const V=c(Z,u(h,N,"paragraph"));h.splice(N,1,...V)}}else h.splice(N,1),N--}else h.splice(N,1),N--;$.pop();continue}S.content=`${String(S.content??"")} +${I}`,Array.isArray(S.children)&&S.children.push(...R),h.splice(N,1),N--;continue}if(x.type!=="inline")continue;const E=Array.isArray(x.children)?x.children:[];for(const F of g)if((E.length?QV(E,F):k(F).test(I)&&!A(F).test(I)?1:0)>0){$.push({tag:F,index:N});break}}}{let m=0;for(let y=0;y0?m--:(h.splice(y,1),y--))}}for(let m=0;m/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){y.loading=!1;continue}if(g.has(x)){const D=String(y.content??""),z=Jn(D),H=z===-1?null:k_(D,x,z+1);y.loading=H?!1:y.loading!==void 0?y.loading:!0;const U=H?.start??-1,Z=H?H.end-H.start:0;if(U!==-1){const K=D.slice(0,U+Z);let V="";z!==-1&&z]+)))?/g;let E;for(;(E=I.exec(y.content||""))!==null;)E[1],E[2]||E[3]||E[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),L=S?S.index:-1,R=S?S[0].length:0;if(L!==-1){const D=F.slice(0,L+R),z=(F.slice(L+R)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:D,tag:x,loading:!1}],y.content=D,y.raw=D,z&&h.splice(m+1,0,z.startsWith("<")?{type:"html_block",content:z}:{type:"text",content:z,raw:z})}else y.children=[{type:"html_block",content:y.content,tag:x,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),I=y.children[1],E=String(I?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(I?.type==="html_inline"&&E===x)continue;p.has(x)?(y.children[0].loading=!0,y.children[0].tag=x,y.children.push({type:"html_inline",tag:x,loading:!0,content:``})):y.children=[{type:"html_block",loading:!0,tag:x,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(x))continue;y.children=[{type:"html_block",loading:!1,tag:x,content:y.children.map(I=>I.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const N=String($.content??k).match(YV)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(k)||H6.has(N)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function aK(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 cK(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&&!aK(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 z6=/\.([a-z0-9]{1,15})$/i,uK=/[_()[\]{}<>]/u,dK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,fK=/[?#@]/u,hK=/[\\/]/u,pK=/^[\p{L}\p{N}./\\-]+$/u,mK=/^[A-Za-z0-9-]{1,63}$/u,gK=/^xn--[a-z0-9-]{2,59}$/i,vK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,yK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,kK=/文件名\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,bK=/文件名\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,xK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,wK=new Set(["ai","md","py","rs","sh","zip"]),U6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),_K=new Set([...U6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),SK=new Set(["com","dev","io","page","site"]),CK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),AK=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"]);function Fd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function C0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Fd(n)?n:void 0}function x_(e,t){if(!Fd(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 w_(e){const t=Xd(e);return Fd(t)?t:void 0}function MK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function __(e,t){if(!Fd(t))return;const n=String(e??"").trim().split(/\s+/u).map(MK).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>xp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>xp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Fd(o)?o:void 0}function Hl(e,t=!1){let n;return{options(o){return t||o==null?x_(e,n):x_(e,C0(w_(o),__(o,n)))},remember(o){const s=w_(o);n=t?C0(n,s):C0(s,__(o,n))},reset(){n=void 0}}}function S_(e){return mK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function EK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return S_(n)||gK.test(n)?t.every(S_):!1}function q6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function TK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function NK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function j6(e,t,n){const o=TK(t);return q6(e)&&NK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Xd(e){const t=String(e??"");return{explicitFilename:kK.test(t),filename:bK.test(t),marketTicker:xK.test(t)}}function IK(e){return EK(e.split(/[\\/]/)[0]??"")}function LK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function $K(e){if(uK.test(e)||!pK.test(e))return!0;if(hK.test(e))return!IK(e);const t=e.replace(z6,"");return q6(t)?!0:t.split(".").filter(Boolean).some(LK)}function FK(e,t,n){if(!(n?_K:U6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?yK:vK).test(o)}function xp(e,t={}){if(!e||dK.test(e)||fK.test(e))return!1;const n=e.match(z6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return FK(e,o,t.marketTicker===!0)?!0:AK.has(o)?!wK.has(o)||t.filename?!0:$K(e):!!(t.explicitFilename&&SK.has(o)||t.filename&&CK.has(o))}const C_=["!"];function Ms(e){return{type:"text",content:e,raw:e}}function ia(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 ra(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 il(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 OK(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(Ms(t))}}function A_(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 BK(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 DK(e,t,n){let o="";for(let s=t+1;s{const n=t.tokens??[];for(let o=0;oo.type==="code_inline"))return e;const n=Xd(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&BK(s,b),p&&e.splice(i+1,0,Ms(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;ra[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(il(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;ia(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;ph[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(il(a,c,d)),ra(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];ia(a,2),a.push(il(r,l,!1)),ra(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o{const n=t.tokens??[];for(let o=0;o{const n=t.tokens??[];for(let o=0;o=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b{const n=t;try{const o=JK(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 M_(){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 E_(){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 T_(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 V6(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 A0(e){return V6(e)!==null}function K6(e){return/^:?-+:?$/.test(e.trim())}function GK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(K6)}function YK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function ZK(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(K6)&&YK(n)}function QK(e){return e==="|"||e==="|:"}function XK(e){const t=V6(e);return t!==null&&t.every(n=>!n.includes(":"))}function JK(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)&&A0(r);if(!t&&(r.includes(` +`)&&u.length===0&&A0(a)&&ZK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else if(r.includes(` +`)&&u.length===0&&A0(a)&&GK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else r.includes(` +`)&&u.length===0&&XK(a)&&QK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function eG(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 tG=eG;const nG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],wp=nG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),oG=/\\[a-z]+/i,G6="(?:\\\\|\\u0008)",sG=new RegExp(String.raw`${G6}(?:${wp})\s*\{[^}]+\}`,"i"),iG=new RegExp(String.raw`(?:${G6})?(?:${wp})\s*\{`,"i"),rG=/\\(?:text|frac|left|right|times)/,lG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,aG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,cG=/[A-Z]+\s*\([^)]+\)/i,uG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,dG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,fG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,hG={"\b":"\\b","\v":"\\v","\f":"\\f"};function pG(e){let t="";for(const n of e)t+=hG[n]??n;return t}function Ac(e){if(!e)return!1;const t=pG(e),n=t.trim();if(fG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=oG.test(t),s=sG.test(t),i=iG.test(t),r=rG.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=lG.test(t)&&!aG.test(t),c=cG.test(t),u=uG.test(n),d=dG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const Y6="__markstreamMathPluginApplied",dv=80,Z6=2e4,N_=Z6+4096;function Q6(e){return!!e[Y6]}function mG(e){e[Y6]=!0}const X6=["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"],gG=["cdot","mathbf{","partial","mu_{"],J6=X6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),eM="[ \r\b\f\v]",vG=new RegExp(`([^\\\\])(${gG.map(e=>e).join("|")})+`,"g"),yG=/span\{([^}]+)\}/,kG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,bG=/(^|[^\\])\\\r?\n/g,xG=/(^|[^\\])\\$/g,wG=new RegExp(`(${eM})|(${J6})\\b`,"g"),I_=new Map,L_=new Map;function _G(e){if(!e)return wG;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(`(${eM})|(${s})\\b`,"g");return I_.set(n,i),i}function SG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=L_.get(o);if(s)return s;const i=e?[wp,J6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),wp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return L_.set(o,r),r}const $_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function F_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function O_(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 rl(e,t){const n=t?.commands??X6,o=t?.escapeExclamation??!0,s=t?.commands==null,i=_G(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&$_[u]!==void 0)return`\\${$_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=SG(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(yG,"span\\{$1\\}").replace(kG,"\\operatorname{span}\\{$1\\}"),l=l.replace(bG,`$1\\\\ +`),l=l.replace(xG,"$1\\\\"),l=l.replace(vG,"$1\\$2"),l}function R_(e){const t=e.trim();return!(!Ac(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 tM(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 fv(e,t){let n=t;for(;n0&&e[o-1]==="$"||o+1=l)break;const c=_p(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Jd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function ik(e,t,n){const o=Rd(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Rd(o.slice(0,s)).trim()||Jd(o,s))return-1;const i=tM(o);if(_p(i,s))return-1;const r=B_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>B_(o,n,0,s,i))return-1;return s}function Od(e){return e===" "||e===" "}function Rd(e){let t=e.length;for(;t>0&&Od(e[t-1]);)t--;return e.slice(0,t)}function D_(e){let t=0;for(let n=0;n=48&&t<=57}function AG(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 MG(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 EG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(MG)}function TG(e){let t=0;if(!P_(e[t]))return!1;for(;P_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Od(e[t+1])}function nM(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&&Od(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Od(t[1])||TG(t)||AG(t)||EG(t))}function H_(e,t){return e?t?`${e} +${t}`:e:t}function hv(e){const t=String(e??"").trim();return t?Ac(t):!1}function W_(e){let t=0;for(let n=0;ndv){h=!0;break}const g=s[p],b=ju(g,u);if(b!==-1){const v=H_(f,g.slice(0,b));if(!hv(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${W_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,W_(v),y].join(":")}if(nM(g)){h=!0;break}if(f=H_(f,g),f.length>Z6){h=!0;break}}if(!h&&hv(f))return["pending",c,o+l,d].join(":")}}return null}function E0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function IG(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 T0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function LG(e,t){mG(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=(m,y)=>{let k=y;for(;k=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=tM(k),$=CG(k,u);let N=!1;m==="$$"&&g!==v&&(g=v);let x=-1,I=-1,E=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let D=0;for(;D0&&S[z-1]==="$"||z+10){const H=S.slice(0,L),U=a.push("text","",0);U.content=H,a.pos=a.pos+H.length,g=a.pos}const D=S.slice(L).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,H,U]=D,Z=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=Z?Z[1]:U,V=Z&&Z[2]?Z[2]:null,J=a.push("image","img",0);J.attrs=[["src",K],["alt",H]],V&&J.attrs.push(["title",V]),J.content=H,J.children=[{type:"text",content:H,tag:""}],a.pos=a.pos+D[0].length,g=a.pos;const fe=S.slice(L+D[0].length);fe&&F(fe);return}const z=a.push("text","",0);z.content=S,a.pos=a.pos+S.length,g=a.pos;return}const R=a.push("text","",0);R.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(Jd(k,S)){g=S+Math.max(1,m.length);continue}const L=_p(A,S);if(L){g=L[1];continue}const R=_p($,S);if(R){g=R[1];continue}if(S===x&&g===I){if(E++,E>2){g=S+Math.max(1,m.length);continue}}else E=0,x=S,I=g;if(m==="("&&S>0){let fe=S-1;for(;fe>=0&&k[fe]===" ";)fe--;if(fe>=0&&k[fe]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S=k.length);){const L=fv(k,S);if(L===-1)break;if(L+10&&k[L-1]==="$"){S=L+1;continue}const R=M0(k,L+1);if(R===-1)break;const D=k.slice(L+1,R),z=D.includes("`"),H=!D||!D.trim(),U=k[R+1],Z=E0(D,U),K=T0(D);if(!z&&!H&&!Z&&!K){const V=k.slice(g,L);V&&F(V);const J=a.push("math_inline","math",0);J.content=rl(D,t),J.markup="$",J.raw=`$${D}$`,J.loading=!1,g=R+1,S=R+1}else F("$"),S=L+1}S{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[V,J]of h)if(g.startsWith(V))if(V.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":m,E=x>=0?x:ju(g,m,N);if(!y&&E>v.length){const V=g.slice($+v.length,E),J=u.push("math_block","math",0);J.content=rl(V),J.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",J.map=[l,l+1],J.raw=`${v}${V}${I}`,J.block=!0,J.loading=!1,u.line=l+1;const fe=g.slice(E+I.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",L=!1,R="",D=l;const z=y?g:g===v?"":g.slice(v.length),H=!f&&v==="\\["?"]":"",U=ju(z,m);if(U!==-1){const V=U;S=z.slice(0,V),R=z.slice(V+m.length),D=y?l+1:l,L=!0,F=D}else for(z&&!y&&(S=z),F=l+1;F{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 $G(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??""))}
      `})}function FG(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 xV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ca(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&LG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&HV(i),e.enableFixIndentedCodeBlock!==!1&&cK(i),PK(i),UK(i),WK(i),KK(i),$G(i),lK(i,{customHtmlTags:e.customHtmlTags}),i}function Aa(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=>Aa(n))),t}function OG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function RG(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 BG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Qf(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;in.startsWith(t)||t.startsWith(n)):!1}function U_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function HG(e,t){const n=[],o=[],s=[],i=[],r=e.split(DG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!iM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{U_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||i.length>0)&&U_(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 rk(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,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(z_.test(a)&&(a=a.replace(z_,"")),r){const{original:c,updated:u}=HG(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 WG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function zG(){return{type:"hardbreak",raw:`\\ +`}}function UG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i\s*$/.test(t)||Ha.has(e)}function qG(e){if(!e||e.length===0)return q_();const t=I0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=q_();return I0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:$m({customHtmlTags:e})};return I0.set(e,o),o}function cM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function jG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Sp(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 VG(e,t,n){const o=e.slice();return Sp(o,"href")||o.push(["href",t]),n!=null&&!Sp(o,"title")&&o.push(["title",n]),o}function pv(e){return e.map(cM).join("")}function Ch(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:Ch(o.children)});continue}t.push(o)}return t}function KG(e,t,n){let o=0;for(let s=t;s`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=jG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?pv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function uM(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=>uM(t)).join(""):String(e.content??"")}function YG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>uM(t)).join("")}function j_(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=YG(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 ZG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function QG(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 JG(e,t,n){const o=e.slice();return Cp(o,"href")||o.push(["href",t]),n!=null&&!Cp(o,"title")&&o.push(["title",n]),o}function Xf(e,t,n){const o=e[t],s=XG(o.attrs),i=String(Cp(s,"href")??""),r=Cp(s,"title"),l=r==null?null:String(r),a=JG(s,i,l);let c=t+1;const u=[];let d=!0;for(;cb.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=Aa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=eo(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${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?@[\\\]^_`{|}~]/,fY=/\p{P}/u,hY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,pY=/:\/\//;function mY(e){let t=0,n=0;for(;n=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Fl(e){return!!e&&uY.test(e)}function Ol(e){return!!e&&(dY.test(e)||fY.test(e))}function gY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function vY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function yY(e,t,n=0){let o=n,s=!1;for(;o0?e[t-1]:void 0,o=e[t+2];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function bY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function xY(e,t=0){let n=t,o=!1;for(;n=0&&e[i]==="\\";i--)s++;return s%2===1}const CY=/[\p{L}\p{N}]/u,AY=/^[\p{L}\p{N}]+$/u;function mv(e){return e?CY.test(e):!1}function fM(e){return e?AY.test(e):!1}function rd(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 NY(e){return e?hY.test(e)||pY.test(e):!1}function IY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Xd(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 h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(P,le){const ne=e.length===1?t:String(le.content??""),q=[],ee=MY(P);if(ee!==-1){A(P.slice(0,ee),P.slice(0,ee));const de=P.slice(ee);return de&&(E({type:"text",content:de,raw:de}),u--),u++,!0}if(rY.test(P)){const de=P.indexOf("~~");de!==-1&&q.push({type:"strikethrough",index:de})}if(lY.test(P)){const de=P.indexOf("**");de!==-1&&q.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(P)){const de=ne?dM(ne,0):P.indexOf("*");if(ne&&de===-1)return!1;de!==-1&&q.push({type:"emphasis",index:de})}q.sort((de,ve)=>de.index!==ve.index?de.index-ve.index:de.type===ve.type?0:de.type==="strong"?-1:ve.type==="strong"?1:0);const ge=q[0];if(!ge)return!1;if(ge.type==="strikethrough"){const de=ge.index,ve=de>-1?P.slice(0,de):"";if(ve&&A(ve,ve),de===-1)return u++,!0;const j=P.indexOf("~~",de+2),te=j===-1?P.slice(de+2):P.slice(de+2,j),pe=j===-1?"":P.slice(j+2),{node:Ce}=K_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ce),pe&&(E({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ge.type==="strong"){const de=ge.index,ve=de>-1?P.slice(0,de):"";if(ve&&A(ve,ve),de===-1)return u++,!0;if(t&&de===0){let De=!1,me=0;for(;me=2)return A(P,P),u++,!0}}if(t&&(P.match(/\*/g)||[]).length>mY(t))return A(P.slice(ve.length),P.slice(ve.length)),u++,!0;const j=rd(P,de);if(j.len>=3){const De=TY(P,de+j.len);if(De!==-1){const me=P.slice(de+j.len,De);if(EY(me)){const{node:Ie}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me,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);p(),k(Ie);const et=P.slice(De+3);return et&&(E({type:"text",content:et,raw:et}),u--),u++,!0}}}if(!kY(P,de)){const De=P.slice(de,de+j.len);A(De,De);const me=P.slice(de+j.len);return me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}const te=xY(P,de+2);let pe="",Ce="";if(te.index!==-1){pe=P.slice(de+2,te.index),Ce=P.slice(te.index+2);const De=te.index,me=rd(P,De);if(j.intraword&&me.intraword&&!fM(pe)||!pe&&j.len>=4&&j.intraword)return A(P.slice(ve.length),P.slice(ve.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return A(P.slice(ve.length),P.slice(ve.length)),u++,!0;pe=P.slice(de+2),Ce=""}if(!pe&&/^\*+$/.test(Ce))return A(P,P),u++,!0;const{node:$e}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k($e),Ce&&(E({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(ge.type==="emphasis"){let de=ge.index;de===-1&&(de=0);const ve=P.slice(0,de);if(ve&&A(ve,ve),!gY(P,de)){A(P[de],P[de]);const De=P.slice(de+1);return De&&(E({type:"text",content:De,raw:De}),u--),u++,!0}const j=rd(P,de),te=yY(ne,P,de+1),pe=te.index,Ce=e[u+1];if(o?.final&&Ce?.type==="em_open"&&pe!==-1&&P.slice(de+1,pe).trim()!==P.slice(de+1,pe)||pe===-1&&(te.sawInvalidClose||o?.final||j.intraword||!mv(P[de+1])))return A(P.slice(de),P.slice(de)),u++,!0;const{node:$e}=Qf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?P.slice(de+1,pe):P.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k($e),pe!==-1&&pe{for(let $e=0;$e=0&&Ce[me]==="\\";me--)De++;if(De%2===0)return $e}return-1})(P);if(q===-1)return!1;let ee=1;for(let Ce=q+1;Cege?.type==="math_inline")||!aY.test(P))return null;const ne=le.parseInline(P,{__markstreamFinal:!!o?.final});if(!Array.isArray(ne)||ne.length===0)return null;const q=(ne.find(ge=>ge?.type==="inline")?.children??[]).filter(ge=>!(ge?.type==="text"&&String(ge.content??"")===""));if(!q.length||!q.some(ge=>ge?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===P)return null;const ee=eo(q,P,n,o);return ee.length?ee:null}function m(P){p(),a.push(P)}function y(P){p();const le=Aa(P);a.push(le)}function k(P){m(P)}function A(P,le){c?(c.content+=P,c.raw+=le??P):(c={type:"text",content:String(P??""),raw:String(le??P??"")},a.push(c))}function $(P,le){if(!P)return;const ne=eo([{...le,type:"text",content:P,raw:P}],P,n,o);if(ne.length===1&&ne[0]?.type==="text"){const q=ne[0];A(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ne)k(q)}function N(P,le){return String(P.markup??"").startsWith(le)}function x(P){return P.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 I(P,le){let ne=P;const q=String(le.content??"");return ne.endsWith("\\")&&!N(le,"\\\\")&&!q.endsWith("\\\\")&&(ne=ne.slice(0,-1)),ne.endsWith("(")&&!N(le,"\\(")&&!q.endsWith("\\(")&&(ne=ne.slice(0,-1)),/\*+$/.test(ne)&&!N(le,"\\*")&&!q.endsWith("\\*")&&(ne=ne.replace(/\*+$/,"")),ne}for(;u=0;pe--){const Ce=a[pe];if(Ce.type!=="text")break;ge=pe,de=String(Ce.content??"")+de}geve==="href")?.[1],de=String(ge??"");if(t&&de){const ve=t.indexOf("](");if(ve!==-1){const j=t.indexOf(")",ve+2);j===-1?le.loading=!0:le.loading&&t.slice(ve+2,j).includes(de)&&(le.loading=!1)}}z(le)||m(le)}function R(P){if(P.markup!=="linkify")return!1;const{node:le,nextIndex:ne}=Xf(e,u,o);return U(le,ne)?(u=ne,!0):!1}function D(P){p(),k(eY(P)),u++}function z(P){if(P.type!=="link")return!1;const le=a[a.length-1];if(!le||le.type!=="text")return!1;const ne=String(le.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ne)return!1;const q=P,ee=String(q.href??""),ge=String(q.text??""),de=String(ne[2]??""),ve=ee.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ee||!(ge===ee||ge===ve||NY(ge)))return!1;const j=String(ne[1]??"");return j?(le.content=j,le.raw=j):a.pop(),m({...P,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${ee}${q.title?` "${q.title}"`:""})`}),!0}function H(P){if(P.type!=="link")return!1;const le=P,ne=String(le.href??"");return ne?U({href:ne,title:le.title==null||le.title===""?null:String(le.title),loading:!!le.loading},u+1):!1}function U(P,le){const ne=a[a.length-1];if(ne?.type!=="image"||ne.src||!ne.loading||!String(ne.raw??"").endsWith("]("))return!1;const q=e[le],ee=String(q?.content??"");if(q?.type!=="text"||!ee.startsWith(")"))return!1;a.pop(),c=null;const ge=String(ne.alt??"");m({type:"image",src:P.href,alt:ge,title:P.title,raw:`![${ge}](${P.href}${P.title?` "${P.title}"`:""})`,loading:!!P.loading});const de=ee.slice(1),ve=Aa(q);return ve.content=de,ve.raw=de,h()[le]=ve,!0}function Z(P){if(P.type!=="link")return!1;const le=a[a.length-1],ne=e[u-1];if(!le||le.type!=="text"||ne?.type!=="text")return!1;const q=String(le.content??""),ee=String(ne.content??"");if(!q.endsWith("!")||!ee.endsWith("!")||N(ne,"\\!"))return!1;const ge=q.slice(0,-1);ge?(le.content=ge,le.raw=ge,c=le):(a.pop(),c=null);const de=P,ve=String(de.text??de.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),j=String(de.href??""),te=de.title==null||de.title===""?null:String(de.title);return m({type:"image",src:j,alt:ve,title:te,raw:`![${ve}](${j}${te?` "${te}"`:""})`,loading:!!de.loading}),!0}function K(P,le="",ne=null){const q=String(P.alt??P.raw??"");return{type:"link",href:le,title:ne,text:q,children:[P],raw:`[${q}](${le}${ne?` "${ne}"`:""})`,loading:!0}}function V(P){const le=P.startsWith("![")?P:`![${P}`,ne=le.slice(2),q=ne.indexOf("](");return{type:"image",src:"",alt:q===-1?ne.replace(/\]$/,""):ne.slice(0,q),title:null,raw:le,loading:!0}}function J(P){const le=P.indexOf("[![");if(le===-1||typeof t=="string"&&e.length===1&&SY(t,le,"["))return!1;const ne=P.slice(0,le);return ne&&A(ne,ne),m(K(V(P.slice(le+1)))),u++,!0}function fe(P){if(o?.final)return!1;const le=e[u-1];if(le?.type!=="text"||!String(le.content??"").endsWith("[")||N(le,"\\["))return!1;const ne=a[a.length-1];if(ne?.type==="text"&&ne.content.endsWith("[")){const q=ne.content.slice(0,-1);q?(ne.content=q,ne.raw=q,c=ne):(a.pop(),c=null)}return m(K(j_(P))),u++,!0}function oe(P){if(P.type!=="link")return!1;const le=P,ne=String(le.raw??""),q=String(le.text??"");if(!ne.startsWith("[![")&&!q.startsWith("!["))return!1;const ee=le.title==null||le.title===""?null:String(le.title);return m(K({type:"image",src:String(le.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ee,raw:ne.startsWith("[![")?ne.slice(1):ne,loading:!0})),!0}function ce(P){if(!P.startsWith("]("))return!1;const le=e[u-2];if(le?.type==="text"&&String(le.content??"").endsWith("[")&&N(le,"\\["))return!1;const ne=a[a.length-1];if(ne?.type!=="image"&&ne?.type!=="link")return!1;const q=ne,ee=ne?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ge=ee?ee.children[0]:a.pop();if(!ge||ge.type!=="image")return!1;const de=e[u+1];let ve=String(ee?.href??""),j=ee?.title==null?null:String(ee.title),te=!0;if(de?.type==="link_open"){const{node:Ce,nextIndex:$e}=Xf(e,u+1,o);ve=Ce.href,j=Ce.title,te=!0,u=$e}else{if(ve=P.slice(2),ve.includes('"')){const Ce=ve.split('"');ve=String(Ce[0]??"").trim(),j=Ce[1]==null?null:String(Ce[1]).trim()}u++}const pe=K(ge,ve,j);return pe.loading=te,m(pe),!0}function ue(){const P=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&P?.type==="text"&&String(P.content??"").endsWith("[")&&N(P,"\\[")}function Se(P,le){const ne=P.indexOf("[");if(ne===-1)return!1;let q=P.slice(0,ne);const ee=P.indexOf("](",ne);if(ee!==-1){const ge=e[u+2];let de=P.slice(ne+1,ee);if(de.includes("[")){const De=de.indexOf("[");q+=P.slice(0,ne+De+1);const me=ne+De+1;de=P.slice(me+1,ee)}const ve=e[u+1];if(P.endsWith("](")&&ve?.type==="link_open"&&ge){const De=e[u+4];let me=4,Ie=!0;if(De?.type==="text"){const rt=String(De.content??"");if(rt.startsWith(")")){Ie=!1;const _t=rt.slice(1);if(_t){const gt=Aa(De);gt.content=_t,gt.raw=_t,h()[u+4]=gt}else me++}else rt==="."&&me++}$(q,le);const et=String(ge.content??"");return o?.validateLink&&!o.validateLink(et)?A(de,de):m({type:"link",href:et,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ie}),u+=me,!0}const j=P.indexOf(")",ee),te=j!==-1?P.slice(ee+2,j):"",pe=j===-1;let Ce=q.match(/\*+$/);if(Ce&&(q=q.replace(/\*+$/,"")),$(q,le),Ce||(Ce=de.match(/^\*+/)),!d&&Ce){const De=Ce[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const me=[];if(De===1?me.push({type:"em_open",tag:"em",nesting:1}):De===2?me.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(me.push({type:"strong_open",tag:"strong",nesting:1}),me.push({type:"em_open",tag:"em",nesting:1})),me.push({type:"link",href:te,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:pe}),De===1){me.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=Qf(me,0,o);k(Ie)}else if(De===2){me.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Fu(me,0,void 0,o);k(Ie)}else if(De===3){me.push({type:"em_close",tag:"em",nesting:-1}),me.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Fu(me,0,void 0,o);k(Ie)}else{const{node:Ie}=Qf(me,0,o);k(Ie)}}else o?.validateLink&&!o.validateLink(te)?A(de,de):m({type:"link",href:te,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:pe});const $e=j!==-1?P.slice(j+1):"";return $e&&(E({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function Te(P){const le=P.indexOf("![");if(le===-1)return!1;const ne=P.slice(0,le);return ne&&!c?c={type:"text",content:ne,raw:ne}:ne&&c&&(c.content+=ne),c&&(a.push(c),c=null),m(V(P.slice(le))),u++,!0}function Ae(P){if(!(P?.startsWith("[")&&n?.type==="list_item_open"))return!1;const le=P.slice(1).match(/[^\s\]]/);if(le===null)return u++,!0;if(le&&/x/i.test(le[0])){const ne=le[0]==="x"||le[0]==="X";return m({type:"checkbox_input",checked:ne,raw:ne?"[x]":"[ ]"}),u++,!0}return!1}return a}function LY(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 $Y(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 FY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function lu(e,t,n){const o=e[t],s=[],i=Hl(n,!0);let r=t+1;for(;rc.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(` +`)},r+1]}function OY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Hl(o,!0);let a=t+1;for(;ac.raw).join(` +`)} +:::`},a+1]}const RY=new Set(["warning","info","note","tip","danger","caution"]);function BY(e){let t=0;for(;t=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=lu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=au(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Im(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 PY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function HY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=PY.exec(String(o.info??""));return s?OY(e,t,s,n):null}const ak={parseContainer:(e,t,n)=>DY(e,t,n),matchAdmonition:HY};function au(e,t,n){const o=[],s=Hl(n,!0);let i=t+1;for(;ir.raw).join(` +`)},i+1]}function WY(e){if(e.info?.startsWith("diff"))return rk(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 zY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Hl(n,!0);for(;sc.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(` +`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(` +`)},s+1]}function UY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Hl(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function qY(e,t,n){const o=e[t],s=o.attrs,i=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,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:eo(a.children||[],c,void 0,n),raw:c}}function jY(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${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-1}function hM(e){const t=String(e.content??"");if(/^\s*",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(nn){const a=e.slice(n,o);cS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function QZ(e){const t=[];let n=0;for(;n",n);if(f!==-1){n=f+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 f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function XZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${yl(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${yl(o)}`:` ${yl(o)}="${_M(s)}"`).join("");return e.type==="self_closing"?`<${yl(t)}${n} />`:`<${yl(t)}${n}>`}function JZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;iS.lastIndex=0;let n;for(;(n=iS.exec(e))!==null;)if(MM(n[1],t))return!0;return!1}function zc(e,t="safe"){if(!e)return"";if(t==="escape")return yl(e);const n=QZ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(yl(r.content??""));continue}const l=Fm(r.tagName);if(!l)continue;if(SM(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"&&hk(l,t)){s.push(XZ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`),Ha.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 eQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],uS="http://www.w3.org/2000/svg",tQ=new Set(["script","style","iframe","object","embed","link","meta"]),nQ=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"]),oQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),sQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),iQ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function rQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function lQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function aQ(e){const t=e.nodeName.toLowerCase();return t==="use"?rQ(e):t==="image"?lQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():iQ.has(t)}function cQ(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 uQ(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")?Ca(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ca(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ca(i,{tagName:o,attrName:s})?"":i:""}function dQ(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 TM(e){const t=EM(e),n=t.toLowerCase();let o=0;for(;on.test(t))||TM(t)}function fQ(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 eh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function NM(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(!tQ.has(o)){if(o==="br"){t.push(` +`);return}for(const s of Array.from(n.childNodes))NM(s,t)}}function hQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];NM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=eh(t.getAttribute("width")),i=eh(t.getAttribute("height")),r=eh(t.getAttribute("x")),l=eh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(uS,"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 h=e.ownerDocument.createElementNS(uS,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function pQ(e){hQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!nQ.has(o)){n.remove();continue}if(o==="style"&&dS(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&&dS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(oQ.has(r)&&i.value){const l=uQ(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(sQ.has(r)&&i.value&&TM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=cQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}fQ(n)}}function s_e(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 pQ(n),mQ(n)?null:n}catch{return null}}function mQ(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){aQ(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 fS=[];function B0(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function vQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function hS(e=`editor-${Date.now()}`,t={}){const n=FG(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(fS.length)for(const f of fS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(XW),n.use(tz),n.use(YW);const i=mz,r=i.default??i;n.use(r),n.use(GW),n.use(KW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,N=b[Math.max(0,y-1)]??"";let x=0;for(;xm+1&&I>=$&&E===N.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=gQ(g),y=B0(m),k=vQ(`editor-${e}-${h}-${m}`),A=B0(s("common.copy"));return`
      +
      + ${B0(m.toUpperCase())} + +
      +
      +
      `};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`${g}`},n}function yQ({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 IM({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}:yQ({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const pS=new WeakMap;function kQ(e){let t=pS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},pS.set(e,t)),t}function mS(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function mk(e){return!!(e.themes?.length||e.langs?.length)}function LM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function bQ(e,t){return!t?.length||e.registeredAllLangs?!0:LM(e.registeredLangs,t)}function D0(e,t){return mk(t)&&LM(e.registeredThemes,t.themes)&&bQ(e,t.langs)}function xQ(e,t){if(!mk(t))return t;const n=mS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:mS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const wQ={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 _Q(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function $M(e){const t=_Q(e);return wQ[t]??t}function FM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>$M(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function OM(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 SQ(e){return OM(e)?.join("\0")??""}function RM(e,t){const n=OM(e),o=FM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Mp(e,t){return`${SQ(e)}\0\0${FM(t)?.join("\0")??""}`}function i_e(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=RM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Mp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function r_e(e,t={},n){if(!e)return"ready";const o=RM(t.themes,t.langs),s=Mp(o.themes,o.langs),i=n&&n===s?n:s,r=kQ(e);if(r.completed.has(i))return"ready";if(D0(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||D0(r,o))return r.completed.add(i),"ready";const c=xQ(r,o),u=Mp(c.themes,c.langs);return r.completed.has(u)||D0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(mk(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function rc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function gS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var CQ=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,h=this.pendingChars<=0;if(this.source+=d,h){const p=vS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,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=vS();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,b=TQ(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=EQ(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.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=rc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,rc(o,1e3,1)),this.normalizedTargetLatencyMs=rc(s,900,1),this.normalizedCatchUpLatencyMs=rc(i,350,1),this.normalizedCatchUpThreshold=gS(r,600),this.normalizedStartDelayMs=gS(a,80),this.maxCommitFps=Math.trunc(rc(l,30,1)),this.maxCharsPerCommit=Math.trunc(rc(c,80,1)),this.flushOnFinish=u,this.segmenter=MQ(),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 AQ(e={},t){const n=new CQ(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 MQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function EQ(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 vS(){return typeof performance<"u"?performance.now():Date.now()}function TQ(e,t,n){return Math.min(n,Math.max(t,e))}var NQ=(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 yv=Symbol.for("markstream-vue:node-lifecycle"),yS='',kS='',IQ={id:"material",core:{"":kS,plain:'',text:kS,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:yS,csharp:yS,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>ms(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},kv=new Map;let bS="material";const Mc=new Map,xS=new Map;let bv=null;function LQ(e){kv.set(e.id,e)}function $Q(e){return NQ(this,null,function*(){var t,n,o;if(Mc.has(e.id))return(t=Mc.get(e.id))!=null?t:null;let s=xS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Mc.set(e.id,i),bv?.(),i)).catch(()=>(Mc.set(e.id,null),null)),xS.set(e.id,s)),s})}const FQ=Ba(0);bv=()=>{FQ.value++},LQ(IQ);const OQ={"":"",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 gk(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=OQ[n])!=null?t:n}function l_e(e){const t=gk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function a_e(e){return(function(o){const s=kv.get(bS);if(!s)return;const i=s.core[o];if(i)return i;const r=Mc.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Mc.has(s.id)&&$Q(s)})(gk(e))||((n=(t=kv.get(bS))==null?void 0:t.fallback)!=null?n:"");var t,n}const c_e={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"};let BM=!1;function u_e(){return BM}function d_e(){BM=!0}var Om=(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 js=null,Ah=!1,Rm=yk;function Bm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function vk(){try{const e=globalThis;return Bm(e?.katex)}catch{return null}}function yk(){return Om(null,null,function*(){const e=vk();if(e)return e;const t=yield ms(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ms(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Bm(t)})}function RQ(e){Rm=e,js=null,Ah=!1}function BQ(e){RQ(yk)}function DM(){return typeof Rm=="function"}function f_e(){var e;const t=Rm;if(!t||t===yk)return null;if(js)return js;const n=vk();if(n)return js=n,js;try{const o=t();return o&&typeof o?.then!="function"?(js=(e=Bm(o))!=null?e:o,js):null}catch{return null}}function kk(){return Om(this,null,function*(){var e;const t=vk();if(t)return js=t,js;if(js)return js;if(Ah)return null;const n=Rm;if(!n)return Ah=!0,null;try{const o=yield n();if(o)return js=(e=Bm(o))!=null?e:o,js}catch{}return Ah=!0,null})}function PM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let xl=null,ml=null;const pi=new Map,Fr=new Map;let Ep=5;const ka=new Set;function Bd(){if(pi.size{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),Bd(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Fr.set(a,o),Fr.size>200){const c=Fr.keys().next().value;Fr.delete(c)}}i.resolve(o)}},xl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),Bd()}}function PQ(){var e;xl&&((e=xl.terminate)==null||e.call(xl)),xl=null,ml=null}function HQ(e,t=!0,n=2e3,o){return Om(this,null,function*(){performance.now();const s=PM(e);if(!DM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(ml)return Promise.reject(ml);const i=`${t?"d":"i"}:${s}`,r=Fr.get(i);if(r)return Promise.resolve(r);const l=xl||(ml=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),ml.name="WorkerInitError",ml.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(ml);if(pi.size>=Ep){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=Ep,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Bd()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Bd()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function h_e(e,t=!0,n){const o=`${t?"d":"i"}:${PM(e)}`;if(Fr.set(o,n),Fr.size>200){const s=Fr.keys().next().value;Fr.delete(s)}}const WQ="WORKER_BUSY";function zQ(e=2e3,t){return pi.size{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),ka.delete(r),n())};if(ka.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,ka.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Bd()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),ka.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ou={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function p_e(e){return Om(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!DM()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Ou.timeout,c=(i=o.waitTimeout)!=null?i:Ou.waitTimeout,u=(r=o.backoffMs)!=null?r:Ou.backoffMs,d=(l=o.maxRetries)!=null?l:Ou.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ou.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield HQ(t,n,a,h)}catch(g){if(g?.code!==WQ||p>=f)throw g;if(p++,yield zQ(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Ec(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function UQ(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 xv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=UQ(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 wv(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 HM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function _v(e,t=360,n=500){return HM(e,t,n)}function Sv(e,t=360,n=500){return HM(e,t,n)}var qQ=Object.defineProperty,jQ=Object.defineProperties,VQ=Object.getOwnPropertyDescriptors,wS=Object.getOwnPropertySymbols,KQ=Object.prototype.hasOwnProperty,GQ=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WM=(e,t)=>{for(var n in t||(t={}))KQ.call(t,n)&&_S(e,n,t[n]);if(wS)for(var n of wS(t))GQ.call(t,n)&&_S(e,n,t[n]);return e},bk=(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 xk=()=>ms(()=>import("./mermaid.core-zKrc8Ye9.js").then(e=>e.bn),[]);let br=null,wk=xk;function YQ(e){wk=e,br=null}function ZQ(e){YQ(xk)}function QQ(){return typeof wk=="function"}function SS(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=WM({},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},jQ(n,VQ(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function CS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=WM({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 m_e(){return bk(this,null,function*(){if(br)return br;const e=(function(){try{const o=globalThis;return SS(o?.mermaid)}catch{return null}})();if(e)return br=e,CS(br),br;const t=wk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===xk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(br=SS(n),CS(br),br):null})}let hs=null,gl=null;const Uo=new Map;let AS=5,MS=!1;const XQ="WORKER_BUSY",JQ="MERMAID_DISABLED";function eX(e){hs=e,gl=null;const t=e;hs.onmessage=n=>{if(hs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Uo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},hs.onerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error(`Worker error: ${n.message}`));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},hs.onmessageerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error("Worker messageerror"));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function tX(){var e;if(hs)try{for(const[t,n]of Uo.entries())n.reject(new Error("Worker cleared"));Uo.clear(),(e=hs.terminate)==null||e.call(hs)}catch{}hs=null,gl=null}function zM(e,t,n=1400){if(!QQ()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=JQ,Promise.reject(s)}if(gl)return Promise.reject(gl);const o=hs||(gl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),gl.name="WorkerInitError",gl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(gl);if(Uo.size>=AS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=XQ,s.inFlight=Uo.size,s.max=AS,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Uo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Uo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Uo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=Uo.get(r);f&&f.reject(d)},n)})}function g_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function v_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function y_e(){if(hs)try{for(const[e,t]of Uo.entries())t.reject(new Error("Worker terminated"));Uo.clear(),hs.terminate()}finally{hs=null}}var nX=Object.defineProperty,oX=Object.defineProperties,sX=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,iX=Object.prototype.hasOwnProperty,rX=Object.prototype.propertyIsEnumerable,TS=(e,t,n)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))iX.call(t,n)&&TS(e,n,t[n]);if(ES)for(var n of ES(t))rX.call(t,n)&&TS(e,n,t[n]);return e},Pt=(e,t)=>oX(e,sX(t)),Xn=(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 lX="__global__",P0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Cv=(()=>{const e=globalThis;if(e[P0])return e[P0];const t={scopedCustomComponents:{},revision:Ba(0)};return e[P0]=t,t})(),NS=Cv.revision,aX=Symbol("markstreamCustomComponents"),cX=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 ef(e){return cX.has(String(e).trim().toLowerCase())}function uX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function H0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([_i(n),_i(uX(n))]))!s||ef(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function Co(e){const t=Kt(aX,null);return B(()=>{var n;return NS.value,(function(o,s={}){return NS.value,lt(lt(lt({},H0(Cv.scopedCustomComponents[lX]||{})),H0(s)),H0((function(i){return i&&Cv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const dX=["aria-label"],fX={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"},hX={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"},gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ys=gn(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),T("svg",hX,[...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)])])):(w(),T("svg",fX,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,dX))}),[["__scopeId","data-v-be21ab83"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const pX={class:"emoji-node"},$s=gn(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",pX,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);$s.install=e=>{e.component($s.__name,$s)};const mX=["id"],gX=["title"],Zs=gn(Ze({__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)=>(w(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,gX)],8,mX))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const UM=(()=>{try{return!1}catch{}return!1})();function W0(e){UM&&console.warn(e)}function IS(e,t="safe",n){return pk(e,t,n)}function qM(e){return YZ(e)}function z0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function _k(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=vv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),z0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),z0(r.value)]):Object.entries(s).map(([r,l])=>[r,z0(l)]):null,t,n);var s;if(!o)return;const i=qM(Ap(o));return Object.keys(i).length>0?i:void 0}function LS(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 Ru(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function U0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return MM(d,f)})(e,o);if(Qd.has(e.toLowerCase())||!l&&SM(e,i))return null;if(!l&&hk(e,i))return r?[LS(e,t,!0)]:[LS(e,t),...n,``];const a=pk(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=qM(a);return mn(d,Pt(lt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,Pt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function jM(e,t){return JZ(e,t)}function Tp(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=U0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Ru(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 h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),g=U0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Ru(c[c.length-1].children,g):Ru(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&W0(`Auto-closing unclosed tag: <${p.tagName}>`)}else W0(`Ignoring closing tag with no matching opening tag: `)}for(;c.length>0;){const d=c.pop(),f=U0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Ru(c[c.length-1].children,f):Ru(u,f),W0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(ZZ(e),t,n)}catch(s){return o=s,UM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const vX=["innerHTML"],Qs=gn(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=Co(()=>t.customId),i=Ze({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:zc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Tp(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!jM(l,s.value))return{mode:"html",content:zc(l,o.value)};const a=Tp(l,s.value,o.value);return a===null?{mode:"html",content:zc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),T("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),T("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),T("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,vX))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const yX={class:"inline-code"},kX={key:0},ts=gn(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Vd(),o=Kt("markstreamFade",void 0),s=Kt("markstreamTextStreamState",void 0),i=Kt("markstreamStreamVersion",void 0),r=B(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=B(()=>!l.value),u=B(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=X(t.node.code),f=X("");let h=i?.value;const p=X(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),N=u.value,x=A!==h;h=A;const I=IM({nextContent:$,persistedContent:N?s?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=I.settledContent,f.value=I.streamedDelta,I.appended&&(p.value+=1),N&&s?.set(N,$)},{immediate:!0}),Qe(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(w(),T("code",yX,[c.value?(w(),T(Pe,{key:0},[Je(O(a.value),1)],64)):(w(),T(Pe,{key:1},[d.value?(w(),T("span",kX,O(d.value),1)):ae("",!0),f.value?(w(),T("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):ae("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ts.install=e=>{e.component(ts.__name,ts)};const Av=X(!1),$S=X(""),FS=X("top"),cd=X(null),ud=X(null),Mv=X(null),Ev=X(null),OS=X(null);let Mh=null,Eh=null,Tv=0;function VM(){Mh&&(clearTimeout(Mh),Mh=null),Eh&&(clearTimeout(Eh),Eh=null)}let th=!1,nh=null,RS=!1;function bX(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Tv;VM();const l=()=>Xn(null,null,function*(){var a,c;if(yield(function(){return Xn(this,null,function*(){if(!th&&!RS&&typeof document<"u"){nh!=null||(nh=Xn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ms(()=>import("./vue.runtime.esm-bundler-DNukiHq4.js"),[]),ms(()=>import("./Tooltip-CsrTX-eT.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Av.value,"anchor-el":cd.value,content:$S.value,placement:FS.value,id:ud.value,originX:Mv.value,originY:Ev.value,isDark:(p=OS.value)!=null?p:void 0})}}).mount(h),th=!0}));try{yield nh}catch(u){th=!1,nh=null,RS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),th&&r===Tv){ud.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,cd.value=e,$S.value=t,FS.value=n,Mv.value=(a=s?.x)!=null?a:null,Ev.value=(c=s?.y)!=null?c:null,OS.value=typeof i=="boolean"?i:null,Av.value=!0;try{e.setAttribute("aria-describedby",ud.value)}catch{}}});o?l():Mh=setTimeout(l,80)}function xX(e=!1){Tv+=1,VM();const t=()=>{if(cd.value&&ud.value)try{cd.value.removeAttribute("aria-describedby")}catch{}Av.value=!1,cd.value=null,ud.value=null,Mv.value=null,Ev.value=null};e?t():Eh=setTimeout(t,120)}const Nv={"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..."},Iv=e=>{var t;return(t=Nv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function BS(e){return{t(t){if(e.te&&Nv[t]&&!e.te(t))return Iv(t);const n=e.t(t);return n===t&&Nv[t]?Iv(t):n}}}function wX(){const e=(function(){var t,n;try{const o=Yo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return BS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return BS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Iv}}function _X(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 SX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],CX={key:1,class:"image-placeholder"},AX={key:1,class:"image-node__raw-text"},MX={key:0,class:"image-shimmer-overlay"},EX={key:1,class:"image-node__raw-text"},TX={key:2,class:"image-error"},Al=gn(Ze({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=X(!1),i=X(!1),r=X(""),l=X("primary"),a=X(null),c=Vd(),u=Kt(yv,null);let d="",f=null;const h=B(()=>v_(n.node.src)),p=B(()=>v_(n.fallbackSrc)),g=B(()=>r.value),b=B(()=>!n.lazy),v=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=B(()=>l.value==="failed"),y=B(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=B(()=>_X(n,c));function A(R=k.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function $(R=k.value){R&&mt(()=>{A(R)})}function N(){f&&(clearTimeout(f),f=null)}function x(){const R=k.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&($(R),I())},8e3)))}function I(){return Xn(this,null,function*(){const R=d;R&&(N(),d="",yield mt(),A(R),u?.markSettled(R))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(R){R.preventDefault(),s.value&&!i.value&&o("click",[R,g.value])}const{t:L}=wX();return Qe([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Qe([v,s,i,g,()=>n.lazy],([R,D,z,H,U])=>R&&H&&!z?D?(I(),void $()):U?(x(),void $()):void(D||z||x()):(I(),void $()),{flush:"post",immediate:!0}),po(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var z,H,U,Z,K;return w(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(w(),T("img",{key:0,src:g.value,alt:String((H=(z=n.node.alt)!=null?z:n.node.title)!=null?H:""),title:String((Z=(U=n.node.title)!=null?U:n.node.alt)!=null?Z:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:C(L)("image.preview"),onError:E,onLoad:F,onClick:S},null,42,SX)):ae("",!0),e.node.loading&&!i.value?(w(),T("span",CX,[n.usePlaceholder?On(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",AX,O(e.node.raw),1))])):ae("",!0),re(Il,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(w(),T("span",MX,[n.usePlaceholder?On(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",EX,O(e.node.raw),1))])):ae("",!0)]),_:3}),m.value?(w(),T("span",TX,[On(R.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[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,O(C(L)("image.loadError")),1)],!0)])):ae("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Al.install=e=>{e.component(Al.__name,Al)};const NX={key:2},lr=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamNestedRendererProps",void 0),i=B(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=B(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Pt(lt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!ef(String(t.node.type)))),u=B(()=>c.value?_k(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=B(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(w(),xe(jo(a.value),yn({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:Ee(()=>[d.value?(w(),xe(C(l),yn({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?(w(),xe(C(l),yn({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"])):ae("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),xe(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),T("span",NX,O(h.value),1)):ae("",!0)}}),IX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],LX={key:0,translate:"no",class:"markstream-pre__diff-code"},$X={class:"markstream-pre__diff-number","aria-hidden":"true"},FX={class:"markstream-pre__diff-content"},OX={class:"markstream-pre__diff-content-inner"},RX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},BX=["textContent"],qs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,L,R;const D=String((L=(S=t.node)==null?void 0:S.language)!=null?L:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${n.value}`),s=B(()=>{var S,L,R,D,z;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(L=t.node)==null?void 0:L.code)!=null?R:""):(function(H,U){const Z=String(H??"");return U?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((z=t.node)==null?void 0:z.loading)===!0)}),i=B(()=>s.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,L)=>L+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const L=`${Math.ceil(S)}px`;return{height:L,minHeight:L,maxHeight:L,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,L="context",R={}){const D=u(S);return{code:S,kind:D&&L!=="hunk"&&!R.preserveBlankKind?"context":L,empty:D}}function f(S){const L=String(S??"");return L?L.split(/\r\n|\n|\r/):[]}function h(S,L){return!u(S[L])||L15e5)return null;const ue=ce+1,Se=new Uint32Array((oe+1)*(ce+1));for(let le=1;le<=oe;le++)for(let ne=1;ne<=ce;ne++){const q=le*ue+ne;if(J[le-1]===fe[ne-1])Se[q]=Se[(le-1)*ue+(ne-1)]+1;else{const ee=Se[(le-1)*ue+ne],ge=Se[le*ue+(ne-1)];Se[q]=ee>=ge?ee:ge}}const Te=[];let Ae=oe,P=ce;for(;Ae>0&&P>0;)J[Ae-1]===fe[P-1]?(Te.push({originalIndex:Ae-1,modifiedIndex:P-1}),Ae--,P--):Se[(Ae-1)*ue+P]>=Se[Ae*ue+(P-1)]?Ae--:P--;return Te.reverse(),Te})(R,D);if(z){const J=[];let fe=0,oe=0;for(const ce of z){for(;fe=U&&K>=U&&R[Z]===D[K];)V.unshift(Pt(lt({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),Z--,K--;for(let J=U;J<=Z;J++)H.push(Pt(lt({},d(R[J],"removed",{preserveBlankKind:h(R,J)})),{key:`inline-removed-source-${J}`,number:""}));for(let J=U;J<=K;J++)H.push(Pt(lt({},d(D[J],"added",{preserveBlankKind:h(D,J)})),{key:`inline-added-source-${J}`,number:J+1}));return H.concat(V)}const v=B(()=>{var S,L,R,D;const z=(function(K){const V=K.some(fe=>p(fe)),J=K.some(fe=>g(fe));return V&&J||(function(){var fe,oe,ce,ue;if(n.value==="diff")return!0;const Se=(ue=(ce=String((oe=(fe=t.node)==null?void 0:fe.raw)!=null?oe:"").split(/\r?\n/,1)[0])==null?void 0:ce.trim())!=null?ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Se)})()&&(V||J)})(i.value),H=(function(){var K,V;return((K=t.node)==null?void 0:K.originalCode)!=null||((V=t.node)==null?void 0:V.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:z?(function(K){const V=[];let J=1;for(const[fe,oe]of K.entries())if(oe.startsWith("@@"))V.push(Pt(lt({},d(oe,"hunk")),{key:`inline-hunk-${fe}`,number:""}));else if(p(oe))V.push(Pt(lt({},d(oe.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${fe}`,number:""}));else if(g(oe))V.push(Pt(lt({},d(oe.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${fe}`,number:J++}));else{const ce=oe.startsWith(" ")?oe.slice(1):oe;V.push(Pt(lt({},d(ce)),{key:`inline-context-${fe}`,number:J})),J++}return V})(i.value):b((S=t.node)==null?void 0:S.originalCode,(L=t.node)==null?void 0:L.updatedCode)}];if(!z&&H){const K=f((R=t.node)==null?void 0:R.originalCode),V=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((J,fe)=>{const oe=V[fe]===J?"context":"removed";return Pt(lt({},d(J,oe,{preserveBlankKind:h(K,fe)})),{key:`original-${fe}`,number:fe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((J,fe)=>{const oe=K[fe]===J?"context":"added";return Pt(lt({},d(J,oe,{preserveBlankKind:h(V,fe)})),{key:`modified-${fe}`,number:fe+1})})}]}const U=[],Z=[];for(const K of i.value)if(K.startsWith("@@"))U.push(d(K,"hunk")),Z.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))U.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))Z.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const V=K.startsWith(" ")?K.slice(1):K;U.push(d(V)),Z.push(d(V))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((K,V)=>Pt(lt({},K),{key:`original-${V}`,number:V+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((K,V)=>Pt(lt({},K),{key:`modified-${V}`,number:V+1}))}]}),m=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=X(null),k=X([]);let A=null,$=null;function N(S){const L=Number.parseFloat(String(S??""));return Number.isFinite(L)&&L>0?L:0}function x(S,L){var R;if(!S)return L;const D=S.querySelector(".markstream-pre__diff-content"),z=D?.getBoundingClientRect(),H=(R=z?.height)!=null?R:0;return Math.max(L,Math.ceil(H))}function I(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,L;A=null;const R=y.value;if(!R||!l.value)return void(k.value.length&&(k.value=[]));const D=(function(J){const fe=window.getComputedStyle(J),oe=N(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const ce=N(fe.lineHeight);return ce>0?ce:18})(R),z=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),H=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(z.length,H.length),Z=[];for(let J=0;J{const oe=V[fe];return oe&&Math.abs(J.rowHeight-oe.rowHeight)<=.5&&Math.abs(J.originalHeight-oe.originalHeight)<=.5&&Math.abs(J.modifiedHeight-oe.modifiedHeight)<=.5})||(k.value=Z)})()}))}function E(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{I()}),$.observe(S))}function F(S,L){const R=k.value[S];if(!R)return;const D=L==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Qe(y,S=>{E(S),mt(()=>I())},{flush:"post"}),Qe([l,v],()=>{E(y.value),mt(()=>I())},{flush:"post",immediate:!0}),po(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,L)=>(w(),T("pre",{ref_key:"preRef",ref:y,style:Yt(c.value),class:We([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),T("code",LX,[(w(!0),T(Pe,null,ot(v.value,R=>(w(),T("span",{key:R.key,class:We(["markstream-pre__diff-pane",R.className])},[(w(!0),T(Pe,null,ot(R.lines,(D,z)=>(w(),T("span",{key:D.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Yt(F(z,R.key))},[L[0]||(L[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",$X,O(D.number),1),_("span",FX,[_("span",OX,O(D.code),1)])],6))),128))],2))),128))])):(w(),T(Pe,{key:1},[t.showLineNumbers?(w(),T("span",RX,[(w(!0),T(Pe,null,ot(r.value,R=>(w(),T("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):ae("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,BX)],64))],14,IX))}});qs.install=e=>{e.component(qs.__name,qs)};const q0=Ba(!1);let DS=null;const DX={key:0},ro=gn(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(DS||(DS=kk().then(v=>{q0.value=!!v}).catch(()=>{q0.value=!1})),Wh(q0)),o=Vd(),s=Kt("markstreamFade",void 0),i=Kt("markstreamTextStreamState",void 0),r=Kt("markstreamStreamVersion",void 0),l=B(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=B(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=X(t.node.content),d=X("");let f=r?.value;const h=X(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,N=k!==f;f=k;const x=IM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Qe(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=B(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(w(),T("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),T("span",DX,O(u.value),1)):ae("",!0),d.value?(w(),T("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):ae("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);ro.install=e=>{e.component(ro.__name,ro)};const KM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return mn(qs,Pt(lt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),j0=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./CodeBlockNode-BZ3nIcUJ.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),qs}}),loadingComponent:KM,delay:0,suspensible:!1}),Pi=Li(()=>Xn(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 mn(ro,Pt(lt({},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{if(yield kk())return(yield ms(()=>import("./index6-BXVNgB_e.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 mn(ro,Pt(lt({},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:""}$`}}))}})),GM=Li(()=>Xn(null,null,function*(){try{if(yield kk())return(yield ms(()=>import("./index5-D6hAiKdZ.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 mn(ro,Pt(lt({},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:""}$$`}}))}})),ys=gn(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),T("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))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ys.install=e=>{e.component(ys.__name,ys)};const PX={class:"superscript-node"},Fs=gn(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sup",PX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const HX={class:"subscript-node"},Os=gn(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,superscript:Fs,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sub",HX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Os.install=e=>{e.component(Os.__name,Os)};const WX={class:"strong-node"},ks=gn(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("strong",WX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);ks.install=e=>{e.component(ks.__name,ks)};const zX={class:"strikethrough-node"},bs=gn(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("del",zX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);bs.install=e=>{e.component(bs.__name,bs)};const UX=["href","title","aria-label","aria-hidden","target","rel"],qX=["aria-hidden"],jX={class:"link-text-wrapper relative inline-flex"},VX={class:"leading-[normal] link-text"},xs=gn(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Kt("markstreamShowTooltips",void 0),o=B(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=B(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(v=t.animationOpacity)!=null?v:.35,x=Math.max(.12,Math.min(.5*N,N)),I={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(N),"--underline-rest-opacity":String(x),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(I["--link-color"]=t.color),I}),i=Co(()=>t.customId),r=B(()=>lt({text:ro,strong:ks,strikethrough:bs,emphasis:ws,image:Al,html_inline:Qs,inline_code:ts},i.value)),l=Vd(),a=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return IS(k,"safe","a")}),c=B(()=>lt(lt({},l),a.value)),u=B(()=>{var v,m;return IS({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(RV(u.value)?"_blank":void 0)}),f=B(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=B(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=B(()=>{const v=lt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&xX()}const b=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(w(),T("span",yn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",jX,[_("span",VX,[re(C(ro),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,qX)):(w(),T("a",yn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var N,x,I,E;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,L=((N=t.node)==null?void 0:N.title)||((x=u.value)!=null&&x.includes("xn--")&&((E=(I=t.node)==null?void 0:I.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";bX($.currentTarget,L,"top",!1,S)})(A)),onMouseleave:g}),[(w(!0),T(Pe,null,ot(e.node.children,(A,$)=>(w(),xe(C(lr),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,UX))}}}),[["__scopeId","data-v-367e6ca4"]]);xs.install=e=>{e.component(xs.__name,xs)};const KX={class:"insert-node"},Rs=gn(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("ins",KX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const GX={class:"highlight-node"},Xs=gn(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("mark",GX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const YX={class:"emphasis-node"},ws=gn(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("em",YX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);ws.install=e=>{e.component(ws.__name,ws)};const ZX={class:"hard-break"},Ml=gn(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("br",ZX))}),[["__scopeId","data-v-50c58f70"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const Dd=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=pt({checkbox:Ys,checkbox_input:Ys,emoji:$s,emphasis:ws,hardbreak:Ml,highlight:Xs,inline_code:ts,insert:Rs,link:xs,reference:ys,strikethrough:bs,strong:ks,subscript:Os,superscript:Fs,text:ro}),o=Co(()=>t.customId),s=B(()=>{const i=o.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(w(!0),T(Pe,null,ot(e.nodes,(l,a)=>(w(),xe(C(lr),{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 Lv(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(Lv)}function Np(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Lv))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(Lv)?s:null}function eu(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 QX=["cite"],XX={key:0,dir:"auto",class:"paragraph-node"},JX=["custom-id"],Th=gn(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),i=B(()=>Np(t.node.children,!o.value)),r=B(()=>t.fade!==!1||s.value?null:eu(i.value));return Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade)),(l,a)=>(w(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),T("p",XX,[r.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,JX)):(w(),xe(C(Dd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),xe(C(Bs),{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,QX))}}),[["__scopeId","data-v-abfecebc"]]);Th.install=e=>{e.component(Th.__name,Th)};const eJ={class:"definition-list"},tJ={class:"definition-term"},nJ={class:"definition-desc"},Nh=gn(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("dl",eJ,[(w(!0),T(Pe,null,ot(t.node.items,(s,i)=>(w(),T(Pe,{key:i},[_("dt",tJ,[re(C(Bs),{"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",nJ,[re(C(Bs),{"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"]]);Nh.install=e=>{e.component(Nh.__name,Nh)};const oJ=["href","title"],dd=gn(Ze({__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)=>(w(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,oJ))}}),[["__scopeId","data-v-e1eb37b6"]]);dd.install=e=>{e.component(dd.__name,dd)};const sJ=["id"],iJ={class:"flex-1"},Ih=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",iJ,[re(C(Bs),{"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,sJ))}});Ih.install=e=>{e.component(Ih.__name,Ih)};const rJ=["custom-id"],$v=gn(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:eu(t.node.children)),i=B(()=>lt({text:ro,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,footnote_reference:Zs,hardbreak:Ml,math_inline:Pi,reference:ys},n.value));return(r,l)=>(w(),xe(jo(`h${e.node.level}`),yn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[s.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,rJ)):(w(!0),T(Pe,{key:1},ot(e.node.children,(a,c)=>(w(),xe(C(lr),{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"]]),Ip=$v;Ip.install=e=>{e.component($v.__name,$v)};const lJ={key:0,dir:"auto",class:"paragraph-node"},aJ=["custom-id"],cJ={dir:"auto",class:"paragraph-node"},uJ=["custom-id"],Uc=gn(Ze({__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 h;return(h=t.node)!=null?h:t.item}),o=Co(()=>t.customId),s=B(()=>!!o.value.paragraph),i=B(()=>!!o.value.text),r=B(()=>{var h;return Np((h=n.value)==null?void 0:h.children,!s.value)}),l=B(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Np([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?eu(r.value):null),u=B(()=>{var h;return a()?eu((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade)),(h,p)=>{var g,b;return w(),T("li",yn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),T("p",lJ,[c.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,aJ)):(w(),xe(C(Dd),{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?(w(),T(Pe,{key:1},[_("p",cJ,[u.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,uJ)):(w(),xe(C(Dd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),T(Pe,null,ot(l.value.nestedLists,(v,m)=>(w(),xe(C(Bs),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"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:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),xe(C(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Uc.install=e=>{e.component(Uc.__name,Uc)};const qc=gn(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Co(()=>e.customId),n=B(()=>t.value.list_item||Uc);return(o,s)=>(w(),xe(jo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(w(!0),T(Pe,null,ot(e.node.items,(i,r)=>{var l;return w(),xe(jo(n.value),yn({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 YM=Symbol("ViewportPriority");function dJ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?X(t):t,r=s?(n=window.requestIdleCallback)!=null?n:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Qe(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=X(!1);let A,$=!1;const N=new Promise(E=>{A=()=>{$||($=!0,E())}}),x=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:N,destroy:x};const I=(function(E,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,z){var H,U,Z;return{root:(H=e?.(D??null))!=null?H:null,rootMargin:(U=z?.rootMargin)!=null?U:"300px",threshold:(Z=z?.threshold)!=null?Z:0}})(E,F);if(a&&(R=S,(L=c)&&L.root===R.root&&L.rootMargin===R.rootMargin&&L.threshold===R.threshold))return a;var L,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const z of D)(z.isIntersecting||z.intersectionRatio>0)&&g(z.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(m,y);return I?(u.set(m,{resolve:A,visible:k}),I.observe(m),d.add(m),b(),{isVisible:k,whenVisible:N,destroy:x}):(k.value=!0,A(),{isVisible:k,whenVisible:N,destroy:x})};return Ln(YM,v),v}function fJ(){var e,t;const n=Kt(YM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=X(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const hJ={key:2,class:"html-block-node__raw"},pJ=["innerHTML"],mJ={key:1,class:"html-block-node__placeholder"},fd=gn(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamNestedRendererProps",void 0),s=B(()=>{var $,N;return(N=($=t.htmlPolicy)!=null?$:n?.value)!=null?N:"safe"}),i=B(()=>{var $,N;const x=($=o?.value)!=null?$:{};return Pt(lt({},x),{customId:(N=t.customId)!=null?N:x.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),l=B(()=>{const $=vv(t.node.attrs,s.value);if(!$)return;const N=Ap($);return Object.keys(N).length>0?N:void 0}),a=B(()=>{const $=String(t.node.tag||"").trim(),N=vv(t.node.attrs,s.value,$);if(!N)return;const x=Ap(N);return Object.keys(x).length>0?x:void 0}),c=Co(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=X(null),f=X(typeof window>"u"),h=X(t.node.content),p=B(()=>Array.isArray(t.node.children)?t.node.children:[]),g=B(()=>String(t.node.tag||"div")),b=B(()=>{const $=g.value.trim().toLowerCase();return F6.has($)||hk($,s.value)}),v=B(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=B(()=>{var $,N,x;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const I=(N=h.value)!=null?N:t.node.content;if(!I)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:zc(I,s.value)};if(t.node.loading){const F=Tp(I,c.value,s.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:I}:{mode:"dynamic",nodes:F}}if(!jM(I,c.value))return{mode:"html",content:zc(I,s.value)};const E=Tp(I,c.value,s.value);return E===null?{mode:"html",content:zc(I,s.value)}:{mode:"dynamic",nodes:E}}),y=fJ(),k=X(null),A=!!t.node.loading;return typeof window<"u"?(Qe(d,$=>{var N,x;if((x=(N=k.value)==null?void 0:N.destroy)==null||x.call(N),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const I=y($,{rootMargin:"400px"});k.value=I,f.value=I.isVisible.value,I.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,po(()=>{var $,N;(N=($=k.value)==null?void 0:$.destroy)==null||N.call($),k.value=null}),($,N)=>(w(),xe(jo(v.value?g.value:"div"),yn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(w(),T(Pe,{key:0},[m.value.mode==="structured"?(w(),xe(C(r),yn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(w(),xe(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(w(),T("pre",hJ,O(m.value.content),1)):(w(),T("div",yn({key:3},l.value,{innerHTML:m.value.content}),null,16,pJ))],64)):(w(),T("div",mJ,[On($.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);fd.install=e=>{e.component(fd.__name,fd)};const gJ={dir:"auto",class:"paragraph-node"},vJ=["custom-id"],Ma=gn(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamFade",void 0),i=Kt("markstreamParseOptions",void 0),r=Kt("markstreamCustomMarkdownIt",void 0),l=Kt("markstreamNestedRendererProps",void 0),a=B(()=>{var x;return(x=o?.value)!=null?x:"safe"}),c=B(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=B(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=B(()=>{var x,I;return(I=t.customHtmlTags)!=null?I:(x=l?.value)==null?void 0:x.customHtmlTags}),f=B(()=>{var x,I;const E=(x=l?.value)!=null?x:{};return Pt(lt({},E),{customId:(I=t.customId)!=null?I:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1});function p(x){var I;return x.type==="text"&&String((I=x.content)!=null?I:"").trim()===""}const g=B(()=>t.node.children.filter(x=>!p(x))),b=B(()=>g.value.length>0&&g.value.every(x=>x.type==="image"||(function(I){var E;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(L=>!p(L)):[]})(I);return F.length===1&&((E=F[0])==null?void 0:E.type)==="image"})(x))),v=B(()=>new Set(ru(d.value))),m=B(()=>{if(!b.value||g.value.length<=1)return t.node.children;const x=[];for(let I=0;I0,S=t.node.children.slice(I+1).some(L=>!p(L));F&&S&&x.push(Pt(lt({},E),{content:" ",raw:" "}))}return x}),y=B(()=>s?.value===!1&&!n.value.text),k=B(()=>y.value?eu(m.value):null);function A(x,I){return{node:x,"index-key":`${t.indexKey}-${I}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=B(()=>lt({inline_code:ts,image:Al,link:xs,hardbreak:Ml,emphasis:ws,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,html_inline:Qs,html_block:fd,emoji:$s,checkbox:Ys,math_inline:Pi,checkbox_input:Ys,reference:ys,footnote_anchor:dd,footnote_reference:Zs,text:ro},n.value)),N=B(()=>m.value.map((x,I)=>{var E;const F=(function(S){var L,R,D,z;if(S.type==="html_block"||S.type==="html_inline"){const H=String((L=S.tag)!=null?L:"").trim().toLowerCase()||D6(S.content);if(H&&!v.value.has(H)&&P6((R=S.content)!=null?R:S.raw,H)){const U=String((z=(D=S.content)!=null?D:S.raw)!=null?z:"");return{child:{type:"text",content:U,raw:U},component:ro,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!ef(String(S.type)))}})(x);return Pt(lt({},F),{index:I,key:`${t.indexKey||"paragraph"}-${I}`,customAttrs:F.isCustomComponent?_k(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((E=F.child.content)!=null?E:""),originalChild:x})}));return(x,I)=>(w(),T("p",gJ,[k.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,vJ)):(w(!0),T(Pe,{key:1},ot(N.value,E=>{return w(),T(Pe,{key:E.key},[b.value&&p(E.originalChild)?(w(),T(Pe,{key:0},[Je(O((F=E.originalChild,String((S=F.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),xe(jo(E.component),yn({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:Ee(()=>[E.hasSlotChildren?(w(),xe(C(h),yn({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?(w(),xe(C(h),yn({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"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),xe(jo(E.component),yn({key:2,ref_for:!0},A(E.child,E.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ma.install=e=>{e.component(Ma.__name,Ma)};const yJ={class:"table-node-wrapper"},kJ=["aria-busy"],bJ={key:0},xJ=["custom-id"],wJ=["aria-label","onPointerdown"],_J=["custom-id"],SJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},hd=gn(Ze({__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 v;return(v=t.node.loading)!=null&&v}),o=B(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=X(null),i=X([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=B(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade));const u=Co(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Np(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?eu(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Qe(l,()=>{b(),i.value=[]}),po(b),(v,m)=>(w(),T("div",yJ,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),T("colgroup",bJ,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("col",{key:k,style:Yt(c.value[k])},null,4))),128))])):ae("",!0),_("thead",null,[_("tr",null,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,xJ)):p(y).simpleChildren?(w(),xe(C(Dd),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k(function($,N){if(N.button!==0)return;const x=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],L=>Math.round(L.getBoundingClientRect().width))})(),I=x[$],E=x[$+1];I&&E&&(N.preventDefault(),r={index:$,startX:N.clientX,startWidth:I,nextStartWidth:E,widths:x},i.value=x,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,wJ)):ae("",!0)],2))),128))])]),_("tbody",null,[(w(!0),T(Pe,null,ot(o.value,(y,k)=>(w(),T("tr",{key:k},[(w(!0),T(Pe,null,ot(y.cells,(A,$)=>(w(),T("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,_J)):p(A).simpleChildren?(w(),xe(C(Dd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[1]||(m[1]=N=>v.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,kJ),re(Il,{name:"table-node-fade"},{default:Ee(()=>[n.value?(w(),T("div",SJ,[On(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):ae("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);hd.install=e=>{e.component(hd.__name,hd)};const CJ={class:"hr-node"},Lh=gn({},[["render",function(e,t){return w(),T("hr",CJ)}],["__scopeId","data-v-39b2349c"]]);Lh.install=e=>{e.component(Lh.__name,Lh)};const AJ={class:"unknown-node"},Fv=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),T("div",AJ,O(e.node.raw),1))}),$h=gn(Ze({__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=Co(()=>t.customId),s=B(()=>lt({text:ro,paragraph:Ma,heading:Ip,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,checkbox:Ys,checkbox_input:Ys,hardbreak:Ml,math_inline:Pi,reference:ys,list:qc,math_block:GM,table:hd},o.value));return(i,r)=>(w(),T("div",yn({class:n.value},e.node.attrs),[(w(!0),T(Pe,null,ot(e.node.children,(l,a)=>{return w(),xe(jo((c=l.type,s.value[c]||Fv)),{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"]]);$h.install=e=>{e.component($h.__name,$h)};const MJ=["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"],PS=[[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 EJ(e){if(e<=255)return MJ[e];let t=0,n=PS.length-1;for(;t<=n;){const o=t+n>>1,s=PS[o];if(es[1]))return s[2];t=o+1}}return"L"}const TJ=/[ \t\n\r\f]+/g,NJ=/[\t\n\r\f]| {2,}|^ | $/;let V0=null;const IJ=new RegExp("\\p{Script=Arabic}","u"),Dm=new RegExp("\\p{M}","u"),ZM=new RegExp("\\p{Nd}","u");function HS(e){return IJ.test(e)}function WS(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>=44032&&e<=55215||e>=65280&&e<=65519}function Rr(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&o<=57343){if(WS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(WS(n))return!0}}return!1}const LJ=new Set([" "," ","⁠","\uFEFF"]);function $J(e){return Rr(e)}function Ov(e){return!(function(t){const n=Lp(t);return n!==null&&(Sk.has(n)||Ia.has(n))})(e)&&!(function(t){const n=Lp(t);return n!==null&&LJ.has(n)})(e)}const Sk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Pm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ck=new Set(["'","’"]),Ia=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),FJ=new Set([":",".","،","؛"]),OJ=new Set(["၏"]),RJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function BJ(e){if(Ak(e))return!0;let t=!1;for(const n of e)if(Ia.has(n))t=!0;else if(!t||!Dm.test(n))return!1;return t}function DJ(e){for(const t of e)if(!Sk.has(t)&&!Ia.has(t))return!1;return e.length>0}function PJ(e){if(Ak(e))return!0;for(const t of e)if(!Pm.has(t)&&!Ck.has(t)&&!Dm.test(t))return!1;return e.length>0}function Ak(e){let t=!1;for(const n of e)if(n!=="\\"&&!Dm.test(n)){if(!(Pm.has(n)||Ia.has(n)||Ck.has(n)))return!1;t=!0}return t}function QM(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 Lp(e){if(e.length===0)return null;const t=QM(e,e.length);return e.slice(t)}function HJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Dm.test(o))n--;else{if(!Pm.has(o)&&!Ck.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function WJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function zS(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 US(e,t){return e&&t!==null&&FJ.has(t)}function zJ(e){const t=Lp(e);return t!==null&&OJ.has(t)}function UJ(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 Rv(e){let t=e.length;for(;t>0;){const n=QM(e,t),o=e.slice(n,t);if(RJ.has(o))return!0;if(!Ia.has(o))return!1;t=n}return!1}function qJ(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 jJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function VJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function KJ(e,t,n,o){if(!jJ.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=qJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(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:di(r),isWordLike:a,kind:i,start:l}),s}function K0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const GJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function YJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||GJ.test(n)&&t+10&&d[U]==="text"&&L&&g[U]&&v[U]||F&&l>0&&d[U]==="text"&&DJ(I.text)&&g[U]||F&&l>0&&d[U]==="text"&&m[U]?E():F&&l>0&&d[U]==="text"&&I.isWordLike&&R&&y[U]?(E(),u[U]=!0):S!==null&&l>0&&d[U]==="text"&&h[U]===S?p[U]=((s=p[U])!=null?s:1)+1:F&&!I.isWordLike&&l>0&&d[U]==="text"&&(BJ(I.text)||I.text==="-"&&u[U])?E():(a[l]=I.text,c[l]=[I.text],u[l]=I.isWordLike,d[l]=I.kind,f[l]=I.start,h[l]=S,p[l]=S===null?0:1,g[l]=L,b[l]=R,v[l]=z,m[l]=H,y[l]=US(R,D),l++)}for(let x=0;xnull);let A=-1;for(let x=l-1;x>=0;x--){const I=a[x];if(I.length!==0){if(d[x]==="text"&&!u[x]&&PJ(I)&&A>=0&&d[A]==="text"){const E=(i=k[A])!=null?i:[];E.push(I),k[A]=E,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x1;for(let H=0;H=x.len||K0(x.kinds[D]))continue;const z=[],H=x.starts[D];let U=D;for(;U0&&(I.push(di(z)),E.push(!0),F.push("text"),S.push(H),L=U-1)}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let R=0;R"u")return ac={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ac;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 ac={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ac}function XM(){return G0===null&&(G0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),G0}function tee(e){return JJ.test(e)||e.includes("️")}function la(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=XM();for(const a of l.segment(i))tee(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function nee(e,t){for(;tr?(p(),b(k,N,x)):(a+=x,u=k,d=N+1):b(k,N,x)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let Y0=null;function see(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,h){o=[d],s=f,i=h,r=Rv(d),l=Pm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Rv(d);r=d.length===1&&Ia.has(d)&&r||h,l=!1}for(const d of(Y0===null&&(Y0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Y0).segment(e)){const f=d.segment,h=Rr(f);o.length!==0?l||Sk.has(f)||Ia.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function iee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Rr(e[0].text),i=Ov(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;lL+.5&&typeof document<"u"&&document.body!==null){const H=document.createElement("span");H.style.font=S,H.style.display="inline-block",H.style.visibility="hidden",H.style.position="absolute",H.textContent="😀",document.body.appendChild(H);const U=H.getBoundingClientRect().width;document.body.removeChild(H),z-U>.5&&(R=z-U)}return YS.set(S,R),R})(N,E):0;return{cache:I,fontSize:E,emojiCorrection:F}})(t,(l=e.normalized,eee.test(l)));var l;const a=la("-",ll("-",i),r),c=8*la(" ",ll(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(N,x,I,E,F,S,L){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(x),d.push(I),f.push(E),h.push(F),b.push(L),v!==null&&v.push(N)}function k(N,x,I,E,F){const S=ll(N,i),L=la(N,S,r),R=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:L,D=x==="space"||x==="zero-width-break"?0:L;if(F&&E&&N.length>1){let z="sum-graphemes";Fh(N)?z="pair-context":s.preferPrefixWidthsForBreakableRuns&&(z="segment-prefixes");const H=(function(U,Z,K,V,J){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const fe=XM(),oe=[];for(const Te of fe.segment(U))oe.push(Te.segment);if(oe.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(J==="sum-graphemes"){const Te=[];for(const Ae of oe){const P=ll(Ae,K);Te.push(la(Ae,P,V))}return Z.breakableFitAdvances=Te,Z.breakableFitAdvances}if(J==="pair-context"||oe.length>96){const Te=[];let Ae=null,P=0;for(const le of oe){const ne=la(le,ll(le,K),V);if(Ae===null)Te.push(ne);else{const q=Ae+le,ee=ll(q,K);Te.push(la(q,ee,V)-P)}Ae=le,P=ne}return Z.breakableFitAdvances=Te,Z.breakableFitAdvances}const ce=[];let ue="",Se=0;for(const Te of oe){ue+=Te;const Ae=la(ue,ll(ue,K),V);ce.push(Ae-Se),Se=Ae}return Z.breakableFitAdvances=ce,Z.breakableFitAdvances})(N,S,i,r,z);return void y(N,L,R,D,x,I,H)}y(N,L,R,D,x,I,null)}for(let N=0;N=55296&&V<=56319&&K+1=56320&&ce<=57343&&(J=ce-56320+(V-55296<<10)+65536,fe=2)}const oe=EJ(J);oe!=="R"&&oe!=="AL"&&oe!=="AN"||(R=!0);for(let ce=0;ce=0&&L[V]==="ET";V--)L[V]="EN";for(V=K+1;V0?L[K-1]:U)!=="L"?"R":"L";if(J===((V0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,N=0,x=!1,I=!1;function E(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(N),A=null)}for(let F=0;F{const e=globalThis;if(e[Z0])return e[Z0];const t={configs:{},controllers:{},revision:Ba(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Z0]=t,t})();let Bu=null;const QS=Eo.revision;function XS(e){var t;return e&&(t=Eo.configs[e])!=null?t:null}function JS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function aee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Q0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!aee(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 X0(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Bu!=null)return Bu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Bu}catch{return Bu=!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=Eo.blockEstimateCache.get(r);if(l)return Eo.blockEstimateCache.delete(r),Eo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,g){const b=`${g}\0${p}\0${h}`,v=Eo.preparedCache.get(b);if(v)return Eo.preparedCache.delete(b),Eo.preparedCache.set(b,v),v.prepared;const m=lee(h,p,{whiteSpace:g});for(Eo.preparedCache.set(b,{prepared:m});Eo.preparedCache.size>240;){const y=Eo.preparedCache.keys().next().value;if(!y)break;Eo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?ZS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return ZS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:N,kinds:x,breakableFitAdvances:I,discretionaryHyphenWidth:E,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const L=Hm(),R=L.lineFitEpsilon,D=k+R;let z=0,H=0,U=!1,Z=0,K=0,V=-1,J=0,fe=0,oe=null;function ce(){V=-1,J=0,fe=0,oe=null}function ue(ee=Z,ge=K,de=H){z++,H=0,U=!1,ce()}function Se(ee,ge){U=!0,Z=ee+1,K=0,H=ge}function Te(ee,ge,de){U=!0,Z=ee,K=ge+1,H=de}function Ae(ee,ge){U?(H+=ge,Z=ee+1,K=0):Se(ee,ge)}function P(ee,ge,de,ve){if(!ge)return;const j=ee==="tab"?0:$[de],te=ee==="tab"?ve:N[de];V=de+1,J=H-ve+j,fe=H-ve+te,oe=ee}function le(ee,ge){const de=I[ee];for(let ve=ge;veD?(ue(),Te(ee,ve,j)):(H+=j,Z=ee,K=ve+1):Te(ee,ve,j)}U&&Z===ee&&K===de.length&&(Z=ee+1,K=0)}function ne(ee){if(oe!=="soft-hyphen")return!1;const ge=I[ee];if(ge==null)return!1;const{fitCount:de,fittedWidth:ve}=(function(j,te,pe,Ce,$e){let De=0,me=te;for(;Depe+Ce)break;me=Ie,De++}return{fitCount:De,fittedWidth:me}})(ge,H,k,R,E);return de!==0&&(H=ve,Z=ee,K=de,ce(),de===ge.length?(Z=ee+1,K=0,!0):(ue(ee,de,ve+E),le(ee,de),!0))}function q(ee){z++,ce()}for(let ee=0;eeD){const pe=H+(ve==="tab"?0:$[de]),Ce=H+(ve==="tab"?te:N[de]);if(oe==="soft-hyphen"&&L.preferEarlySoftHyphenBreak&&J<=D){ue(V,0,fe);continue}if(oe==="soft-hyphen"&&ne(de)){de++;continue}if(j&&pe<=D){Ae(de,te),ue(de+1,0,Ce),de++;continue}if(V>=0&&J<=D){if(Z>V||Z===V&&K>0){ue();continue}const $e=V;ue($e,0,fe),de=$e;continue}if(te>k&&I[de]!==null){ue(),le(de,0),de++;continue}ue();continue}Ae(de,te),P(ve,j,de,te),de++}else te>k&&I[de]!==null?le(de,0):Se(de,te),P(ve,j,de,te),de++;else U&&(Z=de+1,K=0,V=de+1,J=H+E,fe=H+E,oe=ve),de++}if(U){const ve=V===ge.consumedEndSegmentIndex?fe:H;ue(ge.consumedEndSegmentIndex,0,ve)}}return z})(v,m)})(h,p);return{lineCount:b,height:b*g}})(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(Eo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Eo.blockEstimateCache.size>4e3;){const h=Eo.blockEstimateCache.keys().next().value;if(!h)break;Eo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function JM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Q0(e.children);return i&&n.paragraph?X0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Q0(e.children),l=n.headings[i];return r&&l?X0(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=Q0((s=i[0])==null?void 0:s.children);return r?X0(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=JM(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 oh(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function cee(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(oh(String((d=u.originalCode)!=null?d:"")),oh(String((f=u.updatedCode)!=null?f:"")),oh(String((h=u.code)!=null?h:""))):oh((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function uee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function J0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=JS(o.lineHeight,1.5*JS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:uee(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const dee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function eC(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))dee.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const fee=!1;function k_e(){return fee}function tC(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,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):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 h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);pd&&(e.scrollTop=c)}const e5=Symbol("MarkstreamMathBlockMinHeightCache");function b_e(){return Kt(e5,null)}const hee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],pee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],mee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),t5=["raw","content","code","originalCode","updatedCode"],nC=new WeakMap,oC=new WeakMap;let gee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function sC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=nC.get(t);return n||(n=gee++,nC.set(t,n)),String(n)}function iC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function rC(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 lC(e){const t=n5(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function n5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function o5(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Mk(e){const t=String(e??"");return`${t.length}:${o5(t)}`}function Dv(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?Mk(r):`${r.length}:${o5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(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:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Dv(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}:${Dv(r[c],t,n+1)}`).join(";")}`}return typeof e}function $p(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function s5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>$p(o)?Rl(o,t,n+1):s5(o,t,n+1)).join(",")}`:$p(e)?Rl(e,t,n):Dv(e,t,n)}function vee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!t5.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${Mk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:mee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${s5(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function yee(e){return t5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Mk(n)}`:""}).filter(Boolean).join(";")}function Rl(e,t=new WeakMap,n=0){const o=oC.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}:${gi(s)}`;const r=gi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Rl(p,c,u+1)).join("|"):"";return[a.type,yee(d),vee(d,c,u),f.length,h].join(":")})(e,t,n);return oC.set(s,l),l}function i5(e,t){return Rl(e)===Rl(t)}function Ek(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function aC(e,t,n){return Ek(t,n,()=>Rl(e))}function r5(e,t,n){return aC(e,n,"stabilizeSignatureMs")===aC(t,n,"stabilizeSignatureMs")}function eg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function cC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function kee(e,t){return e.length===t.length&&e===t}function Tk(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=Tk(e,t)}),o??r5(e,t,n)}function wee(e,t){const n={};for(const o of hee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function _ee(e,t){var n;const o=hS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=X(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const I=t.renderContent.value;r.value!==I&&(r.value=I),p=Ti()}Qe([t.renderContent,t.effectiveFinal,i],([I,E,F])=>{r.value!==I&&(!F||E||(function(S,L){if(!S&&L||L.length<=80||L.length\s*|`{3,}|~{3,})/.test(R))||R.endsWith(` +`)&&!(function(D){const z=rC(D);if(lC(z))return!1;const H=n5(z);return H.length>=2&&H.some(U=>U.trim())})(L))})(r.value,I)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(L){const R=L.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),dy(g);const v=B(()=>{var I,E,F,S;return zV(e.customHtmlTags,(I=e.parseOptions)==null?void 0:I.customHtmlTags,(S=(F=(E=t.customComponentsMap)==null?void 0:E.value)!=null?F:{},Object.entries(S).map(([L,R])=>{const D=_i(L);return R==null||!D||ef(D)||$6.has(D)||Qd.has(D)?"":D}).filter(Boolean)))}),m=B(()=>{const{key:I,tags:E}=UV(v.value);if(!I)return o;const F=s.get(I);if(F)return F;const S=hS(t.instanceMsgId,{customHtmlTags:E});return s.set(I,S),S}),y=B(()=>{const I=m.value;return e.customMarkdownIt?e.customMarkdownIt(I):I}),k=B(()=>{var I,E;const F=(I=e.parseOptions)!=null?I:{},S=t.effectiveFinal.value,L=v.value,R=S!=null,D=L.length>0;return R||D||F.streamParse==null?lt(lt(Pt(lt({},F),{streamParse:(E=F.streamParse)==null||E}),R?{final:S}:{}),D?{customHtmlTags:L}:{}):F}),A=B(()=>{var I;return new Set(((I=k.value.customHtmlTags)!=null?I:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),$=B(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),N=B(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Qe([$,N],([I,E],[F,S])=>{F&&(I===F&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const x=B(()=>{var I,E,F,S,L,R,D,z;if((I=e.nodes)!=null&&I.length)return a=[],d="",pt(e.nodes.slice());const H=r.value;if(!H)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,Z=U?Ti():0,K=y.value,V=$.value,J=N.value;c&&V!==c&&(function(ge){var de,ve;(ve=(de=ge.stream)==null?void 0:de.reset)==null||ve.call(de)})(K),u&&J!==u&&(a=[],d="");const fe=a.length>0&&H.startsWith(d)&&J===u,oe=U?sC(K):null,ce=U?{}:void 0,ue=ce?Pt(lt({},k.value),{__timing:ce}):k.value,Se=xM(H,K,ue),Te=U?Ti():0,Ae=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let P,le=U?eg(Se.length):void 0,ne=0,q=0;if(fe){const ge=U?Ti():0;if(Ae){const de=(function(ve,j,te){if(!j.length)return{nodes:ve,metrics:eg(ve.length)};const pe=(function(De,me,Ie){const et=Math.min(De.length,me.length);for(let rt=0;rtRl(ge[j]))})(P,Ae,q):(function(ge,de=0){for(let ve=Math.max(0,de);ve((E=oe?.total)!=null?E:0);t.logPerf(de?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-Z),nodes:P.length,contentLength:H.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ee,signatureMs:(F=Ae?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=Ae?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(L=Ae?.primeSignatureMs)!=null?L:0,signatureCallCount:(R=Ae?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=Ae?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(z=Ae?.primeSignatureCallCount)!=null?z:0,stabilizeMs:ne},le??{}),ce?Object.fromEntries(pee.map(ve=>{var j;return[ve,(j=ce[ve])!=null?j:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:wee(ge,oe),streamStats:ge}:{}))}return pt(P)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:x}}function See(e){const{isClient:t}=e,n=X(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,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(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,h]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 uy()&&dy(()=>{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 uC=/auto|scroll|overlay/i;function Aee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return uC.test(t)||uC.test(n)}function Mee(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 Eee=Ze({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 Sv((o=Ec(e.estimatedPreviewHeightPx))!=null?o:wv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("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},()=>mn("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,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Tee=Ze({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 _v((o=Ec(e.estimatedPreviewHeightPx))!=null?o:xv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("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},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("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)"}},[mn("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"}})])])}}),Nee=["data-custom-id"],Iee={class:"m-0 p-0"},Lee=["data-probe"],$ee=["data-node-index","data-node-type"],l5=gn(Ze(Pt(lt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},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,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","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,i=Yo(),r=Kt("markstreamNestedRendererProps",void 0);function l(M){var W,G;const Y=o[M];return(function(ie){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,ie)||Object.prototype.hasOwnProperty.call(_e,String(ie).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?Y:(G=(W=r?.value)==null?void 0:W[M])!=null?G:Y}const a={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:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=B(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=B(()=>{const M=l("renderCodeBlocksAsPre"),W=l("codeRenderer");return M===!0?"pre":W==="pre"||W==="shiki"||W==="monaco"?W:M===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=B(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=B(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=B(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=B(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=B(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=B(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=B(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=B(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=B(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=B(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),N=B(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function I(M){s("height-change",M)}function E(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=X(),L=X(null),R=X(null),D=X(null),z=Bo({1:null,2:null,3:null,4:null,5:null,6:null}),H=X(!1),U=new Map,Z=X(0),K=X(0),V=X({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function J(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(W=o.virtualScroll)==null?void 0:W.scrollRoot;return fe(typeof G=="function"?G():G)}function fe(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?fe(M.value):typeof M=="object"&&"$el"in M?fe(M.$el):null:null}const{isClient:oe,renderAsFragment:ce,debugPerformanceEnabled:ue,resolvedShowTooltips:Se,resolvedHtmlPolicy:Te,inheritedSmoothStreaming:Ae,ownsTypewriterCursor:P}=(function(M){const W=typeof window<"u",G=Vd(),Y=Kt("markstreamHtmlPolicy",void 0),ie=Kt("markstreamTypewriterCursor",void 0),_e=Kt("markstreamSmoothStreaming",void 0),Me=B(()=>M.renderAsFragment===!0),Le=B(()=>!!(M.debugPerformance&&W&&typeof console<"u")),qe=B(()=>{var je;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(je=G.showTooltips)!=null?je:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=B(()=>{var je,Be;return(Be=(je=M.htmlPolicy)!=null?je:Y?.value)!=null?Be:"safe"}),Ge=B(()=>ie?.value!==!0);return{isClient:W,renderAsFragment:Me,debugPerformanceEnabled:Le,resolvedShowTooltips:qe,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:ie,ownsTypewriterCursor:Ge}})(x),{resolveViewportRoot:le,resolveScrollContainer:ne,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ge}=(function(M,W){function G(){var Le,qe;return(qe=(Le=W.scrollRoot)==null?void 0:Le.call(W))!=null?qe:null}function Y(Le){if(typeof window>"u")return null;const qe=G();if(qe)return qe;const Re=Le??M.value;if(!Re)return null;const Ge=Re.ownerDocument||document,je=Ge.scrollingElement||Ge.documentElement;let Be=Re;for(;Be&&Be!==Ge.body&&Be!==je;){if(Aee(window.getComputedStyle(Be))&&Mee(Be))return Be;Be=Be.parentElement}return null}function ie(Le){if(!W.isClient)return!1;try{const qe=window.getComputedStyle(Le);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Le,qe,Re){var Ge,je;if(Re)return Me(qe);const Be=Le.scrollTop;if(!ie(Le))return Be;const Ke=Be<0?-Be:Be;return Math.max(0,((Ge=Le.scrollHeight)!=null?Ge:0)-((je=Le.clientHeight)!=null?je:0))-Ke}function Me(Le){var qe,Re,Ge,je,Be;const Ke=Number((qe=Le.scrollingElement)==null?void 0:qe.scrollTop),tt=Number((Ge=(Re=Le.documentElement)==null?void 0:Re.scrollTop)!=null?Ge:0),nt=Number((Be=(je=Le.body)==null?void 0:je.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ke)?Ke:0,Number.isFinite(tt)?tt:0,Number.isFinite(nt)?nt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Le){var qe,Re,Ge,je;const Be=G();if(Be)return Be;const Ke=Y((qe=Le??M.value)!=null?qe:null);if(Ke)return Ke;const tt=(je=(Ge=Le?.ownerDocument)!=null?Ge:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?je:typeof document<"u"?document:null;return tt?.scrollingElement||tt?.documentElement||null},isReverseFlexScrollRoot:ie,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Le,qe){const Re=qe.ownerDocument||Le.ownerDocument||document;if((function(Ke,tt){return Ke===tt.documentElement||Ke===tt.body||Ke===tt.scrollingElement})(qe,Re))return Le.getBoundingClientRect().top+Me(Re);const Ge=qe.getBoundingClientRect(),je=Le.getBoundingClientRect(),Be=_e(qe,Re,!1);return je.top-Ge.top+Be}}})(S,{isClient:oe,scrollRoot:J});Ln("markstreamShowTooltips",Se),Ln("markstreamHtmlPolicy",Te),Ln("markstreamTypewriter",B(()=>x.typewriter!==!1)),Ln("markstreamFade",B(()=>x.fade!==!1)),Ln("markstreamTypewriterCursor",B(()=>!0)),Ln("markstreamTextStreamState",U),Ln("markstreamStreamVersion",Z),Ln("markstreamParseOptions",B(()=>x.parseOptions)),Ln("markstreamCustomMarkdownIt",B(()=>x.customMarkdownIt));const{smoothStreamingEnabled:de,renderContent:ve,effectiveFinal:j}=(function(M,W){const G=Cee(M.smoothStreamingOptions),Y=B(()=>{var Re,Ge,je;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ge=W.inheritedSmoothStreaming)!=null&&Ge.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((je=M.maxLiveNodes)!=null?je:0)<=0)}),ie=X(!W.isClient||M.smoothStreaming===!0);cn(()=>{ie.value=!0});const _e=B(()=>ie.value&&Y.value),Me=B(()=>{var Re;return _e.value?G.visible.value:(Re=M.content)!=null?Re:""}),Le=B(()=>{var Re,Ge;const je=(Re=M.parseOptions)!=null?Re:{};return(Ge=M.final)!=null?Ge:je.final}),qe=B(()=>{const Re=Le.value;return _e.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Qe([()=>M.content,()=>M.nodes,_e,Le],([Re,Ge,je,Be])=>{if(Ge?.length)return void G.reset("");const Ke=Re??"";if(!je)return G.reset(Ke),void(Be&&G.finish({flush:!0}));const tt=G.source.value;Ke?Ke===tt||(Ke.startsWith(tt)?G.enqueue(Ke.slice(tt.length)):G.reset(Ke)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:_e,renderContent:Me,requestedFinal:Le,effectiveFinal:qe}})(x,{isClient:oe,inheritedSmoothStreaming:Ae});Ln("markstreamSmoothStreaming",de);const te=X(!1);let pe="",Ce=!1,$e=null;function De(){oe&&$e!=null&&(window.clearTimeout($e),$e=null)}function me(){te.value=!1,De()}function Ie(M,W){if(!ue.value)return;const G=(function(){if(!ue.value)return null;const Y=It(et),ie=It(rt),_e=Math.max(gt,ie);if(Y<=0&&_e<=0)return null;const Me={total:Y,maxPerFrame:_e,byLabel:(Le=et,Object.fromEntries(Array.from(Le.entries()).sort((qe,Re)=>Re[1]-qe[1]||qe[0].localeCompare(Re[0]))))};var Le;return et.clear(),rt.clear(),gt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,G?Pt(lt({},W),{layoutReads:G}):W)}Qe([ve,()=>o.nodes,j],([M,W,G])=>{const Y=M??"";return W?.length||G===!0?(me(),pe=Y,void(Ce=!0)):Ce?(pe&&Y.length>pe.length&&Y.startsWith(pe)?(te.value=!0,oe&&(De(),$e=window.setTimeout(()=>{var ie;$e=null,j.value===!0||(ie=o.nodes)!=null&&ie.length||(Qa(),te.value=!1,dr())},1200))):(Y.lengthW.clear()}})(un),ns=B(()=>`${un}:${Z.value}`);Ln(e5,dn);const Wt=Co(()=>x.customId),{effectiveCustomHtmlTagsSet:Hn,mergedParseOptions:lo,parsedNodes:it}=_ee(x,{instanceMsgId:un,renderContent:ve,effectiveFinal:j,smoothStreamingEnabled:de,debugPerformanceEnabled:ue,customComponentsMap:Wt,logPerf:Ie});Qe(it,()=>{dn.clear(),Z.value+=1},{immediate:!0});const Gn=B(()=>({customId:x.customId,customHtmlTags:lo.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Te.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Se.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));Ln("markstreamNestedRendererProps",Gn);const ao=B(()=>it.value),Yn=B(()=>it.value.length),go=X(null),os=X(null),qn=X(null),to=X(null),vn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Zn=!vn&&x.customId?XS(x.customId):null,xn=B(()=>Zn?(QS.value,XS(x.customId)):null),An=B(()=>{var M;return!!(oe&&!ce.value&&x.customId&&!vn&&((M=xn.value)!=null&&M.enabled))}),Mn=B(()=>{var M;return!!(!ce.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Do=X(!1);cn(()=>{Do.value=!0});const ze=B(()=>!!(oe&&Mn.value));Ln("markstreamHostScrollManaged",ze);const Xe=B(()=>!!(Do.value&&ze.value)),kt=B(()=>An.value||ze.value),Ht=B(()=>An.value||Xe.value),Rn=B(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.textEstimation)!==!1}),sn=B(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Gt(){const M=K.value||ht("getMeasuredContainerWidth.clientWidth",()=>{var W;return((W=S.value)==null?void 0:W.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const Wn=B(()=>{const M=Gt();return M>0?Math.max(1,Math.round(M)):640}),En=B(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),St=B(()=>{var M;return!ce.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?it.value.length>0:it.value.length>En.value)}),Po=B(()=>St.value||An.value||ze.value),Ao=B(()=>x.viewportPriority!==!1&&!H.value),ss=dJ(M=>{var W;return le((W=M??S.value)!=null?W:null)},Ao),{requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,isTestEnv:ti}=(function(M){const W=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",ie=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Me?.env})();return{requestFrame:W,cancelFrame:G,hasIdleCallback:Y,isTestEnv:ie?.NODE_ENV==="test"}})({isClient:oe}),{resolvedBatchSize:Io,resolvedInitialBatch:Ss,batchingEnabled:Wi,incrementalRenderingActive:Si,renderedCount:co,previousRenderContext:ni,adaptiveBatchSize:Ci,previousBatchConfig:ar}=(function(M,W){var G;const Y=B(()=>{var je;const Be=Math.trunc((je=M.renderBatchSize)!=null?je:80);return Number.isFinite(Be)?Math.max(0,Be):0}),ie=B(()=>{var je;const Be=Math.trunc((je=M.initialRenderBatchSize)!=null?je:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),_e=B(()=>!W.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&W.isClient&&!W.isTestEnv),Me=X(0),Le=X({key:M.indexKey,total:0}),qe=X(Math.max(1,Y.value||1)),Re=B(()=>{var je;return _e.value&&((je=M.maxLiveNodes)!=null?je:0)<=0}),Ge=X({batchSize:Y.value,initial:ie.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:ie,batchingEnabled:_e,incrementalRenderingActive:Re,renderedCount:Me,previousRenderContext:Le,adaptiveBatchSize:qe,previousBatchConfig:Ge}})(x,{isClient:oe,isTestEnv:ti,renderAsFragment:ce}),no=new Map,is=new Map,rs=new WeakMap;let Lo=null;const Ai=new WeakMap,zn=new Map,$o=X(0),oi=B(()=>($o.value,Array.from(no.entries()).sort((M,W)=>M[0]-W[0]))),Ue=X(null),Fe=X(null);let se=null,Ne=0,he=null;const{activeRestoreAnchor:we,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:Rt,resolveAnchorOffset:Dt,clearRestoreReconcile:rn,scheduleRestoreReconcile:Un,captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:be}=(function(M){const{isClient:W,containerRef:G,parsedNodeCount:Y,requestFrame:ie,cancelFrame:_e,resolveScrollContainer:Me,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ge,estimateHeightRange:je,getFallbackNodeHeight:Be,clamp:Ke}=M,tt=X(null);let nt=null,wt=[];function at(){const Lt=Me(),qt=G.value;if(!Lt||!qt)return null;const zt=Lt.ownerDocument||qt.ownerDocument||document;if(Lt===zt.documentElement||Lt===zt.body||Lt===zt.scrollingElement){const fn=qt.getBoundingClientRect();return Math.max(0,-fn.top)}return Math.max(0,Le(Lt,zt,!1)-qe(qt,Lt))}function ft(Lt){var qt;const zt=Me(),fn=G.value;if(!zt||!fn)return;const Us=Math.max(0,Lt),as=zt.ownerDocument||fn.ownerDocument||document,Mi=as.defaultView||(typeof window<"u"?window:null);if(zt===as.documentElement||zt===as.body||zt===as.scrollingElement){const Qr=Le(zt,as,!0)+fn.getBoundingClientRect().top;return void((qt=Mi?.scrollTo)==null||qt.call(Mi,0,Math.max(0,Qr+Us)))}tC(zt,as,qe(fn,zt)+Us,{isReverseFlexScrollRoot:Qr=>{var Xr;return(Xr=Re?.(Qr))!=null&&Xr},getNormalizedScrollTop:Le})}function Et(Lt){const qt=Y.value,zt=Ke(Lt.nodeIndex,0,Math.max(0,qt-1));return je(0,zt)+Math.max(0,Lt.offsetWithinNodePx)}function At(){if(nt!=null&&(_e?.(nt),nt=null),W)for(const Lt of wt)window.clearTimeout(Lt);wt=[]}function tn(Lt){const qt=Et(Lt),zt=at();zt!=null&&Math.abs(zt-qt)<=.5||ft(qt)}return{activeRestoreAnchor:tt,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Et,clearRestoreReconcile:At,applyRestoreAnchor:tn,scheduleRestoreReconcile:function(){tt.value&&W&&nt==null&&(nt=ie?ie(()=>{nt=null,tt.value&&tn(tt.value)}):null,nt==null&&tt.value&&tn(tt.value))},captureRestoreAnchor:function(){const Lt=at(),qt=Y.value;if(Lt==null||qt<=0)return null;const zt=Ke(Ge(Lt+1),0,qt-1),fn=je(0,zt),Us=Be(zt);return{nodeIndex:zt,offsetWithinNodePx:Ke(Lt-fn,0,Math.max(0,Us-1))}},restoreAnchor:function(Lt){const qt=Y.value;if(tt.value={nodeIndex:Ke(Lt.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Lt.offsetWithinNodePx)},At(),tn(tt.value),W)for(const zt of[0,120,280,480])wt.push(window.setTimeout(()=>{tt.value&&tn(tt.value)},zt))},getAnchorDrift:function(Lt){const qt=at();return qt==null?null:qt-Et(Lt)}}})({isClient:oe,containerRef:S,parsedNodeCount:Yn,requestFrame:Tn,cancelFrame:jn,resolveScrollContainer:()=>Ue.value||ne(),getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:q,estimateIndexForOffset:R1,estimateHeightRange:Zr,getFallbackNodeHeight:pf,clamp:Wo}),{nodeHeights:ke,heightStats:Oe,heightTreeSize:Ye,heightSumTree:st,heightKnownTree:Ct,averageNodeHeight:Ot,resetHeightMeasurements:uo,pruneHeightMeasurements:jt,rebuildHeightTrees:wn,recordNodeHeight:ls,removeNodeHeights:Mt,exportHeightCache:Nt,importHeightCache:Vt,fenwickRangeSum:fo}=(function(M={}){const W=Bo({}),G=Bo({total:0,count:0}),Y=X(0),ie=X([]),_e=X([]);function Me(){for(const Be of Object.keys(W))delete W[Number(Be)];G.total=0,G.count=0,Y.value=0,ie.value=[],_e.value=[]}function Le(Be,Ke,tt){for(let nt=Ke+1;nt0;nt-=nt&-nt)tt+=Be[nt];return tt}function Re(Be){Y.value=Be;const Ke=new Array(Be+1).fill(0),tt=new Array(Be+1).fill(0);for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0||(Le(Ke,at,ft),Le(tt,at,1))}ie.value=Ke,_e.value=tt}function Ge(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ke=W[Be];if(!Number.isFinite(Ke)||Ke<=0)return!1;if(delete W[Be],G.total=Math.max(0,G.total-Ke),G.count=Math.max(0,G.count-1),Y.value>Be){const tt=ie.value,nt=_e.value;tt.length&&nt.length&&(Le(tt,Be,-Ke),Le(nt,Be,-1))}return!0}const je=B(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:W,heightStats:G,heightTreeSize:Y,heightSumTree:ie,heightKnownTree:_e,averageNodeHeight:je,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Be){if(Be<=0)return void Me();let Ke=0,tt=0;for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0?delete W[at]:(Ke+=ft,tt++)}G.total=Ke,G.count=tt},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ke,tt={}){(function(nt,wt,at={}){var ft;if(!Number.isFinite(wt)||wt<=0)return!1;const Et=W[nt];if(Et&&(at.allowShrink===!1&&wtnt){const At=ie.value,tn=_e.value;if(At.length&&tn.length)if(Et){const Lt=wt-Et;Lt!==0&&Le(At,nt,Lt)}else Le(At,nt,wt),Le(tn,nt,1)}at.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Be,Ke,Pt(lt({},tt),{notify:!0}))},removeNodeHeight:function(Be,Ke={}){var tt;const nt=Ge(Be);return nt&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},removeNodeHeights:function(Be,Ke={}){var tt;let nt=0;for(const wt of Be)Ge(Number(wt))&&nt++;return nt>0&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},exportHeightCache:function(){return Object.entries(W).map(([Be,Ke])=>({index:Number(Be),height:Number(Ke)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ke)=>Be.index-Ke.index)},importHeightCache:function(Be,Ke={}){var tt;if(!Array.isArray(Be))return;const nt=Y.value;let wt=!1;if(Ke.mode!=="merge"){const at=Object.keys(W);if(at.length>0){for(const ft of at)delete W[Number(ft)];wt=!0}}for(const at of Be){const ft=Number(at.index),Et=Number(at.height);if(!Number.isInteger(ft)||ft<0||nt>0&&ft>=nt||!Number.isFinite(Et)||Et<=0)continue;const At=W[ft];At&&Math.abs(At-Et)<=1||(W[ft]=Et,wt=!0)}wt&&((function(){let at=0,ft=0;const Et=Y.value;for(const[At,tn]of Object.entries(W)){const Lt=Number(At),qt=Number(tn);!Number.isFinite(Lt)||Lt<0||Et>0&&Lt>=Et||!Number.isFinite(qt)||qt<=0?delete W[Lt]:(at+=qt,ft++)}G.total=at,G.count=ft})(),nt>0&&Re(nt),(tt=M.onHeightRecorded)==null||tt.call(M))},fenwickRangeSum:function(Be,Ke,tt){if(tt<=Ke)return 0;const nt=qe(Be,tt-1);return Ke<=0?nt:nt-qe(Be,Ke-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&Cu(),we.value&&Un(),Fe.value&&Ga(),Bn("node-resize")}});function oo(){uo(),zn.clear()}function zi(M){!Number.isInteger(M)||M<0||M>=it.value.length||zn.set(M,pu(M))}function Ul(M,W,G={}){const Y=ke[M];ls(M,W,G);const ie=ke[M];ie&&ie>0?zi(M):Y&&zn.delete(M)}function ql(M,W){const G=ht("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,ie;return(ie=(Y=no.get(M))==null?void 0:Y.offsetHeight)!=null?ie:0});return G>0?G:ht("getNodeLayoutHeight.content.offsetHeight",()=>W.offsetHeight)}function lf(M,W={}){Vt(M,W),M1()}const Vr=B(()=>{var M;return!ce.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!St.value&&!(it.value.length>900)&&Ao.value}),g2=B(()=>!!ss&&(Vr.value||St.value)),v2=B(()=>St.value||ze.value),{liveNodeBufferResolved:uu,focusIndex:si,liveRange:Ho,updateLiveRange:jl}=(function(M,W){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:ie,clamp:_e}=W,Me=B(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Le=X(0),qe=Bo({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Le,liveRange:qe,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return qe.start=0,void(qe.end=Re);const Ge=Math.min(ie.value,Re),je=Me.value,Be=_e(Le.value-je,0,Math.max(0,Re-Ge));qe.start=Be,qe.end=Math.min(Re,Be+Ge)}}})(x,{parsedNodeCount:Yn,virtualizationEnabled:St,maxLiveNodesResolved:En,clamp:Wo}),Ui=new Map,Vl=new Map,Kr=new Map,af=[],cr=new Map,Gr=new Set,y2=X(0);let e1=!1;const k2=B(()=>(y2.value,Gr.size)),Hs=new Map,qi=new Map,b2=X(0),t1=B(()=>{b2.value;let M=0;for(const W of Hs.values())M+=Math.max(0,W);return M});let Ws=null,n1=!0,x2=[0],w2="";function ii(){n1=!0}const cf=B(()=>{if(!St.value)return it.value.length;const M=uu.value,W=Math.max(Ho.end+M,Ss.value),G=Math.min(it.value.length,W);return Math.max(co.value,G)});function uf(){e1||(e1=!0,queueMicrotask(()=>{e1=!1,y2.value+=1}))}function _2(M,W,G="node-resize"){if(!oe||typeof window>"u")return null;const Y=window.setTimeout(()=>{Gr.delete(Y)&&uf();try{W()}finally{Bn(G)}},Math.max(0,M));return Gr.add(Y),uf(),Y}function df(M){oe&&M!=null&&(Gr.delete(M)&&uf(),window.clearTimeout(M))}function S2(){if(oe&&typeof window<"u")for(const M of Gr)window.clearTimeout(M);Gr.size&&(Gr.clear(),uf()),af.length=0,Kr.clear()}function F8(M){var W,G;return(G=(W=to.value)==null?void 0:W[M])!=null?G:null}const{cancelScheduledFocusSync:o1,scheduleFocusSync:ji}=(function(M){const{isClient:W,containerRef:G,virtualizationEnabled:Y,requestFrame:ie,cancelFrame:_e,syncFocusToScroll:Me}=M;let Le=null;function qe(){var Ge,je,Be;return(Be=(je=(Ge=G.value)==null?void 0:Ge.ownerDocument)==null?void 0:je.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Le)return;const Ge=qe();Le.viaTimeout?Ge?Ge.clearTimeout(Le.id):clearTimeout(Le.id):_e?.(Le.id),Le=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ge={}){if(!Y.value)return;if(!W)return void Me(!0);if(Ge.immediate)return Re(),void Me(!0);if(Le)return;const je=()=>{Le=null,Me()};if(ie)return void(Le={id:ie(je),viaTimeout:!1});const Be=qe();Le={id:Be?Be.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:oe,containerRef:S,virtualizationEnabled:St,requestFrame:Tn,cancelFrame:jn,syncFocusToScroll:function(M=!1){var W;if(!St.value)return;const G=Ue.value||ne();if(!G)return;const Y=G.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,ie=Y?.defaultView||(typeof window<"u"?window:null),_e=G===Y?.documentElement||G===Y?.body,Me=it.value.length;if(!_e&&Me>0&&q(G)){const tt=ht("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),nt=ht("syncFocusToScroll.scrollTop",()=>G.scrollTop),wt=nt<0?-nt:nt,at=(function(Et){var At,tn;const Lt=it.value;if(!Lt.length)return 0;if(Et<=0)return Math.max(0,Lt.length-1);if(kt.value){const zt=(At=a1()[Lt.length])!=null?At:0;return L2(Math.max(0,zt-Et))}if(Ye.value===Lt.length){const zt=Zr(0,Lt.length);return R1(Math.max(0,zt-Et))}let qt=Et;for(let zt=Lt.length-1;zt>=0;zt--){const fn=(tn=ke[zt])!=null?tn:Ot.value;if(qt<=fn)return zt;qt-=fn}return 0})(Math.max(0,wt)+.5*Math.max(0,tt)),ft=Wo(at,0,Math.max(0,Me-1));return void((M||Math.abs(ft-si.value)>1)&&(si.value=ft,jl()))}const Le=_e?null:ht("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),qe=_e?0:Le.top,Re=_e?ht("syncFocusToScroll.viewport.clientHeight",()=>{var tt,nt;return(nt=(tt=ie?.innerHeight)!=null?tt:G.clientHeight)!=null?nt:0}):Le.bottom,Ge=oi.value;let je=null,Be=null;for(const[tt,nt]of Ge){if(!nt)continue;const wt=ht("syncFocusToScroll.slot.getBoundingClientRect",()=>nt.getBoundingClientRect());wt.bottom<=qe||wt.top>=Re||(je==null&&(je=tt),Be=tt)}if(je==null||Be==null){const tt=S.value;if(!tt)return;const nt=_e?{top:0}:ht("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),wt=ht("syncFocusToScroll.fallback.scrollTop",()=>ee(G,Y,_e)),at=_e?(()=>{const At=ht("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>tt.getBoundingClientRect()),tn=(_e?0:nt.top)-At.top;return Math.max(0,tn)})():(()=>{const At=ge(tt,G);return Math.max(0,wt-At)})(),ft=_e?ht("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var At,tn,Lt,qt;return(qt=(Lt=(tn=ie?.innerHeight)!=null?tn:(At=Y?.documentElement)==null?void 0:At.clientHeight)!=null?Lt:G.clientHeight)!=null?qt:0}):ht("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),Et=R1(at+.5*Math.max(0,ft));return si.value=Wo(Et,0,Math.max(0,it.value.length-1)),void jl()}const Ke=Math.round((je+Be)/2);!M&&Math.abs(Ke-si.value)<=1||(si.value=Wo(Ke,0,Math.max(0,it.value.length-1)),jl())}}),{visibleNodeIndices:s1,nodeVisibilityHandles:Wa,nodeVisibilityWatchStops:ff,nodeVisibilityFallbackTimers:C2,clearVisibilityFallback:hf,markNodeVisible:Yr,cleanupNodeVisibility:O8,destroyNodeVisibilityState:i1}=See({isClient:oe,shouldTrackVisibleNodeIndices:()=>Vr.value,shouldCleanupNodeVisibility:()=>St.value,onNodeMarkedVisible:M=>{St.value?ji():si.value=Wo(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{no.delete(M)&&eb()}}),{cleanupScrollListener:A2,setupScrollListener:R8}=(function(M){const{isClient:W,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:ie,resolveScrollContainer:_e,scheduleFocusSync:Me,onScroll:Le}=M;let qe=null,Re=null;function Ge(){qe&&(qe(),qe=null),Re=null,ie.value=null}function je(Be){const Ke=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ke)?Math.abs(Ke):0)}return{cleanupScrollListener:Ge,setupScrollListener:function(){if(!W)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ge();var Be;const Ke=_e();if(!Ke)return void Ge();if(ie.value===Ke&&qe)return;Ge(),Re=je(Ke);const tt=()=>{if(Le?.(),G.value){const nt=(function(wt){const at=je(wt),ft=Re;Re=at;const Et=Math.max(480,.75*(wt.clientHeight||0));return ft==null?at>Et?{immediate:!0}:void 0:Math.abs(at-ft)>Et?{immediate:!0}:void 0})(Ke);nt?Me(nt):Me()}};Ke.addEventListener("scroll",tt,{passive:!0}),ie.value=Ke,qe=()=>{Ke.removeEventListener("scroll",tt)}}}})({isClient:oe,virtualizationEnabled:St,listenerEnabled:v2,scrollRootElement:Ue,resolveScrollContainer:ne,scheduleFocusSync:ji,onScroll:function(){const M=Fe.value;if(!M)return;const W=hu();if(!W||(function(Y){if(ku()>=Ne)return he=null,!1;const ie=he;if(ie==null)return!0;const _e=Math.abs(Y.scrollTop-ie)<=2;return _e||(he=null),_e})(W))return;const G=W2(W);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&Ka("restore"):Ka("restore")},getScrollTop:M=>{var W;const G=M.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ht("scrollListener.getScrollTop",()=>ee(M,G,Y))}});function Wo(M,W,G){return Math.min(Math.max(M,W),G)}function r1(M){return M?.firstElementChild}function M2(M,W){var G;return M?(G=M.matches)!=null&&G.call(M,W)?M:M.querySelector(W):null}function E2(){if(!kt.value)return void(K.value=0);const M=ht("updateExperimentContainerWidth.clientWidth",()=>{var W,G;return(G=(W=S.value)==null?void 0:W.clientWidth)!=null?G:0});K.value=M>0?M:0}let du=null;function l1(){du?.disconnect(),du=null}const T2=Li({loader:()=>Xn(null,null,function*(){return(yield ms(()=>import("./index8-BSZNwbg_.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:KM,delay:0,suspensible:!1});function N2(M){return M===T2}const I2=B(()=>u.value==="pre"?qs:u.value==="shiki"?T2:j0),Kl=B(()=>{const M=it.value;if(!M.length||!kt.value)return M.map(()=>null);const W=K.value||ht("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(W)||W<=0?M.map(()=>null):M.map((G,Y)=>{const ie=ke[Y],_e=typeof ie=="number"&&ie>0;if(Rn.value&&!_e){const Le=JM(G,W,V.value);if(Le)return Le}if(sn.value&&G.type==="code_block"){const Le=(function(qe){if(qe.type!=="code_block")return null;const Re=hb(qe,xf(qe));return N2(Re)?"markdown":Re===qs?"pre":Re===I2.value||Re===j0?"monaco":null})(G);if(Le==="monaco"||Le==="markdown"||Le==="pre")return cee(G,{rendererKind:Le,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function pf(M){var W;const G=ke[M];if(Number.isFinite(G)&&G>0)return G;const Y=(W=Kl.value[M])==null?void 0:W.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Ot.value,(function(ie){var _e,Me,Le,qe,Re,Ge,je,Be,Ke,tt,nt,wt,at;const ft=it.value[ie];if(!ft||typeof ft!="object")return 32;const Et=String((_e=ft.type)!=null?_e:""),At=Gt()||640;switch(Et){case"heading":return 44;case"paragraph":return za(String((Le=(Me=ft.raw)!=null?Me:ft.content)!=null?Le:""),At,34);case"list":{const tn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*tn+12)}case"list_item":return za(String((Re=(qe=ft.raw)!=null?qe:ft.content)!=null?Re:""),At,34);case"blockquote":return za(String((je=(Ge=ft.raw)!=null?Ge:ft.content)!=null?je:""),At,56);case"table":{const tn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*tn+48)}case"code_block":return za(String((Ke=(Be=ft.code)!=null?Be:ft.raw)!=null?Ke:""),At,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return za(String((nt=(tt=ft.raw)!=null?tt:ft.content)!=null?nt:""),At,96);case"thematic_break":return 24;default:return za(String((at=(wt=ft.raw)!=null?wt:ft.content)!=null?at:""),At,40)}})(M))}function za(M,W,G,Y=22){const ie=String(M??"");if(!ie)return G;const _e=Math.max(18,Math.floor(Math.max(320,W)/8)),Me=ie.split(/\r?\n/).length,Le=Math.ceil(ie.length/_e),qe=Math.max(1,Me,Le);return Math.max(G,Math.ceil(qe*Y+12))}function fu(M){const W=Number(M);return!Number.isFinite(W)||W<=0?-1:Math.round(W/32)}function a1(){var M,W;const G=it.value.length,Y=fu(K.value||ht("getFallbackHeightPrefix.clientWidth",()=>{var Le;return((Le=S.value)==null?void 0:Le.clientWidth)||0})),ie=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),_e=[G,Oe.count,Math.round(Oe.total),Math.round(100*Ot.value),ie,Y,kt.value?1:0,QS.value,Z.value].join(":");if(!n1&&w2===_e)return x2;const Me=new Array(G+1);Me[0]=0;for(let Le=0;Le=((W=ie[Y])!=null?W:0))return Y-1;let _e=0,Me=Y-1,Le=Y-1;for(;_e<=Me;){const qe=_e+Me>>1;((G=ie[qe+1])!=null?G:0)>=M?(Le=qe,Me=qe-1):_e=qe+1}return Le}function Zr(M,W){var G,Y;if(M>=W)return 0;if(kt.value)return(function(Me,Le){var qe,Re;const Ge=it.value.length,je=Wo(Math.trunc(Me),0,Ge),Be=Wo(Math.trunc(Le),je,Ge);if(je>=Be)return 0;const Ke=a1();return((qe=Ke[Be])!=null?qe:0)-((Re=Ke[je])!=null?Re:0)})(M,W);if(Ye.value!==it.value.length){let Me=0;for(let Le=M;Leit.value.length,M=>{ii(),M<=0?oo():(M{if(!St.value)return it.value.map((Y,ie)=>({node:Y,index:ie}));const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);return it.value.slice(W,G).map((Y,ie)=>({node:Y,index:W+ie}))}),c1=B(()=>St.value?Zr(0,Math.min(Ho.start,it.value.length)):0),u1=B(()=>{if(!St.value)return 0;const M=it.value.length;return Zr(Math.min(Ho.end,M),M)});function $2(){if(!kt.value)return 0;let M=0;const W=Kl.value;for(let G=0;G0||M++}return M}function F2(){const M=it.value.length;return{totalNodes:M,measuredCount:Oe.count,estimatedCount:$2(),averageNodeHeight:Ot.value,topSpacerHeight:c1.value,bottomSpacerHeight:u1.value,estimatedTotalHeight:Zr(0,M),width:Gl()}}function D8(){const M=it.value,W=F2();return Pt(lt({},W),{probe:{paragraphReady:!!V.value.paragraph,listItemReady:!!V.value.listItem,listWrapperOverhead:V.value.listWrapperOverhead,headingReadyLevels:Object.entries(V.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var ie,_e,Me,Le,qe,Re,Ge,je,Be;return{index:Y,type:G.type,estimateKind:(_e=(ie=Kl.value[Y])==null?void 0:ie.kind)!=null?_e:null,rendererKind:(Le=(Me=Kl.value[Y])==null?void 0:Me.rendererKind)!=null?Le:null,estimatedHeight:(Re=(qe=Kl.value[Y])==null?void 0:qe.height)!=null?Re:null,estimatedContentHeight:(je=(Ge=Kl.value[Y])==null?void 0:Ge.contentHeight)!=null?je:null,measuredHeight:(Be=ke[Y])!=null?Be:null}})})}function d1(){return o.indexKey!=null?String(o.indexKey):Mn.value?`virtual-${Vn()}`:"markdown-renderer"}function O2(M){const W=String(M),G=`${d1()}-`;if(!W.startsWith(G))return null;const Y=W.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const ie=Number(Y[1]);return!Number.isInteger(ie)||ie<0||ie>=it.value.length?null:ie}function Vn(){var M,W,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(W=o.indexKey)!=null?W:x.customId)!=null?G:un)}function Mo(){var M;const W=(M=o.virtualScroll)==null?void 0:M.threadKey;return W==null||W===""?void 0:String(W)}function f1(M){var W;return(M??"")===((W=Mo())!=null?W:"")}function P8(){var M;const W=(M=o.virtualScroll)==null?void 0:M.measurementKey;return W==null?"":String(W)}function H8(){var M,W;const G=u.value,Y=G==="monaco"?x.codeBlockMonacoOptions:void 0,ie=x.codeBlockProps,_e=G==="shiki";return[x.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",Fo(x.codeBlockMinWidth),Fo(x.codeBlockMaxWidth),..._e?[Mp((M=ie?.themes)!=null?M:x.themes,(W=ie?.langs)!=null?W:x.langs)]:[],Fo(Y?.fontSize),Fo(Y?.lineHeight),Fo(Y?.fontFamily),Fo(Y?.tabSize),Fo(Y?.MAX_HEIGHT),Fo(Y?.wordWrap),Fo(Y?.wrappingIndent),Fo(Y?.padding),Fo(ie?.showHeader),Fo(ie?.showCopyButton),Fo(ie?.showExpandButton),Fo(ie?.showPreviewButton),Fo(ie?.showCollapseButton),Fo(ie?.showFontSizeButtons)].join("\0")}function ur(){return[P8(),H8()].join("\0")}function Gl(){return Gt()}const mf=B(()=>fu(Gl())),zs=B(()=>[ur(),mf.value].join("\0")),W8=B(()=>{var M;return Mn.value?["virtual",(M=Mo())!=null?M:"",Vn(),zs.value].join("\0"):o.indexKey});function Ua(){b2.value+=1}function h1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==Vn()||M.threadKey!==Mo()||M.layoutEpochKey!==zs.value)}function R2(M){const W=String(M),G=qi.get(W);return G?h1(G)?G.index:null:O2(W)}function B2(M="async-node"){(Hs.size||qi.size)&&(Hs.clear(),qi.clear(),Ua(),Bn(M))}const qa=Kt(yv,null),p1={reportHeight(M,W){if(!ze.value)return;const G=R2(M);if(G==null)return;const Y=Ui.get(G);if(!Y)return;const ie=Number(W),_e=ql(G,Y);Ul(G,Number.isFinite(ie)&&ie>0?Math.max(ie,_e||0):_e)},markPending(M){if(!ze.value)return;const W=O2(M);W!=null&&(function(G,Y){var ie;const _e=qi.get(G);if(_e&&h1(_e))return Hs.set(G,Math.max(0,(ie=Hs.get(G))!=null?ie:0)+1),Ua(),void Bn("async-node");Hs.set(G,1),qi.set(G,(function(Me){return{index:Me,sessionKey:Vn(),threadKey:Mo(),layoutEpochKey:zs.value}})(Y)),Ua(),Bn("async-node")})(String(M),W)},markSettled(M){if(!ze.value)return;const W=String(M),G=R2(M);(G!=null||(function(Y){return Hs.has(String(Y))})(W))&&(function(Y){var ie;const _e=(ie=Hs.get(Y))!=null?ie:0;return!(_e<=0||(_e<=1?(Hs.delete(Y),qi.delete(Y)):Hs.set(Y,_e-1),Ua(),_e===1&&Bn("async-node"),0))})(W)&&G!=null&&dr()}};function z8(){let M=0;for(const W of Ui.values())M+=ht("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=W?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}Ln(yv,{reportHeight(M,W){p1.reportHeight(M,W),qa?.reportHeight(M,W)},markPending(M){p1.markPending(M),qa?.markPending(M)},markSettled(M){p1.markSettled(M),qa?.markSettled(M)}});let m1,g1=null,ja=null;function gf(M){return M!==!1&&M!=null&&M!==""}function D2(){return St.value?(function(){if(!St.value)return!0;const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);if(W>=G)return!0;for(let Y=W;Y=cf.value}function v1(){return j.value===!0&&!te.value&&t1.value===0&&Gr.size===0&&cr.size===0&&Ws==null&&D2()}function P2(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||g1===Vn()&&m1===Mo())return!0;const G=(W=o.virtualScroll)==null?void 0:W.settledToken;return!!gf(G)&&ja===Au(G)}function y1(){return v1()&&P2()}function U8(M,W){return W.totalNodes<=0?M==="final"?"final":"estimate":W.measuredCount>=W.totalNodes?M==="final"?"final":"measured":W.measuredCount>0||W.estimatedCount>0?"mixed":"estimate"}function Yl(M="manual",W){const G=F2(),Y=(function(ie){return ie||(j.value!==!0?it.value.length>0?"streaming":"estimating":!D2()||cr.size>0||Ws!=null?"measuring":y1()?"settled":"settling")})(W);return{sessionKey:Vn(),threadKey:Mo(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Ho.start,end:Ho.end},renderedCount:co.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:z8(),totalHeight:H2(),width:G.width,final:j.value===!0,stable:y1(),confidence:U8(Y,G),reason:M}}function hu(){const M=Ue.value||ne(),W=S.value;if(!M||!W)return null;const G=M.ownerDocument||W.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,ie=ht("getScrollBox.scrollTop",()=>ee(M,G,Y)),_e=ht("getScrollBox.scrollHeight",()=>{var Le,qe,Re,Ge,je;return Y?Math.max((qe=(Le=G.documentElement)==null?void 0:Le.scrollHeight)!=null?qe:0,(Ge=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ge:0,(je=M.scrollHeight)!=null?je:0):M.scrollHeight}),Me=ht("getScrollBox.clientHeight",()=>{var Le;return Y?((Le=G.documentElement)==null?void 0:Le.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:ie,scrollHeight:_e,clientHeight:Me}}function H2(){const M=it.value.length,W=Math.max(0,Zr(0,M)),G=ht("getRendererLogicalHeight.offsetHeight",()=>{var ie,_e;return(_e=(ie=S.value)==null?void 0:ie.offsetHeight)!=null?_e:0}),Y=Math.max(0,G>0?G:ht("getRendererLogicalHeight.scrollHeight",()=>{var ie,_e;return(_e=(ie=S.value)==null?void 0:ie.scrollHeight)!=null?_e:0}));return M<=0?Math.ceil(G):St.value?W>0?Math.max(1,Math.ceil(W),(function(){let ie=c1.value+u1.value;for(const _e of no.values())_e&&(ie+=Math.max(0,ht("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,ie))})(),(function(ie,_e){return ie<=0||_e<=0?0:_e<=ie+Math.max(512,.05*ie)?Math.ceil(_e):0})(W,Y)):Math.max(1,Math.ceil(Y)):ze.value?W>0||Oe.count>0||$2()>0?(Si.value&&co.value,Math.max(1,Math.ceil(Y),Math.ceil(W))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(W))}function W2(M){const W=S.value;if(!W)return null;const G=ht("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>W.getBoundingClientRect());return(function(ie){return ie.isViewportRoot?ie.clientHeight:ht("getViewportBottomInRoot.getBoundingClientRect",()=>ie.root.getBoundingClientRect().bottom)})(M)-G.bottom}function q8(M={}){const W=M.requireViewport!==!1,G=(function(_e=64){const Me=hu(),Le=S.value;if(!Me||!Le)return!1;const qe=(function(Ge){if(Ge.isViewportRoot)return{top:0,bottom:Ge.clientHeight};const je=ht("getVirtualViewportRect.getBoundingClientRect",()=>Ge.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Me),Re=ht("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return Re.bottom>=qe.top-_e&&Re.top<=qe.bottom+_e})();if(W&&!G)return null;const Y=(function(){const _e=hu(),Me=S.value;if(!_e||!Me||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Le=W2(_e);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(Y)return{anchor:Y,captured:!0};const ie=Cs();if(ie)return{anchor:{type:"node",nodeIndex:ie.nodeIndex,offsetWithinNodePx:ie.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const _e=(function(){const Me=it.value.length;return Me<=0?null:{type:"node",nodeIndex:Wo(si.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function k1(M){let W=2166136261;for(let G=0;G>>0).toString(36)}function j8(M,W){let G=M;for(let Y=0;Y8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${k1(ie)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(W.has(M))return"cycle";if(G>=6)return"max-depth";W.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ge=0;Ge=Le&&Me.push(Ge)}return[`a:${M.length}`,`h=${_e.join(",")}`,`t=${Me.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const Y=M,ie=Object.keys(Y).filter(_e=>{const Me=Y[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||V8.has(_e))}).sort();return`o:${ie.length}:${ie.map(_e=>`${_e}=${vf(Y[_e],W,G+1)}`).join(";")}`}finally{W.delete(M)}}let z2=-1,b1="";function pu(M){const W=it.value[M];return W?k1(vf(W)):""}function x1(){const M=Z.value;if(z2===M)return b1;let W=2166136261;for(let G=0;G>>0).toString(36),z2=M,b1}function Va(M,W={}){var G;const Y=W.includeHeightCache===!0,ie=(G=W.includeContentHash)!=null?G:Y,_e=Y?(function(Le){const qe=(function(){var nt,wt;const at=Number((wt=(nt=o.virtualScroll)==null?void 0:nt.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(qe)||Le.length<=qe)return Le;const Re=new Map,Ge=nt=>{!nt||Re.size>=qe||Re.set(nt.index,nt)},je=it.value.length,Be=Wo(Ho.start-2*uu.value,0,je),Ke=Wo(Ho.end+2*uu.value,Be,je);for(const nt of Le)nt.index>=Be&&nt.index=0&&Re.sizent.index-wt.index).slice(0,qe)})(Nt().map(Le=>{var qe;const Re=it.value[Le.index];return Re?Pt(lt({},Le),{nodeType:String((qe=Re.type)!=null?qe:""),signature:pu(Le.index)}):null}).filter(Le=>!!Le)):[],Me=q8({allowFallback:W.allowAnchorFallback===!0,requireViewport:W.requireViewport});return Me||_e.length||W.includeEmptyState===!0?Pt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:ie?x1():void 0,measurementKey:ur()||void 0,heightCache:_e.length?_e:void 0}):null}function w1(M){var W,G;const Y=hu();if(!Y)return;const ie=(function(Le){const qe=S.value;if(!qe)return null;const Re=ge(qe,Le.root),Ge=it.value.length,je=ht("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Be=Math.max(0,je>0?je:Ge>0?ht("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Ke=H2();return Re+Math.max(Be,Ke)})(Y);if(ie==null)return;const _e=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,ie-Y.clientHeight-_e);(function(Le){Ne=ku()+120,he=Le})(Me),Y.isViewportRoot?(G=(W=Y.doc.defaultView)==null?void 0:W.scrollTo)==null||G.call(W,0,Me):tC(Y.root,Y.doc,Me,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee})}const _1=[];function U2(){if(oe)for(se!=null&&(jn?.(se),se=null);_1.length;){const M=_1.pop();M!=null&&window.clearTimeout(M)}}function Ka(M){const W=!!Fe.value;Fe.value=null,Ne=0,he=null,U2(),W&&M&&Bn(M)}function Ga(){if(!Fe.value||!oe||se!=null)return;const M=()=>{se=null;const W=Fe.value;W&&w1(W)};se=Tn?Tn(M):null,se==null&&M()}function q2(M,W={}){const G=it.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(W.requireSignature&&!Y.signature)&&!(W.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(ie){var _e;const Me=it.value[ie.index];return!(!Me||ie.nodeType&&ie.nodeType!==String((_e=Me.type)!=null?_e:"")||ie.signature&&ie.signature!==pu(ie.index))})(Y))}function j2(M){const W=fu(Gl()),G=fu(M);return W!==-1&&G!==-1&&W===G}function S1(M){var W;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((W=M?.metrics)==null?void 0:W.width);return Number.isFinite(Y)&&Y>0?Y:null}function V2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&((W=M.measurementKey)!=null?W:"")===ur()&&!!j2(S1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(K2(G)?Y.some(ie=>!!(ie.nodeType||ie.signature)):Y.some(ie=>!!ie.signature))})(M)}function K2(M){return!!(M.contentHash&&M.contentHash===x1())}function K8(M){return!K2(M)}let Zl=null,Ql=null,yf=null,mu=null,gu=null;function C1(M){var W;const G=M.map(ie=>{var _e,Me;return[ie.index,Math.round(10*ie.height),(_e=ie.nodeType)!=null?_e:"",(Me=ie.signature)!=null?Me:""].join("")}).join(""),Y=fu(Gl());return[(W=Mo())!=null?W:"",Vn(),ur(),it.value.length,Y,M.length,k1(G)].join(":")}function G2(M=(W=>(W=o.virtualScroll)==null?void 0:W.heightCache)()){if(!ze.value||!M?.length||it.value.length<=0||!j2((W=o.virtualScroll)==null?void 0:W.heightCacheWidth))return!1;var W;const G=q2(M,{requireSignature:!0});if(!G.length)return!1;const Y=C1(G);return Y===Zl?(Ql="standalone",!0):(lf(G,{mode:"merge"}),ii(),Zl=Y,Ql="standalone",xu(),Bn("restore"),!0)}function A1(M,W={}){var G,Y,ie;if(!ze.value||!M||M.sessionKey!==Vn()||!f1(M.threadKey)||it.value.length<=0)return!1;const _e=!!((G=M.heightCache)!=null&&G.length)&&!kf(),Me=!M.anchor||M.anchorCaptured===!1&&W.allowUncapturedAnchor!==!0?null:M.anchor,Le=W.restoreAnchor===!0&&!!Me&&!kf()&&Number(S1(M))>0;let qe=!1;if((Y=M.heightCache)!=null&&Y.length&&V2(M)){const Ge=q2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:K8(M)});Ge.length&&(lf(Ge,{mode:"merge"}),ii(),Zl=C1(Ge),Ql="restore",xu(),qe=!0)}if(_e||Le)return!1;if(!W.restoreAnchor||!Me)return qe&&Bn("restore"),!0;const Re=(function(Ge,je){var Be;const Ke=Ge.anchor,tt=Ke?Ke.type==="bottom"?`bottom:${Math.round(Ke.distanceFromBottomPx)}`:`node:${Ke.nodeIndex}:${Math.round(Ke.offsetWithinNodePx)}`:"none";return[(Be=Mo())!=null?Be:"",Vn(),ur(),mf.value,je,tt].join(":")})(M,(ie=W.restoreToken)!=null?ie:"imperative");return yf===Re?(qe&&Bn("restore"),!0):(yf=Re,(function(Ge){const je=()=>{if(Ge.type==="node")return Ka(),void Q({nodeIndex:Ge.nodeIndex,offsetWithinNodePx:Ge.offsetWithinNodePx});if(rn(),we.value=null,Fe.value=Ge,U2(),w1(Ge),oe)for(const Be of[0,120,280,480])_1.push(window.setTimeout(()=>{const Ke=Fe.value;Ke&&w1(Ke)},Be))};(function(Be){if(!St.value)return!1;const Ke=it.value.length;return!(Ke<=0||(si.value=Be.type==="node"?Wo(Be.nodeIndex,0,Ke-1):Ke-1,jl(),0))})(Ge)?mt(je):je()})(Me),Bn("restore"),!0)}function kf(){const M=Gl();return Number.isFinite(M)&&M>0}function Y2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&(it.value.length<=0||!(!((W=M.heightCache)!=null&&W.length)||kf())||!(!(M.anchor&&Number(S1(M))>0)||kf()))}function M1(){zn.clear();for(const M of Object.keys(ke)){const W=Number(M);Number.isInteger(W)&&W>=0&&W{let W=!1,G=null;const Y=()=>{W||(W=!0,G!=null&&window.clearTimeout(G),M())};if(Tn)return Tn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function E1(M,W=Mo(),G=zs.value){return Vn()===M&&Mo()===W&&zs.value===G}function T1(){return Xn(this,arguments,function*(M={}){var W,G,Y,ie,_e;const Me=Vn(),Le=Mo(),qe=zs.value,Re=(W=M.frames)!=null?W:2,Ge=(G=M.timeoutMs)!=null?G:120,je=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ke=M.flushPendingTimers===!0,tt=Yl(je),nt=()=>Pt(lt({},tt),{phase:tt.final?"settling":tt.phase,stable:!1,confidence:tt.confidence==="final"?"mixed":tt.confidence,reason:je}),wt=()=>E1(Me,Le,qe)&&(Be==null||bu()===Be);for(let At=0;Atwindow.setTimeout(tn,At))})(Ge),!wt()||(Ke&&S2(),dr(),vu(),!wt()))return nt();const at=v1();at&&(g1=Me,m1=Le,((ie=o.virtualScroll)==null?void 0:ie.settleMode)==="manual"&&Be!=null&&gf((_e=o.virtualScroll)==null?void 0:_e.settledToken)&&bu()===Be&&(ja=Au(o.virtualScroll.settledToken)));const ft=wt()&&at&&P2(),Et=Yl(je,ft?"final":void 0);return F1(Et,!0),Et})}let N1="content",Xl=null,Jl=null,I1=0,yu=null,Ya=null,L1=null,$1=null;function ku(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Q2(M){var W,G;const Y=yu;if(!Y)return!0;const ie=(G=(W=o.virtualScroll)==null?void 0:W.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>ie||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Fo(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function bu(M=(W=>(W=o.virtualScroll)==null?void 0:W.settledToken)()){return Fo(M)}function X2(M,W){var G,Y;return[M,W.sessionKey,(G=W.threadKey)!=null?G:"",ur(),x1(),Fo((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(W.totalHeight),Math.round(W.width)].join("\0")}function xu(){L1=null,$1=null,Ya=null}function G8(M){const W=M.heightCache;return W?.length?C1(W):""}function wu(M){var W,G,Y;const ie=M.metrics,_e=M.anchor?(Me=M.anchor).type==="bottom"?`bottom:${Math.round(Me.distanceFromBottomPx)}`:`node:${Me.nodeIndex}:${Math.round(Me.offsetWithinNodePx)}`:"none";var Me;return[M.sessionKey,(W=M.threadKey)!=null?W:"",(G=M.measurementKey)!=null?G:ur(),(Y=M.contentHash)!=null?Y:"",G8(M),_e,M.anchorCaptured?1:0,ie.liveRange.start,ie.liveRange.end,ie.renderedCount,ie.nodeCount,Math.round(ie.totalHeight),Math.round(ie.width),ie.phase,ie.stable?1:0].join("\0")}function F1(M,W=!1){if(!ze.value||(function(Me=!1){return!Me&&Mn.value&&!Xe.value})(W))return;const G=W||Q2(M),Y=(function(Me,Le=!1){return Le||Me.stable||Me.phase==="final"?{state:Va(Me,{includeHeightCache:!0})}:{state:Va(Me)}})(M,W),ie=Y.state,_e=!!(ie&&(G||(function(Me,Le=!1){return!!Le||wu(Me)!==Ya})(ie,W)));if(G&&(I(M),yu=M,I1=ku()),ie&&_e&&(E(ie),ie.anchor&&F(ie.anchor),Ya=wu(ie)),M.stable){const Me=X2("settled",M);if(Me!==L1){L1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-settled",qe)})(M)}}if(M.phase==="final"){const Me=X2("final",M);if(Me!==$1){$1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-final",qe)})(M)}}}function O1(){Xl!=null&&(jn?.(Xl),Xl=null),Jl!=null&&oe&&(window.clearTimeout(Jl),Jl=null)}function J2(){Xl=null,Jl=null,(function(M){if(cr.size>0||Ws!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(N1)&&(dr(),vu()),F1(Yl(N1))}function Bn(M){var W,G;if(!ze.value||(N1=M,Xl!=null||Jl!=null))return;const Y=Math.max(0,(G=(W=o.virtualScroll)==null?void 0:W.emitIntervalMs)!=null?G:32),ie=Math.max(0,Y-(ku()-I1)),_e=()=>{Jl=null,Xl=Tn?Tn(J2):null,Xl==null&&J2()};oe&&ie>0?Jl=window.setTimeout(_e,ie):_e()}function R1(M){var W;if(M<=0)return 0;const G=it.value;if(kt.value)return L2(M);if(Ye.value===G.length&&st.value.length&&Ct.value.length){const ie=Ot.value,_e=st.value,Me=Ct.value,Le=je=>je<=0?0:fo(_e,0,je)+(je-fo(Me,0,je))*ie;let qe=0,Re=G.length-1,Ge=G.length-1;for(;qe<=Re;){const je=qe+Re>>1;Le(je+1)>=M?(Ge=je,Re=je-1):qe=je+1}return Ge}let Y=M;for(let ie=0;ie=co.value)&&(!Vr.value||M=640&&(H.value||(H.value=!0,i1()),!g2.value||!ss))return Za(M),void(W&&Yr(M,!0));if(M{if(C2.delete(_e),!Vr.value||s1.value.has(_e))return;const qe=no.get(_e);if(!qe)return;const Re=ne(qe),Ge=qe.ownerDocument||document,je=Ge.defaultView||window,Be=!Re||Re===Ge.documentElement||Re===Ge.body,Ke=!Be&&Re?ht("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,tt=Be?0:Ke.top,nt=Be?ht("nodeVisibilityFallback.clientHeight",()=>{var at,ft;return(ft=(at=je.innerHeight)!=null?at:Re?.clientHeight)!=null?ft:0}):Ke.bottom,wt=ht("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());wt.bottom>=tt-500&&wt.top<=nt+500&&Yr(_e,!0)},1800+Me);C2.set(_e,Le)})(M);let ie=null;ie=Qe(()=>Y.isVisible.value,_e=>{if(_e){hf(M),Yr(M,!0),ie?.(),ff.delete(M),Wa.get(M)===Y&&Wa.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),ff.set(M,ie),St.value&&ji()}function D1(){Ws=null;for(const[M,W]of cr)cr.delete(M),Ui.get(M)===W.el&&Vl.get(M)===W.version&&Ul(M,W.height,{allowShrink:W.allowShrink})}function Qa(){Ws!=null&&(jn?.(Ws),Ws=null),cr.clear()}function bf(M,W){(function(G,Y,ie){var _e;if(!Number.isFinite(ie)||ie<=0||Ui.get(G)!==Y)return;const Me=Vl.get(G);if(Me==null)return;const Le=it.value[G],qe=te.value&&j.value!==!0&&!((_e=o.nodes)!=null&&_e.length)&&G>=it.value.length-2,Re=!(Le?.loading===!0||qe),Ge=cr.get(G),je=Ge?Ge.allowShrink&&Re:Re,Be=Ge&&!je?Math.max(Ge.height,ie):ie;cr.set(G,{height:Be,allowShrink:je,version:Me,el:Y}),Ws==null&&(Ws=Tn?Tn(D1):null,Ws==null&&D1())})(M,W,ql(M,W))}function dr(){for(const[M,W]of Ui)W&&bf(M,W)}function nb(){Lo?.disconnect(),Lo=null,is.clear()}function P1(){for(;af.length;)df(af.pop())}Qe(Xe,M=>{M&&Bn("content")},{flush:"post"}),t({getVirtualMetrics:Yl,captureVirtualState:function(M={}){var W;return Va(Yl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(W=M.includeEmptyState)==null||W})},restoreVirtualState:function(M,W={}){const G=W.restoreAnchor===!0,Y=W.restoreToken==null?"imperative":String(W.restoreToken);mu=M,gu={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0},!A1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0})&&Y2(M)||(mu=null,gu=null)},forceMeasure:function(M="manual"){return Xn(this,null,function*(){yield mt(),yield Z2(),dr(),vu(),yield mt();const W=Yl(M);return F1(W,!0),W})},settle:T1,scrollToNode:function(M,W="start"){Ka(),rn();const G=it.value.length;if(G<=0)return;const Y=Wo(M,0,G-1),ie=()=>{var _e;const Me=Dt({nodeIndex:Y,offsetWithinNodePx:0}),Le=pf(Y),qe=hu(),Re=(_e=qe?.clientHeight)!=null?_e:0,Ge=He();let je=Me;if(W==="center")je=Me-Re/2+Le/2;else if(W==="end")je=Me-Re+Le;else if(W==="nearest"&&Ge!=null){if(Me>=Ge&&Me+Le<=Ge+Re)return;je=MePo.value,M=>{if(!M){nb();for(const W of Kr.values())for(const G of W)df(G);Kr.clear(),Vl.clear(),P1(),Qa()}},{immediate:!0}),Qe(j,M=>{M&&(function(){if(oe&&j.value&&Ui.size){P1();for(const W of[80,240,640]){const G=_2(W,()=>{for(const[Y,ie]of Ui)ie&&bf(Y,ie)},"final");G!=null&&af.push(G)}}})(),Bn(M?"final":"content")}),Qe([()=>it.value.length,()=>co.value],()=>{Fe.value&&Ga(),Bn("content")},{flush:"post",immediate:!0}),Qe([()=>Ho.start,()=>Ho.end],()=>{Bn("batch")},{flush:"post"});const{cleanupBatchScheduler:Y8}=(function(M){const{props:W,isClient:G,isTestEnv:Y,parsedNodesIdentity:ie,parsedNodeCount:_e,desiredRenderedCount:Me,datasetKey:Le,batchingEnabled:qe,incrementalRenderingActive:Re,resolvedBatchSize:Ge,resolvedInitialBatch:je,renderedCount:Be,adaptiveBatchSize:Ke,previousRenderContext:tt,previousBatchConfig:nt,requestFrame:wt,cancelFrame:at,hasIdleCallback:ft,cleanupNodeVisibility:Et,onDatasetKeyChanged:At,onDatasetChanged:tn}=M;let Lt=null,qt=null,zt=!1,fn=null,Us=null,as=0,Mi=!1,Qr=!1;const Xr=new Set,ta=new Set;function bb(){if(G){Lt!=null&&(at?.(Lt),Lt=null),qt!=null&&(window.clearTimeout(qt),qt=null),Us!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Us),Us=null),as+=1;for(const Zo of Xr)at?.(Zo);Xr.clear();for(const Zo of ta)window.clearTimeout(Zo);ta.clear(),zt=!1,fn=null,Mi=!1,Qr=!1}}function Mf(){return typeof performance<"u"?performance.now():Date.now()}function xb(Zo){(function(fr){var Jr;if(!Re.value)return;const hr=Math.max(2,(Jr=W.renderBatchBudgetMs)!=null?Jr:6),pr=Math.max(1,Ge.value||1),Ei=Math.max(1,Math.floor(pr/4));fr>1.2*hr?Ke.value=Math.max(Ei,Math.floor(.7*Ke.value)):fr<.5*hr&&Ke.value=hr)return;const pr=Math.max(1,Zo),Ei=()=>{const ec=Mf();let tc=0;Lt=null,qt=null,Us=null,zt=!1;const nc=fn??pr;fn=null;const K1=Mf();Be.value=Math.min(hr,Be.value+nc),Et(Be.value),tc=Mf()-K1,(function(G1,Cb){if(!G)return void xb(Cb);Mi=!0;const Ab=++as;mt().then(()=>{var Mb;if(Ab!==as)return;const mE=Mf(),gE=Math.max(Cb,mE-G1),Eb=()=>{Ab===as&&xb(gE)};if(wt){let Nb=!1,mr=null;const Ib=()=>{Nb||(Nb=!0,Eb())},Ef=wt(()=>{Xr.delete(Ef),mr!=null&&(window.clearTimeout(mr),ta.delete(mr),mr=null),Ib()});return Xr.add(Ef),mr=window.setTimeout(()=>{mr!=null&&ta.delete(mr),mr=null,at?.(Ef),Xr.delete(Ef),Ib()},Math.max(32,(Mb=W.renderBatchIdleTimeoutMs)!=null?Mb:120)),void ta.add(mr)}const Tb=window.setTimeout(()=>{ta.delete(Tb),Eb()},0);ta.add(Tb)})})(ec,tc)};if(!G||As.immediate)return void Ei();const el=Math.max(0,(fr=W.renderBatchDelay)!=null?fr:16);if(fn=fn!=null?Math.max(fn,pr):pr,!zt){if(zt=!0,!Y&&ft&&window.requestIdleCallback){const ec=Math.max(0,(Jr=W.renderBatchIdleTimeoutMs)!=null?Jr:120);return void(Us=window.requestIdleCallback(()=>Ei(),{timeout:ec}))}wt&&!Y?Lt=wt(()=>{el!==0?qt=window.setTimeout(()=>Ei(),el):Ei()}):qt=window.setTimeout(()=>Ei(),el)}}function _b(Zo,As={}){Mi?Qr=!0:Zo==null?Sb():wb(Zo,As)}function Sb(){Re.value&&wb(qe.value?Math.max(1,Math.round(Ke.value)):Math.max(1,Ge.value))}return Qe([ie,_e,Le,Re,Ge,je,()=>W.renderBatchDelay],()=>{var Zo;const As=_e.value,fr=tt.value,Jr=Le.value,hr=!Object.is(Jr,fr.key),pr=As!==fr.total,Ei=hr||pr;tt.value={key:Jr,total:As};const el=nt.value,ec=(Zo=W.renderBatchDelay)!=null?Zo:16,tc=el.batchSize!==Ge.value||el.initial!==je.value||el.delay!==ec||el.enabled!==Re.value;nt.value={batchSize:Ge.value,initial:je.value,delay:ec,enabled:Re.value},hr&&At(As),(Ei||tc||!Re.value)&&bb(),(Ei||tc)&&(Ke.value=Math.max(1,Ge.value||1)),Ei&&tn();const nc=Me.value;if(!As)return Be.value=0,void Et(0);if(!Re.value)return Be.value=nc,void Et(Be.value);const K1=hr||fr.total===0;Be.value=K1||tc?Math.min(nc,je.value):Math.min(Be.value,nc);const G1=Math.max(1,je.value||Ge.value||As);Be.value{Re.value&&(typeof As=="number"&&Zo<=As||Zo>Be.value&&_b())}),{cleanupBatchScheduler:bb}})({props:x,isClient:oe,isTestEnv:ti,parsedNodesIdentity:ao,parsedNodeCount:Yn,desiredRenderedCount:cf,datasetKey:W8,batchingEnabled:Wi,incrementalRenderingActive:Si,resolvedBatchSize:Io,resolvedInitialBatch:Ss,renderedCount:co,adaptiveBatchSize:Ci,previousRenderContext:ni,previousBatchConfig:ar,requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,cleanupNodeVisibility:O8,onDatasetKeyChanged:M=>{Qa(),oo(),ii(),xu(),M>0&&wn(M)},onDatasetChanged:()=>{St.value&&ji({immediate:!0})}});Qe([v2,St,()=>S.value,()=>J()],([M,W])=>{if(!M)return A2(),void o1();R8(),W?ji({immediate:!0}):o1()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,()=>St.value],M=>Xn(null,[M],function*([W,G]){G&&W&&oe&&(yield mt(),ji({immediate:!0}))}),{flush:"post"}),Qe(kt,M=>{M&&(function(){var W;if(go.value&&os.value&&qn.value&&((W=to.value)!=null&&W[1]))return;const G=pt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=pt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),ie=pt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});go.value=G,os.value=Y,qn.value=ie;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)_e[Me]=pt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});to.value=_e})()},{immediate:!0}),Qe([()=>S.value,kt],()=>{if(!kt.value)return l1(),void(K.value=0);E2(),l1(),kt.value&&S.value&&typeof ResizeObserver<"u"&&(du=new ResizeObserver(()=>{E2(),we.value&&Un(),Fe.value&&Ga(),Bn("resize")}),du.observe(S.value))},{immediate:!0}),Qe([kt,Wn,zs],()=>Xn(null,null,function*(){if(!kt.value)return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield mt(),(function(){if(!kt.value||typeof window>"u")return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},W=M2(r1(L.value),".paragraph-node");M.paragraph=J0(L.value,W,"pre-wrap");const G=r1(R.value),Y=G?.querySelector(".paragraph-node");M.listItem=J0(R.value,Y,"pre-wrap");const ie=ht("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Le;return(Le=(Me=D.value)==null?void 0:Me.offsetHeight)!=null?Le:0}),_e=ht("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Le;return(Le=(Me=R.value)==null?void 0:Me.offsetHeight)!=null?Le:0});M.listWrapperOverhead=Math.max(0,ie-_e);for(let Me=1;Me<=6;Me++){const Le=M2(r1(z[Me]),`h${Me}`);M.headings[Me]=J0(z[Me],Le,"pre-wrap")}V.value=M,ii()})()}),{flush:"post",immediate:!0}),Qe(()=>it.value.length,()=>{St.value&&ji({immediate:!0})}),Qe([kt,K],()=>{ii(),St.value&&ji({immediate:!0}),we.value&&Un(),Fe.value&&Ga(),Bn("resize")},{immediate:!1}),Qe(()=>Vr.value,M=>{if(M)for(const[W,G]of no)tb(W,G);else{i1();for(const[W,G]of no)G&&Yr(W,!0)}},{immediate:!1}),Qe([()=>x.viewportPriority,()=>it.value.length],([M,W])=>{M!==!1?H.value&&W<=200&&(H.value=!1):H.value=!1}),Qe(()=>co.value,()=>{St.value&&ji({immediate:!0})}),Qe([si,En,uu,()=>it.value.length,St],()=>{jl()},{immediate:!0});let _u=null,Su=!1,Xa=null;function Cu(){_u=null,g1=null,m1=void 0,ja=null,xu()}function H1(){Qa(),oo(),ii(),zn.clear();const M=it.value.length;M>0&&wn(M),M1()}function W1(){O1(),S2(),yu=null,Zl=null,Ql=null,yf=null,mu=null,gu=null,Su=!1,Cu(),B2("restore"),rn(),Ka()}function Au(M){var W;return[(W=Mo())!=null?W:"",Vn(),ur(),mf.value,bu(M),it.value.length,Math.round(Zr(0,it.value.length)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")}function ob(){return Xn(this,null,function*(){var M,W,G,Y;const ie=(M=o.virtualScroll)==null?void 0:M.settledToken,_e=bu(ie),Me=Vn(),Le=Mo(),qe=zs.value;if(ze.value&&((W=o.virtualScroll)==null?void 0:W.settleMode)==="manual"&&gf(ie))if(v1()){if(Au(ie)!==ja&&!Su){Su=!0;try{const Re=yield T1({reason:"manual",expectedSettledTokenKey:_e}),Ge=bu()===_e;E1(Me,Le,qe)&&Re.sessionKey===Me&&Re.threadKey===Le&&Ge&&Re.stable&&Re.phase==="final"&&(ja=Au((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{Su=!1,yield mt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ge=gf(Re)?Au(Re):"";E1(Me,Le,qe)&&Ge&&ja!==Ge&&ob()}}}else Bn("manual")})}Qe(ze,(M,W)=>{if(M!==W){if(!M)return W1(),void O1();W1(),H1(),Xa=zs.value,Bn("content")}},{flush:"post"}),Qe([ze,zs],([M,W])=>{M?Xa!=null?Xa!==W&&(Xa=W,(function(G="resize"){Qa(),oo(),ii(),zn.clear();const Y=it.value.length;Y>0&&wn(Y),M1(),Zl=null,Ql=null,yf=null,yu=null,Su=!1,Cu(),G2(),mt(()=>{dr(),we.value&&Un(),Fe.value&&Ga(),Bn(G)})})("resize")):Xa=W:Xa=null},{flush:"post",immediate:!0}),Qe([ze,()=>Vn(),()=>Mo()],([M])=>{M&&(W1(),H1(),B2("content"),Bn("content"))}),Qe([ze,()=>Vn(),()=>Mo(),zs,()=>it.value.length],([M])=>{M&&(function(W="async-node"){let G=!1;for(const[Y,ie]of Array.from(qi.entries()))h1(ie)||(qi.delete(Y),Hs.delete(Y),G=!0);G&&(Ua(),Bn(W))})("async-node")},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>Z.value],([M])=>{M&&(xu(),(function(W="content"){if(!ze.value)return;const G=[],Y=it.value.length;for(const ie of Array.from(zn.keys())){if(ie>=Y){G.push(ie);continue}const _e=pu(ie),Me=zn.get(ie);Me!=null&&Me!==_e&&G.push(ie),zn.set(ie,_e)}for(const ie of Array.from(zn.keys()))ie>=Y&&zn.delete(ie);G.length&&((function(ie,_e={}){const Me=Array.from(ie,Number);Mt(Me,_e)>0&&(function(qe){for(const Re of qe)zn.delete(Re)})(Me)})(G,{notify:!1}),ii(),Cu(),we.value&&Un(),Fe.value&&Ga(),Bn(W))})("content"))},{flush:"post",immediate:!0}),Qe([ze,()=>it.value.length,()=>Vn(),()=>Mo()],([M,W,G,Y],[ie,_e,Me,Le])=>{M&&ie&&G===Me&&Y===Le&&W!==_e&&Cu()},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],()=>{G2()},{flush:"post",immediate:!0}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W,G]){if(!W||!G)return;yield mt();const Y=(function(){var ie;const _e=(ie=o.virtualScroll)==null?void 0:ie.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();A1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var W;if(!M)return;const G=(W=o.virtualScroll)==null?void 0:W.restoreState;G&&Zl&&Ql==="restore"&&(V2(G)||(H1(),Zl=null,Ql=null,Bn("resize")))},{flush:"post"}),Qe([ze,()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W]){var G;const Y=mu,ie=gu;W&&Y&&(yield mt(),!A1(Y,{restoreAnchor:ie?.restoreAnchor===!0,restoreToken:(G=ie?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:ie?.allowUncapturedAnchor===!0})&&Y2(Y)||(mu=null,gu=null))}),{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>Oe.count,()=>Oe.total],([M,W,G])=>{if(!M||W!==!0||G==="manual"||!y1())return;const Y=(function(){var ie;const _e=it.value.length;return[(ie=Mo())!=null?ie:"",Vn(),ur(),mf.value,_e,Math.round(Zr(0,_e)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")})();_u!==Y&&(_u=Y,T1({reason:"final"}).then(ie=>{ie.stable||_u!==Y||(_u=null)}))},{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>it.value.length,()=>Oe.count,()=>Oe.total],()=>{ob()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,St,En,uu,()=>Ho.start,()=>Ho.end],([M,W,G,Y,ie,_e])=>{ue.value&&Ie("virtualization",{nodes:M,virtualization:W,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:W?(()=>{const Me=Ue.value||ne();return Me?{reverse:q(Me),scrollTop:Math.round(Me.scrollTop),scrollTopAbs:Math.round(Math.abs(Me.scrollTop)),scrollHeight:Math.round(Me.scrollHeight),clientHeight:Math.round(Me.clientHeight)}:null})():null,liveRange:{start:ie,end:_e},rendered:co.value})}),Qe([()=>x.customId],([M],W,G)=>{if(!M||vn)return;const Y=(function(ie,_e){return ie?(Eo.controllers[ie]=_e,()=>{Eo.controllers[ie]===_e&&delete Eo.controllers[ie]}):()=>{}})(M,{captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:be,getReport:D8});G(()=>{Y()})},{immediate:!0}),po(()=>{(function(){if(ze.value)try{dr(),vu();const M=Yl("manual");Q2(M)&&(I(M),yu=M,I1=ku());const W=Va(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});W&&(E(W),W.anchor&&F(W.anchor),Ya=wu(W))}catch{}})(),Y8(),i1(),De(),nb();for(const M of Kr.values())for(const W of M)df(W);Kr.clear(),Vl.clear(),zn.clear(),P1(),Qa(),l1(),rn(),Ka(),O1(),A2(),o1()});const Z8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index11-CwW_hjK7.js"),__vite__mapDeps([8,5]))).default}catch(M){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".',M),qs}}),loadingComponent:Tee,delay:0}),Q8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index10-DTJJNuIm.js"),[])).default}catch(M){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.',M),qs}}),loadingComponent:Eee,delay:0}),X8=Li(()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index7-XmRlMUpI.js"),[])).default}catch(M){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".',M),qs}})),sb={text:ro,paragraph:Ma,heading:Ip,code_block:j0,list:qc,list_item:Uc,blockquote:Th,table:hd,definition_list:Nh,footnote:Ih,footnote_reference:Zs,footnote_anchor:dd,admonition:Oh,vmr_container:$h,hardbreak:Ml,link:xs,image:Al,thematic_break:Lh,math_inline:Pi,math_block:GM,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,inline_code:ts,html_inline:Qs,reference:ys,html_block:fd},J8=B(()=>d1()),ib=B(()=>eC(x.codeBlockProps)),eE=B(()=>eC(x.codeBlockProps,{omit:["langs"]})),rb=B(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),eE.value)),lb=B(()=>lt(Pt(lt({},rb.value),{langs:x.langs}),ib.value));function ab(M){return typeof M=="boolean"?M:void 0}const tE=B(()=>{const M=x.codeBlockProps||{},W={},G=ab(M.showLineNumbers);G!==void 0&&(W.showLineNumbers=G);const Y=ab(M.diffInline);Y!==void 0&&(W.diffInline=Y);const ie=(function(_e){const Me=Number(_e);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return ie!==void 0&&(W.reservedHeightPx=ie),W}),nE=B(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),ib.value)),oE=B(()=>lt({},x.mermaidProps||{})),cb=B(()=>lt({},x.d2Props||{})),sE=B(()=>lt({},x.infographicProps||{})),Mu=B(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:lo.value.customHtmlTags})),iE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltip:Se.value}:{})),rE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),lE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),aE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{}));function cE(M){return Array.isArray(M.children)&&M.children.length>0}const z1=B(()=>B8.value.map(M=>{var W,G,Y,ie,_e,Me,Le,qe;let Re=(function(at){var ft,Et,At,tn,Lt,qt,zt;if(at.type!=="code_block")return at;const fn=at,Us=[String((ft=fn.language)!=null?ft:""),String((Et=fn.loading)!=null?Et:""),String((At=fn.diff)!=null?At:""),String((tn=fn.code)!=null?tn:""),String((Lt=fn.originalCode)!=null?Lt:""),String((qt=fn.updatedCode)!=null?qt:""),String((zt=fn.raw)!=null?zt:"")].join("\0"),as=Ai.get(fn);if(as&&as.signature===Us)return as.node;const Mi=lt({},fn);return Ai.set(fn,{signature:Us,node:Mi}),Mi})(M.node);const Ge=xf(Re);let je=hb(Re,Ge);if((Re.type==="html_block"||Re.type==="html_inline")&&je===sb[Re.type]){const at=Re,ft=String((W=at.tag)!=null?W:"").trim().toLowerCase()||D6(at.content);if(ft){const Et=Wt.value[ft];if(Hn.value.has(ft)&&Et)je=Et,Re=Pt(lt({},at),{type:ft,tag:ft,content:jV(at.content,ft)});else if(P6((G=at.content)!=null?G:at.raw,ft)){const At=String((ie=(Y=at.content)!=null?Y:at.raw)!=null?ie:"");Re.type==="html_inline"?(je=ro,Re={type:"text",content:At,raw:At}):(je=Ma,Re={type:"paragraph",children:[{type:"text",content:At,raw:At}],raw:At})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&je===qs&&!U1(Wt.value,Ge);let Ke=lt({},(function(at,ft,Et){const At=ft??xf(at);if(at.type==="code_block"){const tn=At?U1(Wt.value,At):void 0;if(Et&&u.value==="pre"&&!tn&&Et===qs)return tE.value;if(Et&&At&&Et===tn)return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:lb.value;if(Et&&Et===Wt.value.code_block)return lb.value;if(N2(Et))return nE.value}return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:at.type==="link"?iE.value:at.type==="list"?rE.value:at.type==="blockquote"?lE.value:at.type==="table"?aE.value:at.type==="code_block"?rb.value:Mu.value})(Re,Ge,je));const tt=Kl.value[M.index];Re.type==="code_block"&&tt?.kind==="code-block"&&(Ke=Pt(lt({},Ke),Be?{reservedHeightPx:(_e=tt.height)!=null?_e:tt.contentHeight}:{estimatedHeightPx:tt.height,estimatedContentHeightPx:tt.contentHeight})),Be||Re.type!=="code_block"||Ge!=="mermaid"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:_v(xv(String((Me=Re.code)!=null?Me:"")))})),Be||Re.type!=="code_block"||Ge!=="infographic"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:Sv(wv(String((Le=Re.code)!=null?Le:"")))})),Re.type==="math_block"&&(Ke=Pt(lt({},Ke),{cacheScope:ns.value}));const nt=(function(at,ft){const Et=String(at.type);return!ef(Et)&&Wt.value[Et]===ft})(Re,je),wt=nt?_k(Re,Te.value):void 0;return Pt(lt({},M),{node:Re,component:je,bindings:Ke,customBindings:lt(lt({},wt??{}),Ke),rendersCustomNode:nt,hasSlotChildren:cE(Re),slotContent:String((qe=Re.content)!=null?qe:""),isCodeBlock:Re.type==="code_block",indexKey:`${J8.value}-${M.index}`})}));function xf(M){var W;return M?.type==="code_block"?String((W=M.language)!=null?W:"").trim().toLowerCase():""}function U1(M,W){const G=W.trim().toLowerCase();if(G)for(const Y of[G,gk(G),$M(G)]){const ie=Y&&M[Y];if(ie)return ie}}function ub(M,W,G,Y){var ie,_e;const Me=lt({},M.value);return Ec(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=Y(G(String((ie=W?.code)!=null?ie:"")),void 0,Me.maxHeight==="none"?null:(_e=Ec(Me.maxHeight))!=null?_e:void 0)),Me}function db(M){return ub(oE,M,xv,_v)}function fb(M){return ub(sE,M,wv,Sv)}function hb(M,W){if(!M)return Fv;const G=Wt.value,Y=G[String(M.type)];if(M.type==="code_block"){const ie=W??xf(M),_e=ie?U1(G,ie):void 0;return _e||(u.value==="pre"?G.code_block||qs:ie==="mermaid"?G.mermaid||Z8:ie==="infographic"?G.infographic||Q8:ie==="d2"||ie==="d2lang"?G.d2||X8:Y||G.code_block||I2.value)}return Y||sb[String(M.type)]||Fv}function q1(M){s("click",M)}function uE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseover",M)}function dE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseout",M)}function pb(M){s("mouseover",M)}function mb(M){s("mouseout",M)}const ea=X(null),Vi=X(!1);let Eu,Ja=null,j1=0,wf=0,_f=0;const gb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],fE=new Set(gb),vb=[".typewriter-cursor",".height-estimation-probes",...gb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function yb(M){if(!M||typeof M!="object")return!1;const W=M.type;return typeof W=="string"&&fE.has(W)}function Sf(M){var W,G;if(!M||typeof M!="object")return 0;const Y=M,ie=(G=(W=Y.raw)!=null?W:Y.content)!=null?G:Y.code;if(typeof ie=="string")return ie.length;const _e=Y.children;if(Array.isArray(_e))return _e.reduce((Le,qe)=>Le+Sf(qe),0);const Me=Y.items;return Array.isArray(Me)?Me.reduce((Le,qe)=>Le+Sf(qe),0):0}function Cf(){Eu&&(clearTimeout(Eu),Eu=void 0)}function kb(){j1+=1,Ja!=null&&(jn?.(Ja),Ja=null)}function Af(){kb(),ea.value&&(ea.value.style.visibility="hidden")}function hE(M){var W;if(M.nodeType!==Node.TEXT_NODE||!((W=M.textContent)!=null?W:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(vb)}function pE(M){let W=M.lastChild;for(;W;){if(hE(W))return W;if(W.nodeType===Node.ELEMENT_NODE){const G=W;if(!G.matches(vb)&&G.lastChild){W=G.lastChild;continue}}for(;W&&W!==M&&!W.previousSibling;)W=W.parentNode;if(!W||W===M)break;W=W.previousSibling}return null}function V1(){if(!oe||!Vi.value||Ja!=null)return;const M=j1,W=()=>{Ja=null,M===j1&&(function(){var G,Y;if(!(oe&&Vi.value&&S.value&&ea.value))return;const ie=S.value,_e=ea.value;_e.style.visibility="hidden";const Me=(function(){const je=z1.value;for(let Be=je.length-1;Be>=0;Be--){const Ke=je[Be];if(!Ke||yb(Ke.node)||!B1(Ke.index))continue;const tt=no.get(Ke.index);if(!tt)continue;const nt=pE(tt);if(nt)return nt}return null})();if(!Me)return;let Le=0,qe=0,Re=20,Ge=!1;if(Me?.textContent){const je=Me.textContent.length,Be=document.createRange();Be.setStart(Me,Math.max(0,je-1)),Be.setEnd(Me,je);const Ke=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,tt=(Y=Ke?.[Ke.length-1])!=null?Y:(G=Me.parentElement)==null?void 0:G.getBoundingClientRect();if(tt){const nt=ht("typewriterCursor.root.getBoundingClientRect",()=>ie.getBoundingClientRect());Le=tt.right-nt.left+ie.scrollLeft,qe=tt.top-nt.top+ie.scrollTop,Re=tt.height||Re,Ge=!0}Be.detach()}Ge&&(_e.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,qe)}px)`,_e.style.height=`${Re}px`,_e.style.visibility="visible")})()};Tn?Ja=Tn(W):W()}return Qe([ve,()=>o.content,()=>o.nodes,()=>x.typewriter,j],()=>Xn(null,null,function*(){var M,W;if(!oe||ce.value||!P.value)return;if(j.value)return Vi.value=!1,Cf(),void Af();if((M=o.nodes)!=null&&M.length)return Vi.value=!1,Cf(),Af(),wf=((W=o.content)!=null?W:"").length,void(_f=ve.value.length);const G=(function(){var Le,qe;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Re,Ge)=>Re+Sf(Ge),0):((qe=o.content)!=null?qe:"").length})(),Y=(function(){var Le;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((qe,Re)=>qe+Sf(Re),0):ve.value.length})(),ie=!yb(it.value[it.value.length-1]),_e=G>wf,Me=Y>_f;if(x.typewriter===!1||!ie||!_e&&!Me)return x.typewriter!==!1&&ie||(Vi.value=!1,Af()),wf=G,void(_f=Y);wf=G,_f=Y,Vi.value=!0,ea.value&&(ea.value.style.visibility="hidden"),Cf(),yield mt(),V1(),Eu=setTimeout(()=>{Eu=void 0,Vi.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Vi,M=>Xn(null,null,function*(){M?(yield mt(),V1()):Af()}),{flush:"post"}),Qe([()=>co.value,()=>Ho.start,()=>Ho.end],()=>Xn(null,null,function*(){oe&&!ce.value&&P.value&&Vi.value&&(yield mt(),V1())}),{flush:"post"}),po(()=>{Cf(),kb(),dn.clear()}),(M,W)=>{const G=WT("NodeRenderer",!0);return C(ce)?(w(!0),T(Pe,{key:0},ot(z1.value,Y=>(w(),T(Pe,{key:Y.index},[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[0]||(W[0]=ie=>s("copy",ie)),onHandleArtifactClick:W[1]||(W[1]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[2]||(W[2]=ie=>s("copy",ie)),onHandleArtifactClick:W[3]||(W[3]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),T("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:St.value},{"virtual-scroll-coordinated":Xe.value}]]),"data-custom-id":x.customId,onClick:q1,onMouseover:uE,onMouseout:dE},[Ht.value||St.value?(w(),T(Pe,{key:0},[Ht.value?(w(),T("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${Wn.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:L,class:"node-content","data-probe":"paragraph"},[re(C(Ma),{node:go.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[_("ul",Iee,[re(C(Uc),{node:os.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[re(C(qc),{node:qn.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),T(Pe,null,ot(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:ie=>(function(_e,Me){_e<1||_e>6||(z[_e]=Me)})(Y,ie),class:"node-content","data-probe":`heading-${Y}`},[re(C(Ip),{node:F8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Lee)),64))],4)):ae("",!0),St.value?(w(),T("div",{key:1,class:"node-spacer",style:Yt({height:`${c1.value}px`}),"aria-hidden":"true"},null,4)):ae("",!0)],64)):ae("",!0),(w(!0),T(Pe,null,ot(z1.value,Y=>(w(),T("div",{key:Y.index,ref_for:!0,ref:ie=>tb(Y.index,ie),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[B1(Y.index)?(w(),T("div",{key:0,ref_for:!0,ref:ie=>(function(_e,Me){var Le;Me||(function(je){const Be=`${d1()}-${je}`;let Ke=!1;for(const tt of Array.from(Hs.keys())){const nt=qi.get(tt);(nt?.index===je||tt===Be||tt.startsWith(`${Be}-`))&&(Hs.delete(tt),qi.delete(tt),Ke=!0)}Ke&&(Ua(),Bn("async-node"))})(_e),cr.delete(_e),(function(je){var Be;const Ke=((Be=Vl.get(je))!=null?Be:0)+1;Vl.set(je,Ke)})(_e);const qe=Kr.get(_e);if(qe){for(const je of qe)df(je);Kr.delete(_e)}if((function(je){const Be=is.get(je);Be&&(Lo?.unobserve(Be),rs.delete(Be),is.delete(je))})(_e),!Me||!Po.value)return Ui.delete(_e),void Vl.delete(_e);Ui.set(_e,Me);const Re=()=>{bf(_e,Me)};queueMicrotask(Re);const Ge=(Lo||typeof ResizeObserver>"u"||(Lo=new ResizeObserver(je=>{if(je.length)for(const Be of je){const Ke=rs.get(Be.target),tt=is.get(Ke??-1);Ke!=null&&tt&&bf(Ke,tt)}else dr()})),Lo);if(Ge&&(is.set(_e,Me),rs.set(Me,_e),Ge.observe(Me)),typeof window<"u"){const je=((Le=it.value[_e])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(je.length){const Be=je.map(Ke=>_2(Ke,Re,"node-resize")).filter(Ke=>Ke!=null);Be.length&&Kr.set(_e,Be)}}})(Y.index,ie),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[8]||(W[8]=ie=>s("copy",ie)),onHandleArtifactClick:W[9]||(W[9]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[10]||(W[10]=ie=>s("copy",ie)),onHandleArtifactClick:W[11]||(W[11]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(Il,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[4]||(W[4]=ie=>s("copy",ie)),onHandleArtifactClick:W[5]||(W[5]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[6]||(W[6]=ie=>s("copy",ie)),onHandleArtifactClick:W[7]||(W[7]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),T("div",{key:1,class:"node-placeholder",style:Yt({height:`${pf(Y.index)}px`})},null,4))],8,$ee))),128)),Vi.value?(w(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:ea,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ae("",!0),St.value?(w(),T("div",{key:2,class:"node-spacer",style:Yt({height:`${u1.value}px`}),"aria-hidden":"true"},null,4)):ae("",!0)],42,Nee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Bs=l5;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,l5)};const Nk=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Fee={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"},Oee={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"},Ree={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"},Bee={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"},Dee={class:"admonition-title"},Pee=["aria-expanded","aria-controls"],Hee=["id"],Oh=gn(Ze({__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=X(!!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)=>(w(),T("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),T("svg",Fee,[...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"?(w(),T("svg",Oee,[...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"?(w(),T("svg",Ree,[...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"?(w(),T("svg",Bee,[...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)])])):ae("",!0),_("span",Dee,O(i.value),1),o.node.collapsible?(w(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),T("svg",{style:Yt({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,Pee)):ae("",!0)]),Fn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Bs),{"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,Hee),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Oh.install=e=>{e.component(Oh.__name,Oh)};const a5=()=>ms(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let sh=null,Wee=a5;function x_e(){return Xn(this,null,function*(){if(sh)return sh;const e=Wee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===a5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(sh=(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),sh):null})}function w_e(){return!1}function __e(){return Xn(this,null,function*(){return null})}const ih=X(!1);let dC=!1;function tg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function zee(){return!dC&&typeof window<"u"&&typeof document<"u"&&(dC=!0,ih.value=tg(),new MutationObserver(()=>{ih.value=tg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ih.value=tg()})),ih}const c5=["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"],Uee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Pv=[...c5].sort((e,t)=>t.length-e.length).join("|"),ng=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Pv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Pv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),u5=/[),.;!?,。;!?)]+$/;function qee(e){const t=e.toLowerCase();return c5.some(n=>t.endsWith(`.${n}`))}function jee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Pv}))["']`,"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 Vee(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(u5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Uee.has(i),a=qee(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 Kee(e,t={}){const n=[];ng.lastIndex=0;let o;for(;(o=ng.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(u5,""),u=a.length-c.length;a=c;const d=Vee(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(ng.lastIndex-=u)}return n}const Gee=12e4,Yee=6e4,Zee=32,Qee=3e4,fC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Xee(e){let t=0,n=0,o=0;fC.lastIndex=0;let s;for(;(s=fC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Gee||n>=Yee||t>=Zee||o>=Qee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Jee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function ete(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const tte={key:1,class:"diff-wrap"},nte={class:"diff-bar"},ote=["aria-label","onClick"],ste={class:"diff-pre"},ite={key:0,class:"diff-sign"},rte={class:"diff-text"},lte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hC="github-light",pC="github-dark",ate=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){BQ(),ZQ(),PQ(),tX(),DQ(new Jee),eX(new ete);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Tt(),o=Kt("resolveImage"),s=X(null),i=e,r=B(()=>!i.streaming),l=B(()=>jee(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Xee(i.text??"")),c=zee(),u=B(()=>!i.streaming),d=Bo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(]*?\bsrc=")([^"]+)(")/gi;function g(R){return!/^(https?:|data:|blob:)/i.test(R)}function b(R){if(!o)return;const D=[];for(const z of[h,p]){z.lastIndex=0;let H;for(;(H=z.exec(R))!==null;)D.push(H[2]??"")}for(const z of D)!z||!g(z)||d.has(z)||f.has(z)||(f.add(z),o(z).then(H=>{d.set(z,H!==z?H:"")}).catch(()=>{d.set(z,"")}).finally(()=>{f.delete(z)}))}function v(R){if(!o)return R;const D=z=>{if(!g(z))return null;const H=d.get(z);return H===void 0?lte:H===""?null:H};return R.replace(h,(z,H,U,Z)=>{const K=D(U);return K===null?z:`${H}${K}${Z}`}).replace(p,(z,H,U,Z)=>{const K=D(U);return K===null?z:`${H}${K}${Z}`})}Qe(()=>i.text,R=>b(R??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let z=R.nextNode();for(;z;){const H=z,U=H.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&H.data.trim().length>0&&D.push(H),z=R.nextNode()}for(const H of D){const U=Kee(H.data,{aliases:l.value});if(U.length===0||!H.parentNode)continue;const Z=document.createDocumentFragment();let K=0;for(const V of U){V.start>K&&Z.append(document.createTextNode(H.data.slice(K,V.start)));const J=document.createElement("button");J.type="button",J.className="md-file-link",J.textContent=V.text,J.title=V.line?`${V.path}:${V.line}`:V.path,J.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:V.path,line:V.line})}),Z.append(J),K=V.end}K{H.preventDefault(),H.stopPropagation(),i.openFile?.({path:k(z)})}))}}function $(){mt().then(()=>{m(),A()})}Qe(()=>i.text,$),Qe(()=>i.streaming,$);let N=null;cn(()=>{$(),s.value&&(N=new MutationObserver($),N.observe(s.value,{childList:!0,subtree:!0}))}),bn(()=>{N?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},I=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,E=B(()=>{const R=v(i.text??""),D=[];let z=0;I.lastIndex=0;let H;for(;(H=I.exec(R))!==null;){const Z=H[1]??"",K=R.slice(z,H.index)+(Z||"");K.trim()&&D.push({kind:"md",text:K}),D.push({kind:"diff",code:H[2]??""}),z=I.lastIndex}const U=R.slice(z);return(U.trim()||D.length===0)&&D.push({kind:"md",text:U}),D});function F(R){return R.split(` +`).map(D=>D.startsWith("@@")?{type:"hunk",sign:"",text:D}:/^\+(?!\+\+)/.test(D)?{type:"add",sign:"+",text:D.slice(1)}:/^-(?!--)/.test(D)?{type:"del",sign:"-",text:D.slice(1)}:D.startsWith(" ")?{type:"ctx",sign:"",text:D.slice(1)}:{type:"ctx",sign:"",text:D})}const S=X(null);function L(R,D){Go(R).then(z=>{z&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(R,D)=>(w(),T("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),T(Pe,null,ot(E.value,(z,H)=>(w(),T(Pe,{key:H},[z.kind==="md"?(w(),xe(C(Bs),{key:0,content:z.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":hC,"code-block-dark-theme":pC,themes:[hC,pC],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:C(LI)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(w(),T("div",tte,[_("div",nte,[D[0]||(D[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Xt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:U=>L(z.code,H)},[re(Ve,{name:S.value===H?"check":"copy",size:"sm"},null,8,["name"])],8,ote)]),_:2},1032,["text"])]),_("pre",ste,[_("code",null,[(w(!0),T(Pe,null,ot(F(z.code),(U,Z)=>(w(),T("span",{key:Z,class:We(["diff-line",`diff-${U.type}`])},[U.type!=="hunk"?(w(),T("span",ite,O(U.sign),1)):ae("",!0),_("span",rte,O(U.text),1)],2))),128))])])]))],64))),128))],512))}}),Wm=ct(ate,[["__scopeId","data-v-72f31a12"]]),cte={class:"tc-anim"},ute={class:"prev-anim"},dte={class:"prev"},fte=Ze({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&s.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>s.value.at(-1)??""),a=X(null);return cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),T("div",{class:We(["think",{mob:e.mobile}])},[i.value?(w(),T("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",cte,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",ute,[_("span",dte,O(l.value),1)])],2)):(w(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),hte=ct(fte,[["__scopeId","data-v-fdc551ea"]]),pte={class:"activity-notice",role:"status"},mte={"aria-hidden":"true"},gte={class:"an-label"},vte=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),T("div",pte,[_("span",mte,[re(Ds,{size:"sm"})]),_("span",gte,O(e.label),1)]))}}),yte=ct(vte,[["__scopeId","data-v-0d497074"]]);function kte(e,t="昨天"){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 bte=Ze({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),o=X(!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:kte(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(w(),T("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),d5=ct(bte,[["__scopeId","data-v-9672fbd5"]]);function xte(e){return e.length===1?`0${e}`:e}function wte(e,t){return`${String(Number(e))}:${xte(t)}`}const mC=e=>/^\d+$/.test(e);function _te(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(mC(o)&&mC(s)&&c){const f=wte(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 Ste=["data-turn-id"],Cte={class:"cn-bubble"},Ate={class:"cn-title"},Mte={key:0,class:"cn-prompt"},Ete={class:"cn-meta"},Tte={key:0,class:"cn-meta-item"},Nte={key:1,class:"cn-meta-item"},Ite=["aria-label"],Lte=["title"],$te=Ze({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),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?_te(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)=>(w(),T("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",Cte,[_("span",Ate,O(i.value),1),c.value?(w(),T("span",Mte,O(c.value),1)):ae("",!0)]),_("div",Ete,[re(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(w(),T("span",Tte,O(r.value),1)):ae("",!0),a.value?(w(),T("span",Nte,O(a.value),1)):ae("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):(w(),xe(Ve,{key:1,name:"close",size:"sm"}))],10,Ite),o.value?.jobId?(w(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Lte)):ae("",!0),e.createdAt?(w(),xe(d5,{key:3,time:e.createdAt},null,8,["time"])):ae("",!0)])],10,Ste))}}),Fte=ct($te,[["__scopeId","data-v-a62a6587"]]),Ote=["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"],f5=500,Fp=256*1024,gC=200,og=16384,sg=500,ig=50,rg=50,Rte=6,Bte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Dte=/^[A-Za-z0-9+/=_-]{200,}$/;let lg=null;function Hi(){if(lg!==null)return lg;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=mo(Ft.debug)==="1"),lg=e,e}const El=[],Tc=[];let Vu=0;const ma=[];let Ku=0,Pte=1;const Op=new TextEncoder,Hte=new Set(Ote),Ik=X(0),Gu=Ba(!1);function Wte(){return El}function zte(){El.length=0,Tc.length=0,Vu=0,ma.length=0,Ku=0,Ik.value++}function jr(e){if(!Gu.value){try{const t={id:Pte++,ts:Date.now(),source:e.source,kind:String(jc(e.kind)),label:String(jc(e.label)),sessionId:e.sessionId===void 0?void 0:String(jc(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:Wl(e.detail)},n=JSON.stringify(t),o=Op.encode(n).byteLength;if(o>Fp)return;for(El.push(t),Tc.push(n),Vu+=o+(Tc.length>1?1:0);El.length>f5||Vu>Fp;){const s=Tc.shift();El.shift(),s!==void 0&&(Vu-=Op.encode(s).byteLength,Tc.length>0&&(Vu-=1))}}catch{return}Ik.value++}}function aa(e){if(typeof e=="string")return e.length<=gC?e:e.slice(0,gC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ute(e,t){if(Hte.has(e))try{const n={ts:Date.now(),event:e,sessionId:aa(t?.sessionId),status:aa(t?.status),operation:aa(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:aa(t?.promptId),zipBytes:li(t?.zipBytes),errorName:aa(t?.errorName),errorCode:li(t?.errorCode),requestId:aa(t?.requestId),phase:aa(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=Op.encode(o).byteLength;if(s>Fp)return;for(ma.push(o),Ku+=s+(ma.length>1?1:0);ma.length>f5||Ku>Fp;){const i=ma.shift();i!==void 0&&(Ku-=Op.encode(i).byteLength,ma.length>0&&(Ku-=1))}}catch{return}}function jc(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 Dte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>sg?`${i.slice(0,sg)}… [+${i.length-sg} chars]`:i}if(n!=="object")return String(e);if(t>=Rte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,ig).map(r=>jc(r,t+1));return e.length>ig&&i.push(`[+${e.length-ig} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,rg))o[i]=Bte.test(i)?"[redacted]":jc(r,t+1);return s.length>rg&&(o._truncatedKeys=s.length-rg),o}function Wl(e){if(e===void 0)return;const t=jc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>og)return{_truncated:`detail JSON was ${n.length} chars; first ${og} kept`,preview:n.slice(0,og)}}catch{return"[unserializable detail]"}return t}function rh(e){Hi()&&jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Wl(e.body)}})}function cc(e){if(!Hi())return;const t=e.code!==0;jr({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:Wl(e.data)}})}function al(e){Hi()&&jr({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 uc(e,t){Hi()&&jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Wl(t)})}function qte(e){if(!Hi())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;jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Wl(e)})}function jte(e){if(!Hi())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);jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Wl(t.payload)})}const Vte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Kte(e,t,n){Hi()&&jr({source:"client",kind:`client:${e}`,label:`${Vte[e]} ${t}`,detail:Wl(n)})}function Er(e,t){Hi()&&jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Wl(t)})}function ko(e,t){Ute(e,t),jr({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 ag=!1,lh=null;function Gte(){if(ag)return()=>lh?.();ag=!0;const e=[];try{if(typeof window<"u"){const n=s=>{ko("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;ko("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(Hi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Kte(n,i.map(Yte).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(lh===t){for(const n of e.toReversed())n();lh=null,ag=!1}};return lh=t,t}function Yte(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 h5(e=El){if(typeof document>"u")return;const t=new Blob([Zte(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-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 Zte(e=El){return e===El?Tc.join(` +`):e.map(t=>JSON.stringify(t)).join(` +`)}function Qte(){return ma.join(` +`)}function p5(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 Hv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(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:p5(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 pd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function vC(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 Lk(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:vC(e.source)};case"video":return{type:"video",source:vC(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 Wv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Lk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Xte(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 Jte(e){return{content:e.content.map(Xte),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function ene(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function m5(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 tne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function nne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(tne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function g5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(nne),createdAt:e.created_at}}function one(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 sne(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=one(o);return{answers:t,method:e.method,note:e.note}}function Rh(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,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function yC(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 cl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function dc(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 v5(e){if(!e||typeof e!="object")return null;const t=e,n=cl(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:cl(t,"goalId")??cl(t,"goal_id")??"goal",objective:cl(t,"objective")??"",completionCriterion:cl(t,"completionCriterion")??cl(t,"completion_criterion"),status:n,turnsUsed:dc(t,"turnsUsed")??dc(t,"turns_used")??0,tokensUsed:dc(t,"tokensUsed")??dc(t,"tokens_used")??0,wallClockMs:dc(t,"wallClockMs")??dc(t,"wall_clock_ms")??0,terminalReason:cl(t,"terminalReason")??cl(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 ine(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:pd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:pd(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:p5(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=v5(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:Wv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Lk),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:m5(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:g5(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:Rh(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:zv(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 rne(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}}function kC(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 zv(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,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,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 lne(e){return e.session_id}function ane(e){return e.seq}const cne="main",une=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 Sr(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 dne(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}}function bC(){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 ds(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ua(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 fne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ds(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ds(t,"goalId")??ds(t,"goal_id")??"goal",r=ds(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ds(t,"completionCriterion")??ds(t,"completion_criterion"),status:s,turnsUsed:ua(t,"turnsUsed")??ua(t,"turns_used")??0,tokensUsed:ua(t,"tokensUsed")??ua(t,"tokens_used")??0,wallClockMs:ua(t,"wallClockMs")??ua(t,"wall_clock_ms")??0,terminalReason:ds(t,"terminalReason")??ds(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 ga(e,t,n,o){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"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function hne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ds(t,"name")??ds(t,"toolName")??"tool",o=Pa(pne(n)),s=mne(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=ds(n,"text");if(s)return cg(s);const i=ds(n,"message");if(i)return cg(i)}const o=ds(t,"message");if(o)return cg(o)}return null}function pne(e){return e.replace(/_\d+$/,"")}const xC=2e3;function cg(e){return e.length>xC?`${e.slice(0,xC)}…`:e}function mne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Ed(e,n)}function gne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ds(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ga(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=hne(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ga(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 Du(e){return{...e,content:e.content.map(t=>({...t}))}}function wC(e,t,n){const o={id:Sr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function vne(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 yne(e){return Array.isArray(e)?e.map(t=>Lk(t)):[]}function _C(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 kne(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 bne(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 SC(e,t){e.messages.find(n=>n.id===t)}function xne(e,t,n,o,s,i){const r={id:Sr("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 Pu(e,t){return e.messages.find(n=>n.id===t)}function CC(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 wne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=bC(),e.set(u,d)),d}function o(u){e.set(u,bC())}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),h=d.promptId??Sr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=wC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Du(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":du?"gap":"append"}function c(u,d,f,h){const p=n(f),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==cne){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(une.has(u))return gne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=yne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=vne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Du(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??Sr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Pu(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=wC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Du(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",N=g?.args??g?.input??{};kne(p,m,A,$,N);const x=Pu(p,m);x&&x.content.length-1,p.toolStartTimes.set(A,Date.now()),x&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:x.content.map(I=>({...I})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=bne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const N=xne(p,f,k,A,$,y);b.push({type:"messageCreated",message:Du(N)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=dne(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){SC(p,m);const k=Pu(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:CC(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0,thinking:typeof g?.thinkingEffort=="string"&&g.thinkingEffort.length>0?g.thinkingEffort:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=ua(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){SC(p,m);const $=Pu(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(N=>({...N})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=CC(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Pu(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:Sr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=ga(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=ga(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):Sr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:_n.global.t("tasks.defaultDescription");if(m.kind==="agent"){const N=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(N!==void 0){const x=ga(p,f,N,{description:A,backgroundTaskId:k,runInBackground:!0});x&&b.push({type:"taskCreated",sessionId:f,task:x})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=fne(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=ds(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:Sr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:Du(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const _ne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),AC=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","background.task.started","background.task.terminated","cron.fired"]),Sne=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"]),Cne=new Set(["assistant.delta","thinking.delta"]);function Ane(e,t){if(_ne.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return Cne.has(o)?Mne(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?Sne.has(o)?{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function Mne(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 Yu 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 xr 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 vi(e){return e instanceof Yu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function $k(e){return e instanceof xr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const zo="kimi-web.server-credential",Ene="token",Tne=10080*60*1e3;let or;const Uv=new Set;function Nne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Ene);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 qv(e){return{version:1,credential:e,expiresAt:Date.now()+Tne}}function Ine(e){return JSON.stringify(e)}function Fk(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 jv(e){globalThis.localStorage?.setItem(zo,Ine(e))}function Lne(){try{const e=globalThis.localStorage?.getItem(zo);if(e){const n=Fk(e);if(n===void 0){const o=qv(e);let s=!1;try{jv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(zo),globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo);return}const t=globalThis.sessionStorage?.getItem(zo);if(t){const n=qv(t);let o=!1;try{jv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo),o=!0}catch{}return o?n:void 0}return}catch{return}}function $ne(){const e=Nne();return e?(k5(e),!0):(or=Lne(),or!==void 0)}function y5(){if(or!==void 0){if(or.expiresAt<=Date.now()){Fne(or);return}return or.credential}}function Fne(e){or=void 0;try{globalThis.sessionStorage?.removeItem(zo);const t=globalThis.localStorage?.getItem(zo),n=t==null?void 0:Fk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(zo)}catch{}}function k5(e){const t=qv(e);or=t;try{jv(t)}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}}function One(){const e=or;or=void 0;try{const t=globalThis.localStorage?.getItem(zo),o=(t==null?void 0:Fk(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(zo),globalThis.sessionStorage?.removeItem(zo)}catch{}}function Rne(e){return Uv.add(e),()=>{Uv.delete(e)}}function Bne(){One();for(const e of Uv)try{e()}catch{}}const kc=3e4,ah=5*6e4,b5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",MC=500,x5=40101;function ch(e=kc){try{return AbortSignal.timeout(e)}catch{return}}function Dne(e,t){let n="",o=e;for(let s=0;sb5[n%32]).join("")}function uh(){return`${Dne(Date.now(),10)}${Pne(16)}`}function Hne(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 ug(e){try{const t=await e.text();return t?t.length>MC?`${t.slice(0,MC)}...`:t:void 0}catch{return}}class Wne{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=Sc(this.origin,t),o=uh(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();rh({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:ch()})}catch(a){throw al({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new xr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return cc({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),cc({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 Yu({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=Sc(this.origin,t),r=uh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();rh({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:ch(ah)})}catch(h){throw al({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new xr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:ah,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 h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw cc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new Yu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new xr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await ug(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new xr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return cc({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=Sc(this.origin,t),s=uh(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();rh({method:"POST",path:t,url:o,requestId:s,body:Hne(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:ch()})}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new xr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new xr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:kc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await ug(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(cc({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 Yu({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 delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=Sc(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=uh(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();rh({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:ch()})}catch(h){throw al({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new xr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw al({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new xr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:kc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await ug(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(cc({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 Yu({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=y5();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===x5)&&Bne()}}const zne="kimi-code.bearer.",Une=3e4;class qne{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];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(),uc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=y5(),n=t!==void 0?[`${zne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{uc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));jte(i),this.handleFrame(i)}catch(i){uc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{uc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{uc("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,uc("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]}})}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=dh(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(dh(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(dh(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,Une),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;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,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 o=n.session_id,s=n.terminal_id,i=n.seq,r=dh(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=Ane(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.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 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}})}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)),qte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function dh(e,t){return`${e}\0${t}`}function jne(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 EC(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 dg(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 TC(e){return e==="auto_compact"||e==="manual_compact"}class Vne{http;config;constructor(t){this.config=t,this.http=new Wne(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"}}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(Ni),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 Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(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.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),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),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ni(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,swarmMode:n.swarm_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 v5(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 Ni(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(Wv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();ko("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:Ni(o.session),messages:o.messages.items.map(Wv),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(m5),pendingQuestions:o.pending_questions.map(g5),subagents:(o.subagents??[]).map(Rh)};return ko("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw ko("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...EC(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:jne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();ko("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`,Jte(n));return ko("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 ko("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...EC(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 Ni(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 Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}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)}`,ene(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)}`,sne(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(Rh)}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 Rh(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(dg)}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 dg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return dg(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}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}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(yC)])):void 0;return{items:s.items.map(yC),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);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 searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/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 Sc(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 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(pd)}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 pd(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 pd(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 listModels(){return(await this.http.get("/models")).items.map(rne)}async listProviders(){return(await this.http.get("/providers")).items.map(kC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return kC(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return fg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return fg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return fg(t)}async getConfig(){const t=await this.http.get("/config");return zv(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",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 zv(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}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 Sc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=MI(this.config.serverHttpUrl,this.config.clientId),o=wne(),s=new qne(n,this.config.clientId,{onWireEvent:i=>{const r=lne(i),l=ane(i),a=ine(i);a.type==="historyCompacted"&&!TC(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 h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!TC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},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)},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)},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 fg(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}}let NC;function dt(){return NC??=new Vne(wI()),NC}const Kne=["src","controls","muted"],Gne=["src","alt"],w5=Ze({__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=X(t.fileId?"":t.url),o=X(null),s=X(!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 dt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Qe(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),cn(()=>{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}),po(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),T("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Kne)):(w(),T("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Gne))}}),Yne=["title","data-kind"],Zne=["aria-label"],Qne={class:"att-tile"},Xne={class:"att-name"},Jne={key:1,class:"att-err"},eoe=["aria-label"],toe=Ze({__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}=Tt(),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)=>(w(),T("span",{class:We(["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[0]||(d[0]=f=>o("activate"))},[_("span",Qne,[e.kind==="image"&&e.url?(w(),xe(w5,{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"?(w(),xe(Ve,{key:1,name:"play",size:"sm"})):e.kind==="image"?(w(),xe(Ve,{key:2,name:"image",size:"sm"})):(w(),xe(Ve,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Xne,O(l.value),1),e.uploading?(w(),xe(Ds,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(w(),T("span",Jne,[re(Ve,{name:"info",size:"sm"})])):ae("",!0)],8,Zne),e.removable?(w(),xe(Xt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ee(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[re(Ve,{name:"close",size:"sm"})],8,eoe)]),_:1},8,["text"])):ae("",!0)],10,Yne))}}),_5=ct(toe,[["__scopeId","data-v-12ec975b"]]),noe=["aria-label"],ooe=120,soe=60,ioe=Ze({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*ooe}ms`,"--moon-frame-fast-delay":`${o*soe}ms`}}return(o,s)=>(w(),T("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),T(Pe,null,ot(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,noe))}}),S5=ct(ioe,[["__scopeId","data-v-a6b7ec07"]]),tr=X(null),Vc=X(!1);function Ok(e){const t=tr.value;!t||Vc.value||(tr.value=null,t.resolve(e))}async function roe(){const e=tr.value;if(!(!e||Vc.value)){if(!e.action){Ok(!0);return}Vc.value=!0;try{await e.action(),tr.value===e&&(tr.value=null),e.resolve(!0)}catch(t){tr.value===e&&(tr.value=null),e.reject(t)}finally{Vc.value=!1}}}function loe(e){return Vc.value?Promise.resolve(!1):(tr.value&&Ok(!1),new Promise((t,n)=>{tr.value={...e,resolve:t,reject:n}}))}function tf(){return{current:tr,busy:Vc,confirm:loe,settle:Ok,runAction:roe}}const aoe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,coe=/^(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,uoe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,IC="text/plain;charset=utf-8";function doe(e,t){const n=(t??"").toLowerCase();if(aoe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:IC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:coe.test(o)?IC:uoe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function C5(e,t,n){const o=doe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await dt().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"}const foe={class:"chat"},hoe={key:0,class:"chat-loading"},poe={class:"chat-loading-text"},moe={key:1,class:"chat-empty"},goe={key:1,class:"top-sentinel-text"},voe={key:0,class:"u-turn"},yoe=["data-turn-id"],koe={key:0,class:"u-atts"},boe={key:1,class:"skill-act"},xoe={class:"skill-act-head"},woe={key:0,class:"skill-act-args"},_oe={key:2,class:"skill-act"},Soe={class:"skill-act-head"},Coe={key:0,class:"skill-act-args"},Aoe={key:3,class:"u-text"},Moe={key:0,class:"u-meta"},Eoe=["aria-label","onClick"],Toe=["aria-label","onClick"],Noe=["data-turn-id"],Ioe=["onClick"],Loe={class:"cd-view"},$oe={key:1,class:"cd-label"},Foe=["data-turn-id"],Ooe={key:1,class:"msg"},Roe={key:0,class:"a-msg-ft"},Boe={key:0,class:"a-duration"},Doe=["aria-label","onClick"],Poe={key:4,class:"sending-placeholder"},Hoe={key:5,class:"q-stack"},Woe={class:"q-head"},zoe={class:"q-title"},Uoe={class:"q-hint"},qoe=["onDragover","onDrop"],joe={class:"u-bub q-bub"},Voe=["title","onDragstart"],Koe=["title","onClick"],Goe={key:0,class:"u-text q-text"},Yoe={key:1,class:"q-text q-text-placeholder"},Zoe={key:0,class:"q-imgs"},Qoe={key:0,class:"q-file"},Xoe={key:1,class:"q-tag q-tag-next"},Joe={key:2,class:"q-tag q-tag-idx"},ese=["aria-label","onClick"],tse={key:0,class:"open-unsupported",role:"status"},nse=2500,ose=Ze({__name:"ChatPane",props:{turns:{},approvals:{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},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),{confirm:s}=tf();bn(()=>{K!==null&&(clearTimeout(K),K=null),L!==null&&(clearTimeout(L),L=null),I!==null&&(clearTimeout(I),I=null),ce!==null&&(clearTimeout(ce),ce=null)});const i=e,r=X(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Te=>{Te[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}cn(a),bn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=B(()=>{if(!i.turnActive||i.turns.length===0)return null;const Te=i.turns.at(-1);return Te.role==="assistant"?Te.id:null}),u=B(()=>i.working),d=n,f=X(null),h=X(null);function p(Te){return(Te.attachments?.length??0)>0}function g(Te){d("editQueued",Te)}function b(Te,Ae){if(f.value=Te,!Ae.dataTransfer)return;Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain",String(Te));const P=Ae.currentTarget?.closest(".q-turn");P&&Ae.dataTransfer.setDragImage(P,24,24)}function v(Te,Ae){if(f.value===null)return;Ae.preventDefault(),Ae.dataTransfer&&(Ae.dataTransfer.dropEffect="move");const P=Ae.currentTarget.getBoundingClientRect(),le=Ae.clientY{for(let Te=i.turns.length-1;Te>=0;Te--)if(i.turns[Te].role==="user")return i.turns[Te].id;return null});function A(Te){return Te.role==="user"&&Te.id===k.value&&!i.working&&!Te.skillActivation&&!Te.pluginCommand}function $(Te){const Ae=Te.compaction,P=Ae?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof Ae?.tokensBefore=="number"&&typeof Ae?.tokensAfter=="number"?P+o("conversation.compactedTokens",{before:ir(Ae.tokensBefore),after:ir(Ae.tokensAfter)}):P}const N=X(null),x=X(null);let I=null;async function E(Te){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(Te)}function F(Te){x.value===null&&(x.value=Te.id,d("editMessage",{text:Te.text,attachments:Te.attachments}),I=setTimeout(()=>{I=null,x.value=null},nse))}Qe(()=>i.turns,Te=>{x.value!==null&&(Te.some(Ae=>Ae.id===x.value)||(x.value=null,I!==null&&(clearTimeout(I),I=null)))},{flush:"post"});const S=X(!1);let L=null;function R(){if(i.turns.length===0)return;const Te=[];for(const P of i.turns){if(P.role==="compaction"||P.role==="cron")continue;const le=P.role==="user"?"User":"Assistant",ne=CW(P);ne.trim()&&Te.push(`**${le}** + +${ne}`)}const Ae=Te.join(` + +--- + +`);Go(Ae).then(P=>{P&&(S.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,S.value=!1},2e3))}).catch(()=>{})}function D(Te){const Ae=[];for(let P=Te;P>=0;P--){const le=i.turns[P];if(!le||le.role!=="assistant")break;Ae.unshift(le)}return Ae}function z(Te){return D(Te).map(Ae=>SW(Ae)).filter(Boolean).join(` + +`)}function H(){for(let Te=i.turns.length-1;Te>=0;Te-=1)if(i.turns[Te]?.role==="assistant")return z(Te);return""}function U(){const Te=H();Te.trim()&&Go(Te).then(Ae=>{Ae&&(S.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:R,copyFinalSummary:U});function Z(Te){const Ae=i.turns[Te];if(!Ae||Ae.role!=="assistant")return!1;const P=i.turns[Te+1];return!P||P.role!=="assistant"}let K=null;function V(Te){const Ae=i.turns[Te];if(!Ae)return;const P=z(Te);P.trim()&&Go(P).then(le=>{le&&(N.value=Ae.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,N.value=null},1400))}).catch(()=>{})}function J(Te){const Ae=Te.text;Ae.trim()&&Go(Ae).then(P=>{P&&(N.value=Te.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,N.value=null},1400))}).catch(()=>{})}function fe(Te){return{kind:Te.kind==="video"?"video":"image",url:Te.url,path:Te.name,fileId:Te.fileId}}const oe=X(null);let ce=null;function ue(Te){if(Te.kind==="image"||Te.kind==="video"){d("openMedia",fe(Te));return}Te.fileId!==void 0&&C5(Te.fileId,Te.name,Te.mediaType).then(Ae=>{Ae==="unsupported"&&(oe.value=Te.name??Te.fileId??"",ce!==null&&clearTimeout(ce),ce=setTimeout(()=>{ce=null,oe.value=null},2400))})}function Se(Te,Ae){return Te.id!==c.value?!1:Ae.sourceIndex===xm(Te).length-1}return(Te,Ae)=>(w(),T(Pe,null,[_("div",foe,[e.sessionLoading?(w(),T("div",hoe,[re(Ds,{size:"sm"}),_("span",poe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),T("div",moe)):ae("",!0),e.hasMoreMessages||e.loadingMore?(w(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),T("span",goe,[re(Ds,{size:"sm"}),Je(" "+O(C(o)("conversation.loadingOlder")),1)])):(w(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ae[0]||(Ae[0]=P=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):ae("",!0),(w(!0),T(Pe,null,ot(e.turns,(P,le)=>(w(),T(Pe,{key:P.id},[P.role==="user"?(w(),T("div",voe,[_("div",{class:We(["u-bub turn-anchor",{undoing:x.value===P.id}]),"data-turn-id":P.id},[P.attachments&&P.attachments.length>0?(w(),T("div",koe,[(w(!0),T(Pe,null,ot(P.attachments,(ne,q)=>(w(),xe(_5,{key:q,kind:ne.kind,name:ne.name,url:ne.url,"file-id":ne.fileId,"media-type":ne.mediaType,size:ne.size,onActivate:ee=>ue(ne)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ae("",!0),P.skillActivation?(w(),T("div",boe,[_("div",xoe,[Ae[9]||(Ae[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:P.skillActivation.name})),1)]),P.skillActivation.args?(w(),T("div",woe,O(P.skillActivation.args),1)):ae("",!0)])):P.pluginCommand?(w(),T("div",_oe,[_("div",Soe,[Ae[10]||(Ae[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(P.pluginCommand.pluginId)+":"+O(P.pluginCommand.commandName),1)]),P.pluginCommand.args?(w(),T("div",Coe,O(P.pluginCommand.args),1)):ae("",!0)])):(w(),T("div",Aoe,O(P.text),1))],10,yoe),P.createdAt||A(P)?(w(),T("div",Moe,[A(P)?(w(),T("div",{key:0,class:We(["u-edit-wrap",{undoing:x.value===P.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:ne=>E(P)},[re(Ve,{name:"undo",size:"sm"})],8,Eoe)],2)):ae("",!0),P.text.trim().length>0?(w(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:bt(ne=>J(P),["stop"])},[N.value!==P.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Toe)):ae("",!0),P.createdAt?(w(),xe(d5,{key:2,time:P.createdAt},null,8,["time"])):ae("",!0)])):ae("",!0)])):P.role==="compaction"?(w(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":P.id,role:"separator"},[Ae[11]||(Ae[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),P.text?(w(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ne=>d("openCompaction",{turnId:P.id})},[_("span",null,O($(P)),1),_("span",Loe,O(C(o)("conversation.viewSummary")),1)],8,Ioe)):(w(),T("span",$oe,O($(P)),1)),Ae[12]||(Ae[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Noe)):P.role==="cron"?(w(),xe(Fte,{key:2,text:P.text,cron:P.cron,"turn-id":P.id,"created-at":P.createdAt},null,8,["text","cron","turn-id","created-at"])):(w(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":P.id},[(w(!0),T(Pe,null,ot(C(_W)(P),(ne,q)=>(w(),T(Pe,{key:C(AW)(ne,q)},[ne.kind==="thinking"?(w(),xe(hte,{key:0,text:ne.thinking,mobile:"",streaming:Se(P,ne),onOpen:ee=>d("openThinking",{turnId:P.id,blockIndex:ne.sourceIndex})},null,8,["text","streaming","onOpen"])):ne.kind==="text"&&ne.text?(w(),T("div",Ooe,[re(Wm,{text:ne.text,streaming:Se(P,ne),"open-file":ee=>d("openFile",ee)},null,8,["text","streaming","open-file"])])):ne.kind==="tool-stack"?(w(),xe($W,{key:2,tools:ne.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[1]||(Ae[1]=ee=>d("openMedia",ee)),onOpenFile:Ae[2]||(Ae[2]=ee=>d("openFile",ee)),onOpenToolDiff:Ae[3]||(Ae[3]=ee=>d("openToolDiff",ee)),onOpenAgent:Ae[4]||(Ae[4]=ee=>d("openAgent",ee))},null,8,["tools","tool-diff-panel"])):ne.kind==="tool"?(w(),xe(TA,{key:3,tool:ne.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[5]||(Ae[5]=ee=>d("openMedia",ee)),onOpenFile:Ae[6]||(Ae[6]=ee=>d("openFile",ee)),onOpenToolDiff:Ae[7]||(Ae[7]=ee=>d("openToolDiff",ee)),onOpenAgent:Ae[8]||(Ae[8]=ee=>d("openAgent",ee))},null,8,["tool","tool-diff-panel"])):ae("",!0)],64))),128)),P.id!==c.value&&Z(le)&&(z(le).trim().length>0||P.durationMs!==void 0)?(w(),T("div",Roe,[re(Xt,{text:`${P.durationMs} ms`},{default:Ee(()=>[P.durationMs!==void 0?(w(),T("span",Boe,O(C(bW)(P.durationMs)),1)):ae("",!0)]),_:2},1032,["text"]),z(le).trim().length>0?(w(),T("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:ne=>V(le)},[N.value!==P.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Doe)):ae("",!0)])):ae("",!0)],8,Foe))],64))),128)),e.compaction?(w(),xe(yte,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ae("",!0),u.value?(w(),T("div",Poe,[re(S5,{fast:e.fastMoon},null,8,["fast"])])):ae("",!0),e.queued.length>0?(w(),T("div",Hoe,[_("div",Woe,[_("span",zoe,[re(Ve,{name:"mail",size:"sm"}),Je(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",Uoe,O(C(o)("composer.queueAutoDrain")),1)]),(w(!0),T(Pe,null,ot(e.queued,(P,le)=>(w(),T("div",{key:le,class:We(["u-turn q-turn",{"q-dragging":f.value===le,"drop-before":h.value?.index===le&&h.value.position==="before","drop-after":h.value?.index===le&&h.value.position==="after"}]),onDragover:ne=>v(le,ne),onDrop:ne=>m(le,ne)},[_("div",joe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:ne=>b(le,ne),onDragend:y},[re(Ve,{name:"grip",size:"sm"})],40,Voe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:ne=>g(le)},[P.text?(w(),T("span",Goe,O(P.text),1)):(w(),T("span",Yoe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(C(o)("composer.queuedAttachments",{n:P.attachments?.length??0})),1)]))],8,Koe),p(P)?(w(),T("div",Zoe,[(w(!0),T(Pe,null,ot(P.attachments,(ne,q)=>(w(),T(Pe,{key:q},[ne.kind==="file"?(w(),T("span",Qoe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(ne.name??ne.fileId),1)])):(w(),xe(w5,{key:1,url:ne.url,kind:ne.kind,"file-id":ne.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ae("",!0),le===0?(w(),T("span",Xoe,O(C(o)("composer.queueNext")),1)):(w(),T("span",Joe,"#"+O(le+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:bt(ne=>d("unqueue",le),["stop"])},[re(Ve,{name:"close",size:"sm"})],8,ese)])],42,qoe))),128))])):ae("",!0)]),oe.value!==null?(w(),T("div",tse,O(C(o)("composer.attachmentOpenUnsupported",{name:oe.value})),1)):ae("",!0)],64))}}),A5=ct(ose,[["__scopeId","data-v-d2cc4eff"]]),sse={class:"ch-id"},ise={key:0,class:"ch-ws"},rse={key:1,class:"ch-sep"},lse=["onKeydown"],ase={class:"ch-ses"},cse={key:0,class:"ch-pill ch-sync-pill"},use={key:0,class:"ch-ahead"},dse={key:1,class:"ch-behind"},fse={key:1,class:"ch-pill ch-diff-pill"},hse={key:0,class:"ch-add"},pse={key:1,class:"ch-del"},mse=Ze({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Tt(),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(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const K=d(Z);return u[K]?`pr-${K}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=X(!1),g=X(null),b=X(null),v=X({});function m(Z){const K=Z.target;b.value?.el?.contains(K)||g.value?.el?.contains(K)||A()}function y(){A()}async function k(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await mt();const K=g.value?.el,V=b.value?.el;if(!K||!V)return;const J=K.getBoundingClientRect(),fe=4,oe=8,ce=V.offsetWidth,ue=V.offsetHeight;let Se=J.bottom+fe;Se+ue>window.innerHeight-oe&&(Se=Math.max(oe,J.top-ue-fe));let Te=J.left;Te+ce>window.innerWidth-oe&&(Te=Math.max(oe,J.right-ce)),v.value={top:`${Math.round(Se)}px`,left:`${Math.round(Te)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}bn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function N(){s("copyFinalSummary"),A()}const x=X(!1);function I(){o.sessionId&&Go(o.sessionId).then(Z=>{Z&&(x.value=!0,setTimeout(()=>{x.value=!1},1200))})}const E=X(!1),F=X(""),S=X(null);async function L(){if(A(),!!o.sessionId){E.value=!0,F.value=o.sessionTitle??"",await mt();try{S.value?.focus(),S.value?.select()}catch{}}}function R(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),E.value=!1}function D(){E.value=!1}function z(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function H(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function U(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,K)=>(w(),T("header",{class:We(["chat-header",{"macos-desktop":C(Dc)}])},[_("div",sse,[e.workspaceName?(w(),T("span",ise,O(e.workspaceName),1)):ae("",!0),e.workspaceName&&e.sessionTitle?(w(),T("span",rse,"/")):ae("",!0),E.value?Fn((w(),T("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=V=>F.value=V),class:"ch-rename",type:"text",onKeydown:[nr(bt(R,["stop"]),["enter"]),nr(bt(D,["stop"]),["esc"])],onBlur:R,onClick:K[1]||(K[1]=bt(()=>{},["stop"]))},null,40,lse)),[[_s,F.value]]):e.sessionTitle?(w(),xe(Xt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",ase,O(e.sessionTitle),1)]),_:1},8,["text"])):ae("",!0)]),re(Pn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=bt(V=>k(V),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(w(),xe(kl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:Yt(v.value),onClick:K[3]||(K[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:$},{default:Ee(()=>[re(Ve,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(pn,{onClick:N},{default:Ee(()=>[re(Ve,{name:"file-text",size:"sm"}),Je(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),T(Pe,{key:0},[re(pn,{separator:""}),re(pn,{onClick:I},{default:Ee(()=>[re(Ve,{name:x.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(x.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(pn,{onClick:z},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(pn,{onClick:H},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(pn,{danger:"",onClick:U},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):ae("",!0)]),_:1},8,["style"])):ae("",!0),K[6]||(K[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),T("button",{key:1,type:"button",class:"ch-git",onClick:K[4]||(K[4]=V=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(w(),T("span",cse,[i.value>0?(w(),T("span",use,"↑"+O(i.value),1)):ae("",!0),r.value>0?(w(),T("span",dse,"↓"+O(r.value),1)):ae("",!0)])):ae("",!0),c.value?(w(),T("span",fse,[l.value>0?(w(),T("span",hse,"+"+O(l.value),1)):ae("",!0),a.value>0?(w(),T("span",pse,"-"+O(a.value),1)):ae("",!0)])):ae("",!0)])):ae("",!0),e.pr?(w(),T("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:K[5]||(K[5]=V=>e.pr&&s("openPr",e.pr.url))},[re(Ve,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):ae("",!0)],2))}}),gse=ct(mse,[["__scopeId","data-v-fa4451d4"]]),vse=["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"],LC=[[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 yse(e){if(e<=255)return vse[e];let t=0,n=LC.length-1;for(;t<=n;){const o=t+n>>1,s=LC[o];if(es[1]){t=o+1;continue}return s[2]}return"L"}function kse(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&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=yse(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p=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 Cse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` +`).replace(/[\r\f]/g,` +`):e}let hg=null,Ase;function Mse(){return hg===null&&(hg=new Intl.Segmenter(Ase,{granularity:"word"})),hg}const Ese=/\p{Script=Arabic}/u,zl=/\p{M}/u,Rk=/\p{Nd}/u;function $C(e){return Ese.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 rr(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 Tse(e){const t=nf(e);return t!==null&&(Bk.has(t)||La.has(t))}const Nse=new Set([" "," ","⁠","\uFEFF"]),Ise=new Set(["-","‐","–","—"]);function Lse(e){const t=nf(e);return t!==null&&Nse.has(t)}function $se(e){const t=nf(e);return t!==null&&Ise.has(t)}function M5(e,t){return Lse(e)?!1:t?!(Tse(e)||$se(e)):!0}const Bk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),zm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Dk=new Set(["'","’"]),La=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Fse=new Set([":",".","،","؛"]),Ose=new Set(["၏"]),Rse=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Bse(e){if(Pk(e))return!0;let t=!1;for(const n of e){if(La.has(n)||qm(n)){t=!0;continue}if(!(t&&zl.test(n)))return!1}return t}function Dse(e){for(const t of e)if(!Bk.has(t)&&!La.has(t))return!1;return e.length>0}function Pse(e){if(Pk(e))return!0;for(const t of e)if(!zm.has(t)&&!Dk.has(t)&&!zl.test(t)&&!qm(t))return!1;return e.length>0}function Pk(e){let t=!1;for(const n of e)if(!(n==="\\"||zl.test(n))){if(zm.has(n)||La.has(n)||Dk.has(n)){t=!0;continue}return!1}return t}function Um(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 nf(e){if(e.length===0)return null;const t=Um(e,e.length);return e.slice(t)}function Hse(e){for(const t of e)if(!zl.test(t))return t;return null}function Wse(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(!zl.test(o))return o;t=n}return null}const zse=[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 Use(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function qm(e){const t=e.codePointAt(0);return t!==void 0&&Use(t,zse)}function qse(e){const t=Wse(e);return t!==null&&qm(t)}function jse(e){const t=Hse(e);return t!==null&&Rk.test(t)}function Vse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(zl.test(o)){n--;continue}if(zm.has(o)||Dk.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Kse(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function OC(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 RC(e,t){return e&&t!==null&&Fse.has(t)}function Gse(e){const t=nf(e);return t!==null&&Ose.has(t)}function Yse(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 Vv(e){let t=e.length;for(;t>0;){const n=Um(e,t),o=e.slice(n,t);if(Rse.has(o))return!0;if(!La.has(o))return!1;t=n}return!1}function Zse(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 Qse=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Bi(e){return e.length===1?e[0]:e.join("")}function Xse(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Bi(n)}function Jse(e,t,n,o){if(!Qse.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=Zse(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:Bi(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:Bi(r),isWordLike:a,kind:i,start:l}),s}function Kv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const eie=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function tie(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:eie.test(n)&&t+1=e.len||Kv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u0&&(t.push(Bi(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 iie=new Set([":","-","/","×",",",".","+","–","—"]),rie=/[\p{P}\p{S}\p{Co}]/u,lie=/\p{Emoji_Presentation}/u,aie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function cie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function E5(e){const t=e.charCodeAt(0);return t<128?cie(t):!aie.has(e)&&!lie.test(e)&&rie.test(e)}function BC(e){let t=!1;for(const n of e)if(!zl.test(n)){if(!E5(n))return!1;t=!0}return t}function uie(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(zl.test(o)){t=n;continue}return E5(o)||qm(o)}return!1}function die(e,t,n,o){const s=!t&&BC(e),i=!o&&BC(n),r=qse(e),l=(t||r)&&uie(e);return!s&&!i&&!l||rr(e)||rr(n)?!1:(t||s||r)&&(o||i)}function T5(e){for(const t of e)if(Rk.test(t))return!0;return!1}function Rp(e){if(e.length===0)return!1;for(const t of e)if(!(Rk.test(t)||iie.has(t)))return!1;return!0}function fie(e){const t=[],n=[],o=[],s=[];for(let i=0;ii+1){t.push(Bi(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 pie(e){const t=[],n=[],o=[],s=[];for(let i=0;i1;for(let c=0;c0&&a[D]==="text"&&E&&f[D]&&p[D]||x&&s>0&&a[D]==="text"&&Dse(N.text)&&f[D]||x&&s>0&&a[D]==="text"&&g[D]?z():x&&s>0&&a[D]==="text"&&N.isWordLike&&F&&b[D]?(z(),l[D]=!0):I!==null&&s>0&&a[D]==="text"&&u[D]===I?d[D]=(d[D]??1)+1:x&&!N.isWordLike&&s>0&&a[D]==="text"&&!f[D]&&(Bse(N.text)||N.text==="-"&&l[D])?z():(i[s]=N.text,r[s]=[N.text],l[s]=N.isWordLike,a[s]=N.kind,c[s]=N.start,u[s]=I,d[s]=I===null?0:1,f[s]=E,h[s]=F,p[s]=L,g[s]=R,b[s]=RC(F,S),s++)}for(let $=0;$null);let m=-1;for(let $=s-1;$>=0;$--){const N=i[$];if(N.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(Pse(N)||N==="-"&&jse(i[m]))){const x=v[m]??[];x.push(N),v[m]=x,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$=0&&!M5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||rr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function bie(e,t,n="normal",o="normal"){const s=_se(n),i=s.mode==="pre-wrap"?Cse(e):Sse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=vie(i,t,s),l=o==="keep-all"?kie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:yie(l,s),...l}}let fc=null;const DC=new Map;let hc=null;const xie=96,wie=/\p{Emoji_Presentation}/u,_ie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let pg=null;const PC=new Map;function Hk(){if(fc!==null)return fc;if(typeof OffscreenCanvas<"u")return fc=new OffscreenCanvas(1,1).getContext("2d"),fc;if(typeof document<"u")return fc=document.createElement("canvas").getContext("2d"),fc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sie(e){let t=DC.get(e);return t||(t=new Map,DC.set(e,t)),t}function wl(e,t){let n=t.get(e);return n===void 0&&(n={width:Hk().measureText(e).width,containsCJK:rr(e)},t.set(e,n)),n}function jm(){if(hc!==null)return hc;if(typeof navigator>"u")return hc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},hc;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 hc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},hc}function Cie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function N5(){return pg===null&&(pg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),pg}function Aie(e){return wie.test(e)||e.includes("️")}function Mie(e){return _ie.test(e)}function Eie(e,t){let n=PC.get(e);if(n!==void 0)return n;const o=Hk();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 PC.set(e,n),n}function Tie(e){let t=0;const n=N5();for(const o of n.segment(e))Aie(o.segment)&&t++;return t}function Nie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Tie(e)),t.emojiCount}function ba(e,t,n){return n===0?t.width:t.width-Nie(e,t)*n}function Iie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=N5(),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=wl(d,n);u.push(ba(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>xie){const u=[];let d=null,f=0;for(const h of r){const p=wl(h,n),g=ba(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=wl(b,n);u.push(ba(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=wl(a,n),f=ba(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Lie(e,t){const n=Hk();n.font=e;const o=Sie(e),s=Cie(e),i=t?Eie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function $ie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function I5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function L5(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Wk(e,t){return t===0?0:e+t}function Rie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Bie(e,t,n,o,s){const i=t==="tab"?s+Rie(e,n):e.lineEndFitAdvances[n];return Wk(o,i)}function HC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Wk(o,s)}function WC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Wk(o,i)}function Die(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Pie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Bp(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 Wie(e,t,n,o,s,i){return t+Hie(e,n,o,s,i)}function zie(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=jm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(E=g,F=b,S=d){u++,n?.(S,h,p,E,F),d=0,f=!1,y()}function A(E,F){f=!0,h=E,p=0,g=E+1,b=0,d=F}function $(E,F,S){f=!0,h=E,p=F,g=E,b=F+1,d=S}function N(E,F){if(!f){A(E,F);return}d+=F,g=E+1,b=0}function x(E,F){const S=i[E],L=r[E]??null;let R=L===null?-1:Bp(L,0,F+1),D=-1,z=0,H=F;for(;Hc){if(L!==null&&D>F){k(E,D,z),H=D,R=Bp(L,R,H+1),D=-1,z=0;continue}k(),$(E,H,U)}else d+=U,g=E,b=H+1;const Z=H+1;L!==null&&L[R]===Z&&(D=Z,z=d,R++),H++}f&&g===E&&b===S.length&&(g=E+1,b=0)}let I=0;for(;I=o.length));){const E=o[I],F=s[I],S=I5(F);if(!f){E>c&&i[I]!==null?x(I,0):A(I,E),S&&(v=I+1,m=d-E),I++;continue}if(d+E>c){if(S){N(I,E),k(I+1,0,d-E),I++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(E>c&&i[I]!==null){k(),x(I,0),I++;continue}k();continue}N(I,E),S&&(v=I+1,m=d-E),I++}return f&&k(),u}function Uie(e,t,n){if(e.simpleLineWalkFastPath)return zie(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=jm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function N(){y=-1,k=0,A=0,$=null}function x(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function I(z=v,H=m,U){f++,n!==void 0&&n(Wie(e,U??x(),g,b,z,H),g,b,z,H),h=0,p=!1,N()}function E(z,H){p=!0,g=z,b=0,v=z+1,m=0,h=H}function F(z,H,U){p=!0,g=z,b=H,v=z,m=H+1,h=U}function S(z,H){if(!p){E(z,H);return}h+=H,v=z+1,m=0}function L(z,H,U,Z,K,V){if(!H)return;const J=HC(e,z,U,K),fe=WC(e,z,U,K,Z);y=U+1,k=h-V+J,A=h-V+fe,$=z}function R(z,H){const U=i[z],Z=r[z]??null;let K=Z===null?-1:Bp(Z,0,H+1),V=-1,J=0,fe=H;for(;fed){if(Z!==null&&V>H){I(z,V,J),fe=V,K=Bp(Z,K,fe+1),V=-1,J=0;continue}I(),F(z,fe,oe)}else h=Se,v=z,m=fe+1}const ce=fe+1;Z!==null&&Z[K]===ce&&(V=ce,J=h,K++),fe++}p&&v===z&&m===U.length&&(v=z+1,m=0)}function D(z){f++,n?.(0,z.startSegmentIndex,0,z.consumedEndSegmentIndex,0),N()}for(let z=0;z=H.endSegmentIndex));){const Z=s[U],K=I5(Z),V=Oie(e,p,U),J=Z==="tab"?Fie(h+V,e.tabStopAdvance):o[U],fe=V+J,oe=Bie(e,Z,U,V,J);if(Z==="soft-hyphen"){p&&(v=U+1,m=0,y=U+1,k=h+l,A=h+l,$=Z),U++;continue}if(!p){oe>d&&i[U]!==null?R(U,0):E(U,J),L(Z,K,U,J,V,fe),U++;continue}if(h+oe>d){const ue=h+HC(e,Z,U,V),Se=h+WC(e,Z,U,V,J);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){I(y,0,A);continue}if(K&&ue<=d){S(U,fe),I(U+1,0,Se),U++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){I();continue}const Te=y;I(Te,0,A),U=Te;continue}if(oe>d&&i[U]!==null){I(),R(U,0),U++;continue}I();continue}S(U,fe),L(Z,K,U,J,V,fe),U++}if(p){const Z=y===H.consumedEndSegmentIndex?A:h;I(H.consumedEndSegmentIndex,0,Z)}}return f}let mg=null;function zk(){return mg===null&&(mg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),mg}function qie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function jie(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,h){o=[d],s=f,i=h,r=Vv(d),l=zm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Vv(d);d.length===1&&La.has(d)?r=r||h:r=h,l=!1}for(const d of zk().segment(e)){const f=d.segment,h=rr(f);if(o.length===0){c(f,d.index,h);continue}if(l||Bk.has(f)||La.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Vie(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&&!M5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||rr(c.text)}return l(t.length),o}function zC(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=zk();for(const s of o.segment(e))n++;return n}function Kie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Gie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of zk().segment(e))n++,Kie(o.segment)&&t.push(n);return t.length===0?null:t}function Yie(e,t,n){return t>1?e+(t-1)*n:e}function Zie(e,t,n,o,s){const i=jm(),{cache:r,emojiCorrection:l}=Lie(t,Mie(e.normalized)),a=ba("-",wl("-",r),l)+(s===0?0:s*2),u=ba(" ",wl(" ",r),l)*8,d=s!==0;if(e.len===0)return qie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function N(F,S,L,R,D,z,H,U,Z){D!=="text"&&D!=="space"&&D!=="zero-width-break"&&(b=!1),f.push(S),h.push(L),p.push(R),g.push(D),v?.push(z),m.push(H),y.push(U),d&&k.push(Z),A!==null&&A.push(F)}function x(F,S,L,R,D){const z=wl(F,r),H=d?zC(F,S):0,U=Yie(ba(F,z,l),H,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,K=Z===0?0:Z+(H>0?s:0),V=S==="space"||S==="zero-width-break"?0:U;if(D&&R&&F.length>1){let J="sum-graphemes";s!==0?J="segment-prefixes":Rp(F)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");const fe=Iie(F,z,r,l,J),oe=fe===null||o==="keep-all"?null:Gie(F);N(F,U,K,V,S,L,fe,oe,H);return}N(F,U,K,V,S,L,null,null,H)}for(let F=0;F{n>t&&(t=n)}),t}const tre={key:0,class:"slash-menu",role:"listbox"},nre=["aria-selected","onMouseenter","onMousedown"],ore={class:"slash-name"},sre={class:"slash-desc"},ire=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X([]);return Qe(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),T("div",tre,[(w(!0),T(Pe,null,ot(e.items,(a,c)=>(w(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:bt(u=>s("select",a),["prevent"])},[_("span",ore,O(a.name),1),_("span",sre,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,nre))),128))])):ae("",!0)}}),rre=ct(ire,[["__scopeId","data-v-f60b70d9"]]),lre={class:"mention-menu",role:"listbox"},are={key:0,class:"mention-state dim"},cre={key:1,class:"mention-state dim"},ure=["aria-selected","onMouseenter","onMousedown"],dre=["innerHTML"],fre={class:"mention-name"},hre={class:"mention-path"},pre=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=yc("folder","sm"),r=yc("code","sm"),l=yc("file-text","sm"),a=yc("image","sm"),c=yc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(w(),T("div",lre,[n.loading?(w(),T("div",are,O(C(s)("mention.searching")),1)):n.items.length===0?(w(),T("div",cre,O(C(s)("mention.noMatch")),1)):(w(!0),T(Pe,{key:2},ot(n.items,(b,v)=>(w(),T("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:bt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,dre),_("span",fre,O(b.name),1),_("span",hre,O(b.path),1)],42,ure))),128))]))}}),mre=ct(pre,[["__scopeId","data-v-f4d6b958"]]),$5=[{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:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{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 gre(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 Dp="skill:";function vre(e){return e.startsWith(Dp)?e.slice(Dp.length):e}function F5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Dp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...$5,...t]}function yre(e,t=$5){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).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Vm(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 O5(e){return e?.supportEfforts??[]}function kre(e){return e[Math.floor(e.length/2)]}function Pd(e){if(Vm(e)==="unsupported")return"off";const t=O5(e);return t.length>0?e?.defaultEffort??kre(t):"on"}function Km(e){const t=O5(e),n=Vm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Gv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function bre(e){return e!=="off"}function xre(e,t){return Km(e).includes(t)}function Uk(e,t){return t==="off"?"off":t==="on"?Pd(e):t}function Pp(e,t){return t??Pd(e)}function wre(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 _re(e,t,n){return!n||e===void 0?t:Pd(e)}const Hp=100;function Sre(e){const t=ym(Ft.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>Hp?n.slice(-Hp):n,s={[e]:o};return Gd(Ft.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Cre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=X(Sre(s())),r=B(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Hp?A.slice(-Hp):A;i.value={...i.value,[m]:$},Gd(Ft.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,mt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l0}return Qe(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function Are(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=X(!1),c=X([]),u=X(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=yre(h,F5(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,mt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function Mre(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=X(!1),r=X([]),l=X(0),a=X(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,mt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Ere(e){const{sessionId:t}=e;function n(c){return mo(Jx(c))??""}function o(c,u){const d=Jx(c);u?So(d,u):Na(d)}const s=X(n(t())),i=X(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(s,c=>{mt(r),o(t(),c)}),Qe(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),mt(r))});function l(c){s.value=c,mt(()=>{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 Tre(e){const{uploadImage:t,sessionId:n}=e,o=X({}),s=B(()=>o.value[n()??""]??[]),i=X(null),r=X(null),l=X(!1);let a=0;function c(){return`att_${++a}`}function u(H,U){o.value={...o.value,[H]:U}}function d(H){if(H.previewUrl!==void 0)try{URL.revokeObjectURL(H.previewUrl)}catch{}}function f(H){return H.startsWith("image/")?"image":H.startsWith("video/")?"video":"file"}async function h(H){const U=t();if(!U)return;const Z=n()??"";if(H.length!==0)for(const K of H){const V=f(K.type),J=c(),fe=V==="file"?void 0:URL.createObjectURL(K),oe={localId:J,name:K.name,kind:V,previewUrl:fe,mediaType:K.type||"application/octet-stream",size:K.size,uploading:!0};u(Z,[...o.value[Z]??[],oe]),U(K,K.name).then(ce=>{const ue=o.value[Z]??[];u(Z,ue.map(Se=>Se.localId===J?{...Se,uploading:!1,fileId:ce?.fileId,mediaType:ce?.mediaType??Se.mediaType,error:ce===null}:Se))}).catch(()=>{const ce=o.value[Z]??[];u(Z,ce.map(ue=>ue.localId===J?{...ue,uploading:!1,error:!0}:ue))})}}function p(H){const U=n()??"",Z=o.value[U]??[],K=Z.find(V=>V.localId===H);i.value?.localId===H&&(i.value=null),K&&d(K),u(U,Z.filter(V=>V.localId!==H))}function g(H){i.value=H}function b(){i.value=null}function v(){r.value?.click()}function m(H){const U=H.target,Z=Array.from(U.files??[]);h(Z),U.value=""}function y(H){if(!t())return;const U=H.clipboardData;if(!U)return;const Z=[],K=new Set,V=(J,fe)=>{const oe=`${J.size}:${J.type}:${fe}`;if(K.has(oe))return;K.add(oe);const ce=J.type.split("/")[1]??"png",ue=fe.includes(".")?fe:`paste-${Date.now()}.${ce}`;Z.push(J instanceof File?J:new File([J],ue,{type:J.type}))};for(const J of Array.from(U.items))if(J.kind==="file"){const fe=J.getAsFile();fe&&V(fe,fe.name||`paste-${Date.now()}.${J.type.split("/")[1]??"png"}`)}for(const J of Array.from(U.files))V(J,J.name);Z.length!==0&&(H.preventDefault(),h(Z))}let k=0;function A(H){!t()||!Array.from(H.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(H.preventDefault(),H.stopPropagation(),l.value=!0)}function $(){l.value=!1}function N(H){if(k=0,l.value=!1,!t())return;H.preventDefault(),H.stopPropagation();const U=Array.from(H.dataTransfer?.files??[]);h(U)}function x(H){return Array.from(H.dataTransfer?.items??[]).some(U=>U.kind==="file")}function I(H){!t()||!x(H)||(H.preventDefault(),k+=1,l.value=!0)}function E(H){!t()||!x(H)||H.preventDefault()}function F(H){!t()||!x(H)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(H){if(k=0,l.value=!1,!t())return;H.preventDefault();const U=Array.from(H.dataTransfer?.files??[]);h(U)}function L(){const H=n()??"";for(const U of o.value[H]??[])d(U);u(H,[])}function R(H,U,Z){const K=o.value[H]??[];K.some(V=>V.localId===U)&&u(H,K.map(V=>V.localId===U?{...V,...Z}:V))}function D(H){return fetch(H).then(U=>{if(!U.ok)throw new Error(`fetch failed: ${U.status}`);return U.blob()})}function z(H){const U=n()??"";for(const Z of o.value[U]??[])d(Z);u(U,[]);for(const Z of H){const K=c(),V=/^data:/i.test(Z.url),J=/^blob:/i.test(Z.url),fe=Z.name??Z.kind;if(Z.fileId){const oe={localId:K,name:fe,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(U,[...o.value[U]??[],oe]),Z.kind!=="file"&&!V&&!J&&dt().getFileBlob(Z.fileId).then(ce=>{const ue=URL.createObjectURL(ce);if(!(o.value[U]??[]).some(Te=>Te.localId===K)){URL.revokeObjectURL(ue);return}R(U,K,{previewUrl:ue})}).catch(()=>{})}else{if(!Z.url)continue;const oe=t();if(!oe)continue;const ce={localId:K,name:fe,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(U,[...o.value[U]??[],ce]),D(Z.url).then(ue=>{const Se=fe.includes(".")?fe:`${fe}.${ue.type.split("/")[1]??"bin"}`;return oe(ue,Se)}).then(ue=>{if(ue===null){const Se=o.value[U]??[];u(U,Se.filter(Te=>Te.localId!==K));return}R(U,K,{uploading:!1,fileId:ue.fileId})}).catch(()=>{const ue=o.value[U]??[];u(U,ue.filter(Se=>Se.localId!==K))})}}}return Qe(n,()=>{i.value=null}),cn(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",I),document.addEventListener("dragover",E),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),bn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",I),document.removeEventListener("dragover",E),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const H of Object.values(o.value))for(const U of H)d(U);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:N,clearAfterSubmit:L,loadAttachments:z}}const Nre=["type","disabled"],Ire={class:"ui-button__content"},Lre=Ze({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),T("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),xe(Ds,{key:0,size:"sm",class:"ui-button__spinner"})):ae("",!0),_("span",Ire,[On(t.$slots,"default",{},void 0,!0)])],10,Nre))}}),Bt=ct(Lre,[["__scopeId","data-v-e58393a8"]]),$re={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Fre=["stroke-dasharray","stroke-dashoffset"],gg=7,Ore=Ze({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*gg;return(o,s)=>(w(),T("svg",$re,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Fre)]))}}),Rre=ct(Ore,[["__scopeId","data-v-a364f1f1"]]),Bre={key:0,class:"att-strip"},Dre={class:"att-lightbox-card"},Pre=["src"],Hre=["src","alt"],Wre={class:"att-lightbox-name"},zre={class:"composer-card"},Ure={class:"cin-wrap"},qre={class:"input-row"},jre=["placeholder","disabled"],Vre=["aria-label"],Kre={class:"toolbar-left"},Gre=["onKeydown"],Yre=["onClick"],Zre={class:"pd-check"},Qre={class:"pd-info"},Xre={class:"pd-desc"},Jre={class:"mode-label"},ele={key:0,class:"mode-tag"},tle={key:1,class:"mode-tag"},nle={key:2,class:"mode-tag"},ole={class:"mode-row-icon"},sle={class:"mode-row-info"},ile={class:"mode-row-name"},rle={class:"mode-row-desc"},lle={class:"mode-row-icon"},ale={class:"mode-row-info"},cle={class:"mode-row-name"},ule={class:"mode-row-desc"},dle={class:"mode-row-icon"},fle={class:"mode-row-info"},hle={class:"mode-row-name"},ple={class:"mode-row-desc"},mle={key:0,class:"mode-row-actions"},gle={class:"toolbar-right"},vle=["aria-label"],yle=["onKeydown"],kle={key:0,class:"think-suffix"},ble=["aria-label"],xle=["aria-label","disabled"],wle={key:0,class:"md-section"},_le=["onClick"],Sle={class:"md-check"},Cle={class:"md-name"},Ale={class:"md-provider"},Mle={key:1,class:"md-divider"},Ele={key:2,class:"md-section"},Tle=["onClick"],Nle={class:"md-check"},Ile={class:"md-name"},Lle={key:3,class:"md-divider"},$le={class:"md-name"},Fle={key:0,class:"md-note"},Ole=["aria-label"],Rle=["disabled","onClick"],Ble={class:"md-cache-note"},Dle={class:"md-name"},Ple={class:"drop-card"},UC=36,Hle=Ze({__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},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","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"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Ere({sessionId:()=>o.sessionId}),h=X(!1);function p(){h.value=!h.value,mt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,mt(u))}function b(Ue){if(typeof getComputedStyle>"u")return UC;const Fe=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Fe)&&Fe>0?Fe:UC}const v=X(!1);function m(){const Ue=c.value;v.value=!!Ue&&Ue.scrollHeight>b(Ue)}Qe(a,()=>{mt(m)}),Qe(()=>o.sessionId,()=>{h.value=!1});const y=Cre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:N,select:x}=Are({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>y.push(Ue),clearDraft:f}),{open:I,items:E,active:F,loading:S,update:L,select:R}=Mre({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function D(){y.resetBrowsing(),N(),L()}const{attachments:z,previewAttachment:H,fileInputRef:U,isDragOver:Z,removeAttachment:K,openAttachmentPreview:V,closeAttachmentPreview:J,openFilePicker:fe,handleFileInputChange:oe,handleDragOver:ce,handleDragLeave:ue,handleDrop:Se,clearAfterSubmit:Te,loadAttachments:Ae}=Tre({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});cn(()=>{a.value&&mt(()=>{u(),m()})}),bn(()=>{document.removeEventListener("mousedown",Gt),j()});function P(){c.value?.focus({preventScroll:!0})}function le(Ue){Ae(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:le,focus:P});function ne(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function q(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&C5(Ue.fileId,Ue.name,Ue.mediaType);return}V(Ue)}function ee(){const Ue=a.value.trim();if(z.value.some(Ne=>Ne.uploading))return;const Fe=z.value.filter(Ne=>!Ne.uploading&&!Ne.error&&Ne.fileId);if(!Ue&&Fe.length===0)return;if(y.push(Ue),Ue){const Ne=gre(Ue),he=Ne?F5(o.skills).some(we=>we.name===Ne.cmd||we.name===`/${Dp}${Ne.cmd.slice(1)}`):!1;if(Ne&&he){a.value="",f(),k.value=!1,g(),i("command",Ne.arg?`${Ne.cmd} ${Ne.arg}`:Ne.cmd);return}}const se={text:Ue,attachments:Fe.map(Ne=>ne(Ne))};H.value=null,Te(),a.value="",f(),k.value=!1,I.value=!1,g(),i("submit",se)}function ge(){if(!o.running||z.value.some(Ne=>Ne.uploading))return;const Ue=a.value.trim(),Fe=z.value.filter(Ne=>!Ne.uploading&&!Ne.error&&Ne.fileId);if(!Ue&&Fe.length===0&&o.queued.length===0)return;const se={text:Ue,attachments:Fe.map(Ne=>ne(Ne))};Te(),y.push(Ue),a.value="",f(),k.value=!1,I.value=!1,g(),i("steer",se)}let de=!1,ve=null;function j(){ve!==null&&(clearTimeout(ve),ve=null)}function te(){j(),de=!0}function pe(){j(),ve=setTimeout(()=>{ve=null,de=!1},0)}function Ce(Ue){return de||Ue.isComposing||Ue.keyCode===229}function $e(Ue){if(!Ce(Ue)){if(Ue.key==="Escape"){if(Ie.value){Ue.preventDefault(),gt();return}if(et.value){Ue.preventDefault(),Ut();return}}if(k.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=A.value[$.value];Fe&&x(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),k.value=!1;return}}if(I.value&&!S.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,E.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,E.value.length))%Math.max(1,E.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=E.value[F.value];Fe&&R(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),I.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){o.running&&(Ue.preventDefault(),ge());return}if(!h.value&&!k.value&&!I.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Fe=y.isBrowsing();if(Ue.key==="ArrowUp"&&y.hasHistory()&&(Fe||y.caretAtTextStart())){Ue.preventDefault(),y.recallOlder();return}if(Ue.key==="ArrowDown"&&Fe){Ue.preventDefault(),y.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),ee()}}}const De=B(()=>r("composer.send")),me=B(()=>!!o.uploadImage),Ie=X(!1),et=X(!1),rt=X(null);function _t(){Ie.value=!Ie.value,Ie.value?(et.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function gt(){Ie.value=!1,et.value||document.removeEventListener("click",ht,!0)}function It(){et.value=!et.value,et.value?(Ie.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function Ut(){et.value=!1,Ie.value||document.removeEventListener("click",ht,!0)}function ht(Ue){rt.value&&!rt.value.contains(Ue.target)&&(gt(),Ut())}bn(()=>{document.removeEventListener("click",ht,!0)});const un=B(()=>{const Ue=o.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ue*100)))}),dn=B(()=>{const Ue=ir(o.status?.ctxUsed??0),Fe=ir(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Fe,pct:un.value})}),ns=B(()=>un.value>=80),Wt=B(()=>o.models?.find(Ue=>Ue.id===o.status?.modelId)),Hn=B(()=>Vm(Wt.value)),lo=B(()=>Km(Wt.value)),it=B(()=>Pp(Wt.value,o.thinking)),Gn=B(()=>lo.value.includes(it.value)?it.value:""),ao=B(()=>bre(it.value)),Yn=B(()=>Hn.value==="unsupported"||lo.value.length<=1),go=B(()=>{if(!ao.value)return"";const Ue=(Wt.value?.supportEfforts?.length??0)>0,Fe=it.value;return Ue&&Fe!=="on"?r("composer.thinkingSuffixEffort",{level:Fe}):r("composer.thinkingSuffix")});function os(Ue){Yn.value||i("setThinking",Uk(Wt.value,Ue))}function qn(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):Gv(Ue)}const to=B(()=>o.planMode===!0),vn=B(()=>o.swarmMode===!0),Zn=B(()=>o.goal?.status??o.activationBadges?.goal?.status??null),xn=B(()=>Zn.value!==null&&Zn.value!=="complete"),An=B(()=>xn.value||o.goalMode===!0),Mn=B(()=>Zn.value==="active"),Do=B(()=>Zn.value==="paused"||Zn.value==="blocked"),ze=X(!1),Xe=X(null),kt=X(null),Ht=X({}),Rn=B(()=>to.value||vn.value||An.value);function sn(){ze.value=!1,document.removeEventListener("mousedown",Gt)}function Gt(Ue){const Fe=Ue.target;Xe.value?.contains(Fe)||kt.value?.contains(Fe)||sn()}function Wn(){if(ze.value){sn();return}gt(),Ut();const Ue=Xe.value?.getBoundingClientRect();Ue&&(Ht.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Gt),0)}const En=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],St=["status.planDesc","status.swarmDesc","status.goalDesc"],Po=X(null),Ao=X(""),ss=X("");function Tn(Ue){const Fe={};return Ue&&(Fe["--composer-menu-desc-width"]=Ue),Fe}const jn=B(()=>Tn(Ao.value)),Ps=B(()=>Tn(ss.value)),ti=B(()=>({...Ht.value,...Ps.value}));let Io=null;function Ss(Ue){const Fe=Number.parseFloat(Ue);return Number.isFinite(Fe)?Fe:0}function Wi(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function Si(Ue){return Ue.letterSpacing==="normal"?0:Ss(Ue.letterSpacing)}function co(Ue,Fe){if(!Ue)return 0;const se=Jie(Ue,Wi(Fe),{letterSpacing:Si(Fe)});return ere(se)}function ni(){const Ue=Po.value?.querySelector(".pd-desc");if(!Ue)return;const Fe=getComputedStyle(Ue),se=Math.max(0,...En.map(he=>co(r(he.descKey),Fe))),Ne=Math.max(0,...St.map(he=>co(r(he),Fe)));Ao.value=se>0?`${Math.ceil(se)}px`:"",ss.value=Ne>0?`${Math.ceil(Ne)}px`:""}function Ci(){typeof window>"u"||(Io!==null&&window.cancelAnimationFrame(Io),mt(()=>{Io=window.requestAnimationFrame(()=>{Io=null,ni()})}))}Qe(l,Ci,{immediate:!0}),cn(()=>{Ci(),document.fonts?.ready.then(Ci)}),bn(()=>{Io!==null&&(window.cancelAnimationFrame(Io),Io=null)});function ar(Ue){i("setPermission",Ue),Ut()}const no=B(()=>En.find(Ue=>Ue.mode===o.status?.permission)),is=B(()=>no.value?r(no.value.labelKey):""),rs=B(()=>Wt.value?.provider??""),Lo=B(()=>!rs.value||!o.models?.length?[]:o.models.filter(Ue=>Ue.provider===rs.value)),Ai=B(()=>new Set(o.starredIds??[]));function zn(Ue){return Ai.value.has(Ue)}const $o=B(()=>o.models?.length?o.models.filter(Ue=>zn(Ue.id)&&Ue.provider!==rs.value):[]);function oi(Ue){i("selectModel",Ue),gt()}return(Ue,Fe)=>(w(),T("div",{class:We(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Fe[18]||(Fe[18]=(...se)=>C(ce)&&C(ce)(...se)),onDragleave:Fe[19]||(Fe[19]=(...se)=>C(ue)&&C(ue)(...se)),onDrop:Fe[20]||(Fe[20]=(...se)=>C(Se)&&C(Se)(...se))},[C(z).length>0?(w(),T("div",Bre,[(w(!0),T(Pe,null,ot(C(z),se=>(w(),xe(_5,{key:se.localId,kind:se.kind,name:se.name,url:se.previewUrl,"file-id":se.fileId,"media-type":se.mediaType,size:se.size,uploading:se.uploading,error:se.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:se.name}),onActivate:Ne=>q(se),onRemove:Ne=>C(K)(se.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ae("",!0),C(H)?(w(),T("div",{key:1,class:"att-lightbox",onClick:Fe[1]||(Fe[1]=bt((...se)=>C(J)&&C(J)(...se),["self"]))},[_("div",Dre,[re(Xt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:Fe[0]||(Fe[0]=(...se)=>C(J)&&C(J)(...se))},"✕")]),_:1},8,["text"]),C(H).kind==="video"?(w(),T("video",{key:0,class:"att-lightbox-media",src:C(H).previewUrl,controls:"",playsinline:""},null,8,Pre)):(w(),T("img",{key:1,class:"att-lightbox-media",src:C(H).previewUrl,alt:C(H).name},null,8,Hre)),_("div",Wre,O(C(H).name),1)])])):ae("",!0),_("div",zre,[_("div",Ure,[C(k)?(w(),xe(rre,{key:0,items:C(A),"active-index":C($),onSelect:C(x),onHover:Fe[2]||(Fe[2]=se=>$.value=se)},null,8,["items","active-index","onSelect"])):ae("",!0),C(I)?(w(),xe(mre,{key:1,items:C(E),"active-index":C(F),loading:C(S),onSelect:C(R),onHover:Fe[3]||(Fe[3]=se=>F.value=se)},null,8,["items","active-index","loading","onSelect"])):ae("",!0),_("div",qre,[Fn(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Fe[4]||(Fe[4]=se=>ho(a)?a.value=se:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:$e,onCompositionstart:te,onCompositionend:pe,onInput:D},null,40,jre),[[_s,C(a)]]),h.value||v.value?(w(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(w(),xe(Ve,{key:0,name:"collapse",size:"sm"})):(w(),xe(Ve,{key:1,name:"expand",size:"sm"}))],8,Vre)):ae("",!0)])]),me.value?(w(),T("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",multiple:"",class:"file-input-hidden",onChange:Fe[5]||(Fe[5]=(...se)=>C(oe)&&C(oe)(...se))},null,544)):ae("",!0),_("div",{ref_key:"toolbarRef",ref:rt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Po,class:"menu-measure","aria-hidden":"true"},[...Fe[21]||(Fe[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Kre,[me.value?(w(),xe(Pn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(fe)},{default:Ee(()=>[re(Ve,{name:"attachment"})]),_:1},8,["label","onClick"])):ae("",!0),e.status?(w(),T("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:et.value}]]),role:"button",tabindex:"0",onClick:bt(It,["stop"]),onKeydown:[nr(It,["enter"]),nr(bt(It,["prevent"]),["space"])]},O(is.value),43,Gre)):ae("",!0),et.value&&e.status?(w(),T("div",{key:2,class:"perm-dropdown",style:Yt(jn.value),role:"menu",onClick:Fe[6]||(Fe[6]=bt(()=>{},["stop"]))},[(w(),T(Pe,null,ot(En,se=>_("button",{key:se.mode,class:We(["pd-row",{"is-current":se.mode===e.status.permission}]),role:"menuitem",onClick:Ne=>ar(se.mode)},[_("span",Zre,[se.mode===e.status.permission?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Qre,[_("span",{class:"pd-name",style:Yt({color:se.color})},O(C(r)(se.labelKey)),5),_("span",Xre,O(C(r)(se.descKey)),1)])],10,Yre)),64))],4)):ae("",!0),e.status?(w(),T("div",{key:3,ref_key:"modesRef",ref:Xe,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Rn.value,open:ze.value}]),onClick:bt(Wn,["stop"])},[_("span",Jre,O(C(r)("status.modesLabel")),1),to.value?(w(),T("span",ele,O(C(r)("status.planLabel")),1)):ae("",!0),vn.value?(w(),T("span",tle,O(C(r)("status.swarmLabel")),1)):ae("",!0),An.value?(w(),T("span",nle,O(C(r)("status.goalLabel")),1)):ae("",!0)],2),ze.value?(w(),T("div",{key:0,ref_key:"modesMenuRef",ref:kt,class:"modes-menu",style:Yt(ti.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:to.value}]),role:"menuitem",onClick:Fe[7]||(Fe[7]=se=>i("togglePlan"))},[_("span",ole,[re(Ve,{name:"file-edit",size:"sm"})]),_("span",sle,[_("span",ile,O(C(r)("status.planLabel")),1),_("span",rle,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:to.value}])},[...Fe[22]||(Fe[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:vn.value}]),role:"menuitem",onClick:Fe[8]||(Fe[8]=se=>i("toggleSwarm"))},[_("span",lle,[re(Ve,{name:"sparkles",size:"sm"})]),_("span",ale,[_("span",cle,O(C(r)("status.swarmLabel")),1),_("span",ule,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:vn.value}])},[...Fe[23]||(Fe[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:xn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Fe[9]||(Fe[9]=se=>xn.value?i("focusGoal"):i("toggleGoal"))},[_("span",dle,[re(Ve,{name:"target",size:"sm"})]),_("span",fle,[_("span",hle,O(C(r)("status.goalLabel")),1),_("span",ple,O(C(r)("status.goalDesc")),1)]),xn.value?ae("",!0):(w(),T("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...Fe[24]||(Fe[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),xn.value?(w(),T("div",mle,[Mn.value?(w(),xe(Bt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Fe[10]||(Fe[10]=se=>i("controlGoal","pause"))},{default:Ee(()=>[re(Ve,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):ae("",!0),Do.value?(w(),xe(Bt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Fe[11]||(Fe[11]=se=>i("controlGoal","resume"))},{default:Ee(()=>[re(Ve,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):ae("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Fe[12]||(Fe[12]=se=>i("controlGoal","cancel"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):ae("",!0)],2)],4)):ae("",!0)],512)):ae("",!0)]),_("div",gle,[ns.value?(w(),T("button",{key:0,class:"compact-chip",onClick:Fe[13]||(Fe[13]=bt(se=>i("compact"),["stop"]))},"/compact")):ae("",!0),re(Xt,{text:dn.value},{default:Ee(()=>[e.status&&!e.hideContext?(w(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":dn.value},[re(Rre,{pct:un.value},null,8,["pct"])],8,vle)):ae("",!0)]),_:1},8,["text"]),e.status?(w(),T("span",{key:1,class:We(["model-pill",{open:Ie.value}]),role:"button",tabindex:"0",onClick:bt(_t,["stop"]),onKeydown:[nr(_t,["enter"]),nr(bt(_t,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),go.value?(w(),T("span",kle,O(go.value),1)):ae("",!0),re(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,yle)):ae("",!0),e.running?(w(),xe(Xt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Fe[14]||(Fe[14]=se=>i("interrupt"))},[re(Ve,{name:"stop",size:"sm"})],8,ble)]),_:1},8,["text"])):ae("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:Fe[15]||(Fe[15]=se=>ee())},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):(w(),xe(Ve,{key:1,name:"send",size:"sm"}))],10,xle)]),Ie.value&&e.status?(w(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:Fe[17]||(Fe[17]=bt(()=>{},["stop"]))},[$o.value.length>0?(w(),T("div",wle,O(C(r)("status.starredModels")),1)):ae("",!0),(w(!0),T(Pe,null,ot($o.value,se=>(w(),T("button",{key:se.id,class:We(["md-row",{"is-current":se.id===e.status.modelId}]),role:"menuitem",onClick:Ne=>oi(se.id)},[_("span",Sle,[se.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Cle,O(se.displayName??se.model),1),_("span",Ale,O(se.provider),1),re(Ve,{class:"md-star",name:"star",size:"sm"})],10,_le))),128)),$o.value.length>0?(w(),T("div",Mle)):ae("",!0),Lo.value.length>0?(w(),T("div",Ele,O(rs.value),1)):ae("",!0),(w(!0),T(Pe,null,ot(Lo.value,se=>(w(),T("button",{key:se.id,class:We(["md-row",{"is-current":se.id===e.status.modelId}]),role:"menuitem",onClick:Ne=>oi(se.id)},[_("span",Nle,[se.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Ile,O(se.displayName??se.model),1),zn(se.id)?(w(),xe(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):ae("",!0)],10,Tle))),128)),Lo.value.length>0?(w(),T("div",Lle)):ae("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Yn.value}])},[_("span",$le,O(C(r)("status.thinkingLabel")),1),Hn.value==="unsupported"?(w(),T("span",Fle,O(C(r)("status.modeNotSupported")),1)):(w(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),T(Pe,null,ot(lo.value,se=>(w(),T("button",{key:se,type:"button",class:We(["effort-seg",{"is-active":se===Gn.value}]),disabled:Yn.value,onClick:Ne=>os(se)},O(qn(se)),11,Rle))),128))],8,Ole))],2),Fe[25]||(Fe[25]=_("div",{class:"md-divider"},null,-1)),_("div",Ble,O(C(r)("status.cacheNote")),1),Fe[26]||(Fe[26]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:Fe[16]||(Fe[16]=se=>{gt(),i("pickModel")})},[_("span",Dle,O(C(r)("status.moreModels")),1)])])):ae("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[_("div",Ple,[re(Ve,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),R5=ct(Hle,[["__scopeId","data-v-a89f6a49"]]),Wle={key:0,class:"ui-card__head"},zle={class:"ui-card__body"},Ule={key:1,class:"ui-card__foot"},qle=Ze({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),T("div",Wle,[On(t.$slots,"head",{},void 0,!0)])):ae("",!0),_("div",zle,[On(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),T("div",Ule,[On(t.$slots,"foot",{},void 0,!0)])):ae("",!0)],2))}}),qk=ct(qle,[["__scopeId","data-v-9c9f9a9a"]]),jle={class:"goal-kicker"},Vle={key:0,class:"goal-progress","aria-hidden":"true"},Kle={class:"goal-full"},Gle={key:0,class:"goal-criterion"},Yle=["inert","aria-hidden"],Zle={class:"goal-meta"},Qle={key:0},Xle={class:"goal-actions"},Jle=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{confirm:i}=tf(),r=X(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=B(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(w(),xe(qk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(Ve,{class:"goal-icon",name:"target",size:"md"}),_("span",jle,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ri,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Je(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(w(),T("span",Vle,[_("span",{class:"goal-progress-fill",style:Yt({width:`${l.value}%`})},null,4)])):ae("",!0),re(Ve,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Kle,O(e.goal.objective),1),e.goal.completionCriterion?(w(),T("div",Gle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):ae("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Zle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(C(ir)(e.goal.tokensUsed))+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(w(),T("span",Qle,O(l.value)+"% token budget",1)):ae("",!0)]),_("div",Xle,[e.goal.status==="active"?(w(),xe(Bt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>o("controlGoal","pause"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):ae("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(w(),xe(Bt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>o("controlGoal","resume"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):ae("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Ee(()=>[re(Ve,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Yle)]),_:1},8,["class"]))}}),eae=ct(Jle,[["__scopeId","data-v-44bef30f"]]),tae={class:"qh"},nae={class:"qtitle"},oae={key:0,class:"qstep"},sae={key:1,class:"qmin-peek"},iae={class:"qbody"},rae=["aria-label"],lae=["aria-selected","aria-label","onClick"],aae={class:"qstep-num"},cae={key:1,class:"qheader-chip"},uae={class:"qtext"},dae={class:"qopts"},fae=["onClick"],hae={class:"qopt-key"},pae={class:"qopt-glyph"},mae={key:0,class:"chk"},gae={key:1,class:"rad"},vae={class:"qopt-text"},yae={class:"qopt-label"},kae={key:0,class:"qopt-desc"},bae={class:"qopt-glyph"},xae={key:0,class:"chk"},wae={key:1,class:"rad"},_ae={class:"qopt-label"},Sae=["placeholder"],Cae={class:"qfoot"},Aae=Ze({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Tt(),s=t,i=X(0),r=X(!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&&z0:H.kind==="multiWithOther"?H.optionIds.length>0||H.otherText.trim().length>0:H.kind==="other"?H.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=X({});function g(z){return z.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${z.label} ${z.description??""}`.toLowerCase())}function b(){const z={...p.value};let H=!1;for(const U of n.question.questions){if(z[U.id])continue;const Z=U.options.filter(g);Z.length!==0&&(z[U.id]=U.multiSelect?{kind:"multi",optionIds:Z.map(K=>K.id)}:{kind:"single",optionId:Z[0].id},H=!0)}H&&(p.value=z)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(z,H){const U=p.value[z];if(U&&U.kind==="single"&&U.optionId===H){const Z={...p.value};delete Z[z],p.value=Z}else p.value={...p.value,[z]:{kind:"single",optionId:H}}}function m(z,H){const U=p.value[z],Z=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],K=Z.indexOf(H);K>=0?Z.splice(K,1):Z.push(H);const V=p.value[z],J=V&&V.kind==="multiWithOther"?V.otherText:"";J?p.value={...p.value,[z]:{kind:"multiWithOther",optionIds:Z,otherText:J}}:p.value={...p.value,[z]:{kind:"multi",optionIds:Z}}}const y=X({}),k=X(null);function A(z){const H=n.question.questions.find(Z=>Z.id===z),U=y.value[z]??"";if(H.multiSelect){const Z=p.value[z],K=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[z]:{kind:"multiWithOther",optionIds:K,otherText:U}}}else p.value={...p.value,[z]:{kind:"other",text:U}}}function $(z){A(z),mt(()=>k.value?.focus())}function N(z,H){const U=p.value[z];return U?U.kind==="single"?U.optionId===H:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(H):!1:!1}function x(z){const H=p.value[z];return!!(H&&(H.kind==="other"||H.kind==="multiWithOther"))}function I(){return n.question.questions.every(z=>f(z.id))}const E=B(()=>n.busyKind==="answer"),F=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function L(){if(S.value||!I())return;const z={answers:p.value,method:"click"};s("answer",n.question.questionId,z)}function R(){S.value||s("dismiss",n.question.questionId)}function D(z){const H=(document.activeElement?.tagName??"").toLowerCase(),U=H==="input"||H==="textarea";if(S.value)return;if(z.key==="Enter"){if(z.preventDefault(),r.value)return;i.value=1&&Z<=9){z.preventDefault();const K=l.value,V=Z-1,J=K.options[V];J&&(K.multiSelect?m(K.id,J.id):v(K.id,J.id))}}return cn(()=>document.addEventListener("keydown",D)),bn(()=>document.removeEventListener("keydown",D)),(z,H)=>(w(),xe(qk,{class:We(["qcard",{minimized:r.value}])},e3({head:Ee(()=>[_("div",tae,[H[5]||(H[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",nae,O(C(o)("question.title")),1),a.value>1&&!r.value?(w(),T("span",oae,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ae("",!0),r.value?(w(),T("span",sae,O(l.value.question),1)):ae("",!0),re(Pn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:H[0]||(H[0]=U=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",iae,[a.value>1?(w(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),T(Pe,null,ot(n.question.questions,(U,Z)=>(w(),T("button",{key:U.id,type:"button",class:We(["qstep-dot",{active:Z===i.value,answered:f(U.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:K=>d(Z)},[_("span",aae,O(Z+1),1)],10,lae))),128))],8,rae)):ae("",!0),l.value.header?(w(),T("div",cae,[re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(l.value.header),1)]),_:1})])):ae("",!0),_("div",uae,O(l.value.question),1),l.value.body?(w(),xe(Wm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ae("",!0),_("div",dae,[(w(!0),T(Pe,null,ot(l.value.options,(U,Z)=>(w(),T("label",{key:U.id,class:We(["qopt",{selected:N(l.value.id,U.id)}]),onClick:bt(K=>l.value.multiSelect?m(l.value.id,U.id):v(l.value.id,U.id),["prevent"])},[_("span",hae,O(Z+1),1),_("span",pae,[l.value.multiSelect?(w(),T("span",mae,O(N(l.value.id,U.id)?"■":"□"),1)):(w(),T("span",gae,O(N(l.value.id,U.id)?"●":"○"),1))]),_("span",vae,[_("span",yae,O(U.label),1),U.description?(w(),T("span",kae,O(U.description),1)):ae("",!0)])],10,fae))),128)),l.value.allowOther?(w(),T("label",{key:0,class:We(["qopt",{selected:x(l.value.id)}]),onClick:H[4]||(H[4]=bt(U=>$(l.value.id),["prevent"]))},[H[6]||(H[6]=_("span",{class:"qopt-key"},null,-1)),_("span",bae,[l.value.multiSelect?(w(),T("span",xae,O(x(l.value.id)?"■":"□"),1)):(w(),T("span",wae,O(x(l.value.id)?"●":"○"),1))]),_("span",_ae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),Fn(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":H[1]||(H[1]=U=>y.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:H[2]||(H[2]=U=>A(l.value.id)),onFocus:H[3]||(H[3]=U=>A(l.value.id))},null,40,Sae),[[_s,y.value[l.value.id]]])],2)):ae("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",Cae,[i.value[Je(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),xe(Bt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!I(),loading:E.value,onClick:L},{default:Ee(()=>[Je(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),xe(Bt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Je(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):ae("",!0),re(Bt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:R},{default:Ee(()=>[Je(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Mae=ct(Aae,[["__scopeId","data-v-14c58ac1"]]),Eae={class:"ah"},Tae={class:"akind"},Nae={class:"apath"},Iae={class:"ah-path"},Lae={key:1,class:"diff"},$ae={class:"dg"},Fae={class:"dc"},Oae={key:2,class:"body-shell"},Rae={class:"shell-cmd"},Bae={key:0,class:"shell-cwd"},Dae={key:1,class:"shell-danger"},Pae={key:3,class:"body-file"},Hae={class:"file-bar"},Wae={class:"file-lang"},zae={class:"file-content"},Uae={class:"file-ln"},qae={class:"file-text"},jae={key:4,class:"body-chip"},Vae={class:"chip-label"},Kae={class:"chip-value"},Gae={key:0,class:"chip-detail"},Yae={key:5,class:"body-chip"},Zae={key:0,class:"chip-label"},Qae={class:"chip-value"},Xae={key:6,class:"body-chip"},Jae={class:"chip-label"},ece={class:"chip-value"},tce={key:0,class:"chip-detail"},nce={key:7,class:"body-chip"},oce={class:"chip-label"},sce={class:"chip-value"},ice={key:0,class:"chip-detail"},rce={key:8,class:"body-todo"},lce={class:"todo-glyph"},ace={key:9,class:"body-plan"},cce={key:10,class:"body-generic"},uce={class:"gen-text"},dce={key:11,class:"feedback-wrap"},fce=["placeholder"],hce={class:"feedback-hint"},pce={key:0,class:"plan-actions"},mce={key:1,class:"abtn"},gce=Ze({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=X(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${E}`)}const c=X(!1),u=X(""),d=X(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):v("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=X(null);Qe(()=>n.busy,E=>{E||(b.value=null)});function v(E,F){n.busy||(b.value=E,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(E){v(`option:${E}`,{decision:"approved",selectedLabel:E})}function N(){n.busy||f()}function x(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function I(E){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){E.key==="1"?(E.preventDefault(),A()):E.key==="2"?(E.preventDefault(),N()):E.key==="3"&&(E.preventDefault(),x());return}E.key==="1"&&S.options[0]?(E.preventDefault(),$(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),$(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),$(S.options[2].label));return}E.key==="1"?(E.preventDefault(),m()):E.key==="2"?(E.preventDefault(),y()):E.key==="3"?(E.preventDefault(),k()):E.key==="4"&&(E.preventDefault(),f())}return cn(()=>document.addEventListener("keydown",I)),bn(()=>document.removeEventListener("keydown",I)),(E,F)=>(w(),xe(qk,{class:We(["appr",{minimized:r.value}])},e3({head:Ee(()=>[_("div",Eae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",Tae,O(a()),1),_("span",Nae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),T(Pe,{key:0},[Je(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),T(Pe,{key:1},[Je(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),T(Pe,{key:2},[Je(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),T(Pe,{key:3},[Je(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),T(Pe,{key:4},[Je(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),T(Pe,{key:5},[Je(O(e.block.summary),1)],64)):ae("",!0)]),e.agentName&&!r.value?(w(),xe(Ri,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ae("",!0),r.value?ae("",!0):(w(),xe(Ri,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Je(O(C(s)("approval.required")),1)]),_:1})),re(Pn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),xe(Xt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",Iae,O(e.block.path),1)]),_:1},8,["text"])):ae("",!0),e.block.kind==="diff"?(w(),T("div",Lae,[(w(!0),T(Pe,null,ot(e.block.diff,(S,L)=>(w(),T("div",{key:L,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",$ae,O(S.gutter),1),_("span",Fae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),T("div",Oae,[_("div",Rae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Je(" "+O(e.block.command),1)]),e.block.cwd?(w(),T("div",Bae,"cwd: "+O(e.block.cwd),1)):ae("",!0),e.block.danger?(w(),T("div",Dae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):ae("",!0)])):e.block.kind==="file"?(w(),T("div",Pae,[_("div",Hae,[_("span",Wae,O(e.block.language??""),1)]),_("div",zae,[(w(!0),T(Pe,null,ot(e.block.content.split(` +`),(S,L)=>(w(),T("div",{key:L,class:"file-line"},[_("span",Uae,O(L+1),1),_("span",qae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),T("div",jae,[_("span",Vae,O(e.block.op),1),_("span",Kae,O(e.block.path),1),e.block.detail?(w(),T("span",Gae,O(e.block.detail),1)):ae("",!0)])):e.block.kind==="url"?(w(),T("div",Yae,[e.block.method?(w(),T("span",Zae,O(e.block.method),1)):ae("",!0),_("span",Qae,O(e.block.url),1)])):e.block.kind==="search"?(w(),T("div",Xae,[_("span",Jae,O(C(s)("approval.searchQueryLabel")),1),_("span",ece,O(e.block.query),1),e.block.scope?(w(),T("span",tce,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ae("",!0)])):e.block.kind==="invocation"?(w(),T("div",nce,[_("span",oce,O(e.block.kind2),1),_("span",sce,O(e.block.name),1),e.block.description?(w(),T("span",ice,O(e.block.description),1)):ae("",!0)])):e.block.kind==="todo"?(w(),T("div",rce,[(w(!0),T(Pe,null,ot(e.block.items,(S,L)=>(w(),T("div",{key:L,class:"todo-item"},[_("span",lce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),T("div",ace,[re(Wm,{text:e.block.plan},null,8,["text"])])):(w(),T("div",cce,[_("span",uce,O(e.block.summary),1)])),c.value?(w(),T("div",dce,[Fn(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,fce),[[_s,u.value]]),_("div",hce,O(C(s)("approval.feedbackHint")),1)])):ae("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(w(),T("div",pce,[i.value.options.length>0?(w(!0),T(Pe,{key:0},ot(i.value.options,(S,L)=>(w(),xe(Xt,{key:L,text:S.description},{default:Ee(()=>[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:R=>$(S.label)},{default:Ee(()=>[Je(O(S.label),1),re(kr,{class:"k",keys:[String(L+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),xe(Bt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Je(O(C(s)("approval.approvePlan")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:N},{default:Ee(()=>[Je(O(C(s)("approval.revise")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["2"]})):ae("",!0)]),_:1},8,["disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Je(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["3"]})):ae("",!0)]),_:1},8,["loading","disabled"])])):(w(),T("div",mce,[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ee(()=>[Je(O(C(s)("approval.approve")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Je(O(C(s)("approval.approveSession")),1),re(kr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Je(O(C(s)("approval.reject")),1),re(kr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Je(O(C(s)("approval.feedback")),1),re(kr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),vce=ct(gce,[["__scopeId","data-v-458a9d7d"]]),yce=Ze({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),T("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),B5=ct(yce,[["__scopeId","data-v-f595d935"]]),kce={class:"taskspane"},bce={class:"tp-head"},xce={class:"tp-title"},wce={class:"tp-count"},_ce={class:"tp-list"},Sce={key:0,class:"tp-empty"},Cce=["role","onClick"],Ace={class:"tp-name"},Mce={class:"tp-time"},Ece=["onClick"],Tce={key:0,class:"tp-detail"},Nce={key:0,class:"tp-codebox"},Ice=["onClick"],Lce={class:"tp-pre"},$ce={class:"tp-cmd"},Fce={key:1,class:"tp-codebox"},Oce=["onClick"],Rce={class:"tp-pre"},Bce=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Tt(),s=Bo(new Set),i=Bo(new Set),r=Bo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,g,b){await Go(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(` +`)??"";g&&await d(g,p.id,r)}return(p,g)=>(w(),T("div",kce,[_("div",bce,[_("span",xce,O(C(o)("tasks.tag")),1),_("span",wce,O(e.tasks.length),1)]),_("div",_ce,[e.tasks.length===0?(w(),T("div",Sce,O(C(o)("tasks.emptyTasks")),1)):(w(!0),T(Pe,{key:1},ot(e.tasks,b=>(w(),T("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(B5,{status:u(b.state)},null,8,["status"]),_("span",Ace,O(b.name),1),re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(b.kind),1)]),_:2},1024),_("span",Mce,O(b.timing),1),b.state==="run"?(w(),T("button",{key:0,class:"tp-stop",onClick:bt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,Ece)):ae("",!0),b.kind==="subagent"?(w(),xe(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),xe(Ve,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ae("",!0)],8,Cce),s.has(b.id)&&l(b)?(w(),T("div",Tce,[b.meta?(w(),T("div",Nce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:bt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Ice),_("pre",Lce,[_("code",null,[_("span",$ce,O(b.meta),1)])])])):ae("",!0),b.output&&b.output.length>0?(w(),T("div",Fce,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:bt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Oce),_("pre",Rce,[_("code",null,[g[0]||(g[0]=Je(` + `,-1)),(w(!0),T(Pe,null,ot(b.output,(v,m)=>(w(),T("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Je(` + `,-1))])])])):ae("",!0)])):ae("",!0)],2))),128))])]))}}),qC=ct(Bce,[["__scopeId","data-v-28fd5fc0"]]),Dce={class:"todo-card"},Pce={key:0,class:"tc-empty"},Hce={class:"tc-name"},Wce=Ze({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),T("div",Dce,[t.todos.length===0?(w(),T("div",Pce,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):ae("",!0),(w(!0),T(Pe,null,ot(t.todos,(r,l)=>(w(),T("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[re(B5,{status:o(r.status)},null,8,["status"]),_("span",Hce,O(r.title),1)],2))),128))]))}}),zce=ct(Wce,[["__scopeId","data-v-01c65735"]]),Uce={class:"dock-work-head"},qce={key:0,class:"dock-work-tab static"},jce={key:1,class:"dock-work-tab static"},Vce={key:2,class:"dock-work-tab static"},Kce={class:"dock-work-body"},Gce={class:"dw-count"},Yce={class:"dw-count"},Zce={class:"dw-count"},Qce=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","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}=Tt(),r=X(null),l=X(null),a=X(null),c=X(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Qe(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),bn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(w(),T("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=bt(()=>{},["stop"]))},[re(Il,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(w(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=bt(()=>{},["stop"]))},[_("div",Uce,[e.dockPanel==="bash"?(w(),T("span",qce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),T("span",jce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),T("span",Vce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):ae("",!0)]),_("div",Kce,[e.dockPanel==="bash"?(w(),xe(qC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),xe(qC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),xe(zce,{key:2,todos:e.todos??[]},null,8,["todos"])):ae("",!0)])],512)):ae("",!0)]),_:1}),e.goal?(w(),xe(eae,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ae("",!0),e.hasDockWork?(w(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),xe(kh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ee(()=>[re(Ve,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",Gce,[v[29]||(v[29]=Je("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0),e.subagentTasks.length>0?(w(),xe(kh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ee(()=>[re(Ve,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Yce,[v[31]||(v[31]=Je("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0),(e.todos?.length??0)>0?(w(),xe(kh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ee(()=>[re(Ve,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",Zce,[v[33]||(v[33]=Je("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0)],512)):ae("",!0),e.pendingQuestion?(w(),xe(Mae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),xe(vce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),xe(R5,{key:4,ref_key:"composerRef",ref:r,"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,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Xce=ct(Qce,[["__scopeId","data-v-9e5ec0f2"]]),Jce=["aria-label","aria-hidden"],eue={class:"toc-scroll"},tue=["onClick"],nue={class:"toc-label"},oue=240,sue=Ze({__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}=Tt(),i=X(null),r=X(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=oue}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&mt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),po(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),T("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",eue,[(w(!0),T(Pe,null,ot(e.items,f=>(w(),T("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",nue,O(f.title),1)],10,tue))),128))])],10,Jce)):ae("",!0)}}),iue=ct(sue,[["__scopeId","data-v-3f1c1f66"]]),rue=5;function lue(e,t,n,o=rue){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 aue={class:"chat-layout"},cue={class:"empty-hint"},uue={key:0,class:"empty-hint-text"},due={key:1,class:"ws-pick"},fue={class:"ws-pick-name"},hue={key:1,class:"ws-pick-menu"},pue=["onClick"],mue={class:"ws-pick-item-name"},gue={class:"ws-pick-item-path"},vue=["aria-label"],yue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},kue={class:"abort-toast-text"},vg=80,jC=1e3,bue=420,xue=3e3,wue=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{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}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),s=e,i=n,r=X(!1),l=X(!1),a=B(()=>s.workspaces?.find(we=>we.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=B(()=>(s.workspaces?.length??0)>0),u=B(()=>lue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=B(()=>(s.workspaces?.length??0)-u.value.length);Qe(r,he=>{he||(l.value=!1)});function f(he){r.value=!1,he!==s.activeWorkspaceId&&i("selectWorkspace",he)}Na(Ft.contentAlign);const h=X(null),p=X(null),g=X(null),b=X(!1),v=X(0);let m=null;function y(he,we){const He=g.value??p.value;return!He||He.loadForEdit(he)===!1?!1:(He.loadAttachmentsForEdit(we??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=B(()=>s.tasks.filter(he=>he.kind!=="subagent")),N=B(()=>s.tasks.filter(he=>he.kind==="subagent"&&he.runInBackground)),x=B(()=>$.value.filter(he=>he.state==="run").length),I=B(()=>N.value.filter(he=>he.state==="run").length);function E(he){const we=s.tasks,He=we.find(Dt=>Dt.id===he)??we.find(Dt=>Dt.parentToolCallId===he);if(He)return He.id;const Rt=we.filter(Dt=>Dt.kind==="subagent"&&!Dt.parentToolCallId);if(Rt.length===1)return Rt[0].id}Ln("resolveAgentTaskId",E),Ln("pinScroll",to);const F=B(()=>(s.todos??[]).filter(he=>he.status==="done").length),S=B(()=>$.value.length>0||N.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),L=X(null),R=B(()=>s.gitInfo?s.changes?.length??0:0);function D(he){L.value=L.value===he?null:he}function z(){L.value=null}Qe(S,he=>{he||z()});function H(he){if(he.role==="compaction")return o("conversation.compactedPlain");if(he.role==="user"){if(he.skillActivation)return`/${he.skillActivation.name}`;if(he.pluginCommand)return`/${he.pluginCommand.pluginId}:${he.pluginCommand.commandName}`;const He=he.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const we=(he.text||he.thinking||"").trim().replaceAll(/\s+/g," ");return we.length>0?we:(he.tools?.length??0)>0?`${he.tools.length} tools`:"kimi"}const U=B(()=>s.turns.filter(he=>he.role==="user").map((he,we)=>({id:he.id,role:he.role,no:we+1,title:H(he)}))),Z=X(null);function K(){const he=Ae.value;if(!he)return;const we=he.querySelectorAll(".turn-anchor[data-turn-id]");if(we.length===0)return;const He=U.value;if(He.length===0)return;const Rt=new Set(He.map(Cs=>Cs.id));if(pe()<=vg){Z.value=He[He.length-1].id;return}const Dt=he.getBoundingClientRect(),rn=Dt.height/2;let Un=null;we.forEach(Cs=>{const Q=Cs.dataset.turnId;if(!Q||!Rt.has(Q))return;Cs.getBoundingClientRect().top-Dt.top<=rn&&(Un=Q)}),Z.value=Un??He[0].id}const V=X(!1);let J=0;function fe(){J||(J=it(()=>{J=0,oe()}))}function oe(){const he=Ae.value,we=!s.mobile&&s.conversationToc&&he?he.closest(".con")?.querySelector(".conversation-toc"):null,He=we?.querySelector(".toc-bar");let Rt=!1;if(he&&we&&He){const Dt=He.getBoundingClientRect(),rn=we.getBoundingClientRect(),Un=Dt.left+Dt.width/2;Rt=Array.from(he.querySelectorAll(".table-node-wrapper")).some(Cs=>{const Q=Cs.getBoundingClientRect();return Q.left<=Un&&Un<=Q.right&&Q.toprn.top})}V.value!==Rt&&(V.value=Rt)}const ce=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),ue=B(()=>{const he=ce.value;if(he)return s.pendingQuestionActions?.[he.questionId]}),Se=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Te=B(()=>{const he=Se.value;return he?!!s.pendingApprovalActions?.[he.approvalId]:!1}),Ae=X(null),P=X(null),le=X(0),ne=X(0),q=B(()=>({"--panes-scrollbar-width":`${le.value}px`}));function ee(he){return he instanceof HTMLElement?he:he&&"$el"in he&&he.$el instanceof HTMLElement?he.$el:null}function ge(){const he=Ae.value;le.value=he?Math.max(0,he.offsetWidth-he.clientWidth):0,ne.value=P.value?.offsetHeight??0}function de(he){const we=ee(he);Ae.value=we,we&&rs()}function ve(he){const we=ee(he);P.value=we??null,he&&"loadForEdit"in he&&typeof he.loadForEdit=="function"&&"focus"in he&&typeof he.focus=="function"?g.value={loadForEdit:he.loadForEdit.bind(he),loadAttachmentsForEdit:"loadAttachmentsForEdit"in he&&typeof he.loadAttachmentsForEdit=="function"?he.loadAttachmentsForEdit.bind(he):()=>{},focus:he.focus.bind(he)}:g.value=null,is()}const j=X(!0),te=X(!1);function pe(){const he=Ae.value;return he?he.scrollHeight-he.scrollTop-he.clientHeight:0}let Ce=0,$e=0,De=0,me=0,Ie=0,et=0;function rt(){return Date.now()<$e}function _t(){fe();const he=Ae.value;if(!he)return;const we=he.scrollTop;if(qn()){Ce=we;return}if(performance.now()-De<100){Ce=we;return}const He=pe();if(rt()){j.value=!0,te.value=!1,Ce=we;return}we1?(j.value=!1,te.value=!0):He<=vg&&we>Ce+1&&(j.value=!0,te.value=!1),Ce=we,K()}function gt(he=!1){const we=Ae.value;j.value=!0,te.value=!1,we&&(!he&&performance.now()({node:rn,top:It(he,rn)})),Rt=He.findIndex(rn=>rn.top>=we),Dt=Rt<0?Math.max(0,He.length-1):Rt;return He.slice(Dt,Dt+2).flatMap(rn=>{const Un=rn.node.dataset.scrollAnchorId,Cs=Un??rn.node.dataset.turnId;return Cs?[{kind:Un?"tool":"turn",id:Cs,top:rn.top}]:[]})}const ht=new Map;function un(he,we){for(const He of we.anchors){const Rt=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Dt=he.querySelector(`[${Rt}="${Wt(He.id)}"]`);if(Dt)return It(he,Dt)-He.top}return he.scrollHeight-we.oldHeight}function dn(he,we,He=he.scrollTop){return he.scrollTop=He+un(he,we),Ce=he.scrollTop,he.scrollTop}async function ns(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Tn.value||!s.hasMoreMessages)return;const he=s.sessionId,we=Ae.value,He=we?.scrollTop??0,Rt={anchors:we?Ut(we,He):[],oldHeight:we?.scrollHeight??0};jn(he,!0),ti();try{if(await mt(),await s.loadOlderMessages(he),await mt(),s.sessionId!==he){ht.set(he,Rt);return}const Dt=Ae.value;if(!Dt)return;dn(Dt,Rt),ht.delete(he)}finally{jn(he,!1)}}function Wt(he){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(he):he.replaceAll(/["\\]/g,"\\$&")}function Hn(he){const we=Ae.value;if(!we)return;const He=we.querySelector(`.turn-anchor[data-turn-id="${Wt(he)}"]`);He&&(Io(),j.value=!1,te.value=pe()>vg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function lo(){const he=Ae.value;if(!he)return"none";const we=he.firstElementChild,He=we instanceof HTMLElement?we.offsetHeight:0,Rt=P.value?.offsetHeight??0;return`${he.scrollHeight}:${he.clientHeight}:${He}:${Rt}`}function it(he){return typeof requestAnimationFrame=="function"?requestAnimationFrame(he):setTimeout(he,16)}function Gn(he){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(he):clearTimeout(he)}let ao=0,Yn=0,go=null,os=0;function qn(){return performance.now(){if(Yn=0,performance.now()>=ao||!go){go=null;return}const Dt=go.getBoundingClientRect().top-os;Dt&&(He.scrollTop+=Dt),Yn=it(Rt)};Yn=it(Rt)}function vn(he=36){if(!j.value&&!rt())return;const we=++et;let He="",Rt=0,Dt=0;Ie&&(Gn(Ie),Ie=0);const rn=()=>{if(Ie=0,we!==et||!j.value&&!rt())return;gt(!1);const Un=lo();Rt=Un===He?Rt+1:0,He=Un,Dt++,Rt<3&&Dt0&&we.length>=he.length&&he.firstId!==we.firstId&&he.lastId===we.lastId&&he.lastTextLen===we.lastTextLen&&he.lastThinkingLen===we.lastThinkingLen&&he.lastToolsLen===we.lastToolsLen&&he.approvalIds===we.approvalIds}const xn=B(()=>{const he=(s.approvals??[]).map(rn=>rn.approvalId).join(","),we=s.turns,He=we.at(-1),Rt=He?.thinking?.length??0,Dt=He?.tools?.reduce((rn,Un)=>rn+Un.name.length+(Un.arg?.length??0)+(Un.output?.join("").length??0),0)??0;return{length:we.length,firstId:we[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Rt,lastToolsLen:Dt,approvalIds:he}});Qe(xn,async(he,we)=>{if(Tn.value&&Zn(we,he)){K();return}await mt(),j.value||rt()?gt(he.length{is()}),Qe(()=>s.mobile,async()=>{await mt(),ge()});const An=new Map;Qe(()=>s.fileReloadKey,async(he,we)=>{const He=Ae.value;we&&He&&An.set(String(we),{top:He.scrollTop,following:j.value}),Io(),await mt();const Rt=Ae.value,Dt=he?An.get(String(he)):void 0;if(Dt&&Rt){const rn=ht.get(String(he)),Un=rn?dn(Rt,rn,Dt.top):Dt.top;rn&&ht.delete(String(he)),j.value=Dt.following,Rt.scrollTop=Un,Ce=Rt.scrollTop,te.value=!Dt.following&&pe()>1,Dt.following&&vn()}else j.value=!0,Ce=0,gt(!1),vn();K()}),Qe(()=>s.sessionLoading,async(he,we)=>{he||!we||(j.value=!0,await mt(),vn(),K())}),Qe(()=>s.turnActive,async(he,we)=>{he||!we||!j.value&&!rt()||(await mt(),vn(48),K())});function Mn(){j.value=!0,te.value=!1,$e=Date.now()+jC,mt(()=>{gt(!0),vn(16)})}function Do(he){Mn(),i("submit",he)}function ze(he){j.value=!0,te.value=!1,$e=Date.now()+jC,i("editMessage",he)}function Xe(he){const we=s.queued?.[he],He=we?.text??"";y(He,we?.attachments)&&i("editQueued",he)}function kt(he){i("reorderQueue",he)}function Ht(he,we){Mn(),i("answer",he,we)}function Rn(he,we){!he||!we||i("approval",he,we)}let sn=null,Gt=null,Wn=null,En=null,St=0,Po=0,Ao=0;const ss=X(new Set),Tn=B(()=>!!s.sessionId&&ss.value.has(s.sessionId));function jn(he,we){const He=new Set(ss.value);we?He.add(he):He.delete(he),ss.value=He}function Ps(){Tn.value||Ao||(Ao=it(()=>{Ao=0,!Tn.value&&(qn()||(j.value||rt())&>(!1))}))}function ti(){et++,Ie&&(Gn(Ie),Ie=0),Ao&&(Gn(Ao),Ao=0)}function Io(){const he=Ae.value;if($e=0,ti(),ao=0,go=null,he){const we=he.scrollTop;typeof he.scrollTo=="function"?he.scrollTo({top:we,behavior:"auto"}):he.scrollTop=we}me=0,De=Number.NEGATIVE_INFINITY,he&&(Ce=he.scrollTop)}function Ss(){const he=Ae.value;!he||he.scrollHeight-he.clientHeight<=1&&!s.hasMoreMessages||(j.value=!1,Io(),he.scrollHeight-he.clientHeight>1&&(te.value=!0))}function Wi(he){const we=Ae.value;if(!we)return!1;for(const He of he.composedPath()){if(He===we)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function Si(he){he.defaultPrevented||he.ctrlKey||he.shiftKey||he.deltaY>=0||Wi(he)||Ss()}function co(he){const we=Ae.value;if(!we||he.defaultPrevented||he.button!==0||he.pointerType==="touch")return;const He=we.getBoundingClientRect(),Rt=we.offsetWidth-we.clientWidth,Dt=Rt>0?Rt:12;he.target===we&&he.clientX>=He.right-Dt&&Ss()}let ni=null;function Ci(he){ni=he.touches.length===1?he.touches[0].clientY:null}function ar(he){const we=he.touches.length===1?he.touches[0].clientY:null;we!==null&&ni!==null&&we>ni+2&&!Wi(he)&&Ss(),ni=we}function no(){if(!Gt)return;const he=Ae.value?.firstElementChild??null;he!==Wn&&(Wn&&Gt.unobserve(Wn),Wn=he,he&&Gt.observe(he))}function is(){if(!Gt)return;const he=P.value;he!==En&&(En&&Gt.unobserve(En),En=he,he&&Gt.observe(he))}function rs(){const he=Ae.value;ge(),sn&&(sn.disconnect(),he&&sn.observe(he,{childList:!0,subtree:!0,characterData:!0})),Gt&&(Gt.disconnect(),Wn=null,En=null,he&&Gt.observe(he),no(),is()),St=he?.scrollHeight??0,Po=he?.clientHeight??0,fe()}function Lo(){no(),Ps(),fe()}function Ai(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&vn()}const zn=X(!1);let $o=null;function oi(){zn.value=!0,$o!==null&&clearTimeout($o),$o=setTimeout(()=>{zn.value=!1},xue)}function Ue(){oi(),i("interrupt")}function Fe(he){he.key==="Escape"&&(s.running||s.working)&&(he.preventDefault(),Ue())}function se(){j.value&&Ps()}cn(()=>{mt(()=>{typeof MutationObserver=="function"&&(sn=new MutationObserver(Lo)),typeof ResizeObserver=="function"&&(Gt=new ResizeObserver(()=>{fe(),ge();const he=Ae.value;if(!he)return;const{scrollHeight:we,clientHeight:He}=he,Rt=we>St+1,Dt=He{sn&&sn.disconnect(),Gt&&Gt.disconnect(),Ao&&Gn(Ao),Ie&&Gn(Ie),Yn&&Gn(Yn),J&&Gn(J),$o!==null&&clearTimeout($o),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ai),document.removeEventListener("keydown",Fe)),window.visualViewport?.removeEventListener("resize",se)});function Ne(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:Ne}),(he,we)=>(w(),T("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),xe(gse,{key:0,"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":R.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:we[0]||(we[0]=He=>i("openChanges")),onCopyAll:we[1]||(we[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:we[2]||(we[2]=He=>h.value?.copyFinalSummary()),onOpenPr:we[3]||(we[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:we[4]||(we[4]=(He,Rt)=>i("renameSession",He,Rt)),onForkSession:we[5]||(we[5]=He=>i("forkSession",He)),onArchiveSession:we[6]||(we[6]=He=>i("archiveSession",He)),onExportSession:we[7]||(we[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ae("",!0),e.conversationToc?(w(),xe(iue,{key:1,items:U.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:V.value,onSelect:Hn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ae("",!0),_("div",aue,[_("div",{ref:de,class:We(["panes chat-scroll",{"is-following":j.value,"history-prepending":Tn.value}]),onScrollPassive:_t,onWheelPassive:Si,onPointerdownPassive:co,onTouchstartPassive:Ci,onTouchmovePassive:ar},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),T(Pe,{key:0},[we[55]||(we[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",cue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):ae("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ae("",!0):(w(),T("span",uue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(w(),T("div",due,[re(Xt,{text:C(o)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:we[8]||(we[8]=bt(He=>r.value=!r.value,["stop"]))},[re(Ve,{name:"folder",size:"sm"}),_("span",fue,O(a.value),1),re(Ve,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(w(),T("div",{key:0,class:"ws-pick-backdrop",onClick:we[9]||(we[9]=He=>r.value=!1)})):ae("",!0),r.value?(w(),T("div",hue,[(w(!0),T(Pe,null,ot(u.value,He=>(w(),T("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:bt(Rt=>f(He.id),["stop"])},[_("span",mue,O(He.name),1),_("span",gue,O(He.shortPath),1)],10,pue))),128)),d.value>0?(w(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:we[10]||(we[10]=bt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ae("",!0),we[54]||(we[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:we[11]||(we[11]=bt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(Ve,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):ae("",!0)])):e.starting?ae("",!0):(w(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:we[12]||(we[12]=He=>i("addWorkspace"))},[re(Ve,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),re(R5,{ref_key:"emptyComposerRef",ref:p,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,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Do,onSteer:we[13]||(we[13]=He=>i("steer",He)),onCommand:we[14]||(we[14]=He=>i("command",He)),onInterrupt:Ue,onUnqueue:we[15]||(we[15]=He=>i("unqueue",He)),onEditQueued:we[16]||(we[16]=He=>i("editQueued",He)),onSetPermission:we[17]||(we[17]=He=>i("setPermission",He)),onSetThinking:we[18]||(we[18]=He=>i("setThinking",He)),onTogglePlan:we[19]||(we[19]=He=>i("togglePlan")),onToggleSwarm:we[20]||(we[20]=He=>i("toggleSwarm")),onToggleGoal:we[21]||(we[21]=He=>i("toggleGoal")),onOpenBtw:we[22]||(we[22]=He=>i("command","/btw")),onCreateGoal:we[23]||(we[23]=He=>i("createGoal",He)),onControlGoal:we[24]||(we[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:we[25]||(we[25]=He=>i("compact")),onPickModel:we[26]||(we[26]=He=>i("pickModel")),onSelectModel:we[27]||(we[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),we[56]||(we[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(w(),xe(A5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"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":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:we[28]||(we[28]=He=>i("openFile",He)),onOpenMedia:we[29]||(we[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:we[30]||(we[30]=He=>i("openThinking",He)),onOpenCompaction:we[31]||(we[31]=He=>i("openCompaction",He)),onOpenAgent:we[32]||(we[32]=He=>i("openAgent",He)),onOpenToolDiff:we[33]||(we[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:ns,onUnqueue:we[34]||(we[34]=He=>i("unqueue",He)),onEditQueued:Xe,onReorderQueue:kt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ae("",!0):(w(),xe(Xce,{key:0,ref:ve,style:Yt(q.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,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":v.value,"dock-panel":L.value,"bash-tasks":$.value,"subagent-tasks":N.value,"bash-running":x.value,"subagent-running":I.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ce.value,"question-busy-kind":ue.value,"pending-approval":Se.value,"approval-busy":Te.value,mobile:e.mobile,onToggleDockPanel:we[35]||(we[35]=He=>D(He)),onCloseDockPanel:we[36]||(we[36]=He=>z()),onOpenAgent:we[37]||(we[37]=He=>i("openAgent",He)),onAnswer:Ht,onDismiss:we[38]||(we[38]=He=>i("dismiss",He)),onApproval:Rn,onCancelTask:we[39]||(we[39]=He=>i("cancelTask",He)),onControlGoal:we[40]||(we[40]=He=>i("controlGoal",He)),onSubmit:Do,onSteer:we[41]||(we[41]=He=>i("steer",He)),onCommand:we[42]||(we[42]=He=>i("command",He)),onInterrupt:Ue,onSetPermission:we[43]||(we[43]=He=>i("setPermission",He)),onSetThinking:we[44]||(we[44]=He=>i("setThinking",He)),onTogglePlan:we[45]||(we[45]=He=>i("togglePlan")),onToggleSwarm:we[46]||(we[46]=He=>i("toggleSwarm")),onToggleGoal:we[47]||(we[47]=He=>i("toggleGoal")),onOpenBtw:we[48]||(we[48]=He=>i("command","/btw")),onCreateGoal:we[49]||(we[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:we[50]||(we[50]=He=>i("compact")),onPickModel:we[51]||(we[51]=He=>i("pickModel")),onSelectModel:we[52]||(we[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","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"]))]),re(Il,{name:"pill"},{default:Ee(()=>[te.value?(w(),T("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${ne.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:we[53]||(we[53]=He=>gt(!0))},[re(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Je(" "+O(C(o)("conversation.newMessages")),1)],12,vue)):ae("",!0)]),_:1}),re(Il,{name:"abort-toast"},{default:Ee(()=>[zn.value?(w(),T("div",yue,[_("span",kue,O(C(o)("conversation.manuallyAborted")),1)])):ae("",!0)]),_:1})],2))}}),_ue=ct(wue,[["__scopeId","data-v-68f9dafd"]]),Sue=["aria-selected","onClick"],Cue=Ze({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),T(Pe,null,ot(e.options,i=>(w(),T("button",{key:i.value,class:We(["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)},O(i.label),11,Sue))),128))],2))}}),gs=ct(Cue,[["__scopeId","data-v-d1aaccd7"]]),Aue={class:"ui-panel-header__title"},Mue={key:0,class:"ui-panel-header__sub"},Eue=Ze({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",Aue,O(e.title),1),re(Xt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(w(),T("span",Mue,O(e.subtitle),1)):ae("",!0)]),_:1},8,["text"]),On(t.$slots,"default",{},void 0,!0),e.closable?(w(),xe(Pn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):ae("",!0)],2))}}),$a=ct(Eue,[["__scopeId","data-v-c47879ad"]]),Tue={key:0,class:"fp-empty fp-error"},Nue={key:1,class:"fp-empty"},Iue={key:2,class:"fp-loading"},Lue={class:"fp-path"},$ue={class:"fp-meta"},Fue={key:0,class:"fp-lines"},Oue={class:"fp-size"},Rue={key:3,class:"fp-search"},Bue=["placeholder"],Due={key:0,class:"fp-search-count"},Pue=["href","aria-label"],Hue={key:1,class:"fp-code"},Wue={class:"fp-line-table"},zue=["data-line"],Uue={class:"fp-gutter"},que=["innerHTML"],jue={key:1,class:"fp-body fp-code"},Vue={class:"fp-line-table"},Kue=["data-line"],Gue={class:"fp-gutter"},Yue=["innerHTML"],Zue={key:2,class:"fp-body"},Que=["srcdoc","title"],Xue={key:1,class:"fp-code"},Jue={class:"fp-line-table"},ede=["data-line"],tde={class:"fp-gutter"},nde=["innerHTML"],ode={key:3,class:"fp-body fp-pdf-wrap"},sde=["src","title"],ide={key:1,class:"fp-binary-card"},rde={class:"fp-binary-label"},lde={key:4,class:"fp-body fp-table-wrap"},ade={class:"fp-table"},cde=["data-line"],ude={key:5,class:"fp-body fp-image-wrap"},dde=["src","alt"],fde={key:1,class:"fp-binary-card"},hde={class:"fp-binary-icon"},pde={class:"fp-binary-label"},mde={key:6,class:"fp-body fp-image-wrap"},gde=["src"],vde={key:1,class:"fp-binary-card"},yde={class:"fp-binary-icon"},kde={class:"fp-binary-label"},bde={key:7,class:"fp-body fp-code"},xde={class:"fp-line-table"},wde=["data-line"],_de={class:"fp-gutter"},Sde=["innerHTML"],Cde={key:8,class:"fp-body fp-binary-wrap"},Ade={class:"fp-binary-card"},Mde={class:"fp-binary-icon"},Ede={class:"fp-binary-label"},Tde=Ze({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Tt();function o(P,le){const ne=le?le.split("/").filter(Boolean):[];for(const q of P.split("/"))q===""||q==="."||(q===".."?ne.pop():ne.push(q));return ne.join("/")}const s=Kt("resolveImage",async P=>P),i=B(()=>{const P=c.file?.path??"",le=P.lastIndexOf("/");return le>0?P.slice(0,le):""});function r(P){if(/^(https?:|data:|blob:)/i.test(P)||P.startsWith("/"))return P;const le=i.value;return le?o(P,le):P}async function l(P){const le=r(P);return s?s(le):le}Ln("resolveImage",l);function a(P){let le=P.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(le)||le.startsWith("/"))return P;for(const q of["#","?"]){const ee=le.indexOf(q);ee!==-1&&(le=le.slice(0,ee))}const ne=i.value;return{...P,path:o(le,ne)}}const c=e,u=t;function d(P){c.openFile?.(a(P))}const f=X(null),h=B(()=>{const P=c.file;if(!P)return"binary";const le=P.mime??"",ne=P.languageId??"",q=P.path.toLowerCase();return le==="text/markdown"||ne==="markdown"||ne==="md"||q.endsWith(".mdx")?"markdown":le==="application/json"||ne==="json"?"json":le==="text/html"||ne==="html"||q.endsWith(".html")||q.endsWith(".htm")?"html":le==="application/pdf"||q.endsWith(".pdf")?"pdf":le==="text/csv"||ne==="csv"||q.endsWith(".csv")?"csv":le.startsWith("image/")?"image":le.startsWith("video/")?"video":P.isBinary?"binary":le.startsWith("text/")||ne!==""?"text":"binary"});function p(P){const le=atob(P),ne=Uint8Array.from(le,q=>q.charCodeAt(0));return new TextDecoder().decode(ne)}const g=B(()=>{const P=c.file;if(!P)return"";if(P.encoding==="base64")try{return p(P.content)}catch{return P.content}return P.content}),b=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=B(()=>c.file?(h.value==="json"?b.value:g.value).split(` +`):[]),m=B(()=>c.file?h.value==="json"?b.value:g.value:""),y=X(""),k=X(0),A=B(()=>{const P=y.value.trim().toLowerCase();if(!P)return[];const le=[];return v.value.forEach((ne,q)=>{ne.toLowerCase().includes(P)&&le.push(q+1)}),le});Qe(y,()=>{k.value=0});function $(P,le=!1){P&&mt(()=>{const ne=f.value?.querySelector(".fp-body"),q=ne?.querySelector(`[data-line="${P}"]`);if(!ne||!q)return;le&&(ne.scrollTop=0);const ee=ne.getBoundingClientRect(),ge=q.getBoundingClientRect(),de=ge.top-ee.top+ne.scrollTop;ne.scrollTop=de-ne.clientHeight/2+ge.height/2})}Qe(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function N(P){const le=A.value;le.length!==0&&(k.value=(k.value+P+le.length)%le.length,$(le[k.value]))}function x(P){const le=A.value;return{target:c.line===P,hit:le.includes(P),active:le[k.value]===P}}function I(P){return P<1024?`${P} B`:P<1024*1024?`${(P/1024).toFixed(1)} KB`:`${(P/(1024*1024)).toFixed(1)} MB`}const E=X(!1),F=X(!1);function S(){c.file&&Go(m.value).then(P=>{P&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function L(){c.file&&Go(c.file.path).then(P=>{P&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=X("preview"),D=X("preview"),z=X("fit");function H(P){R.value=P}function U(P){D.value=P}function Z(P){z.value=P}Qe(h,P=>{R.value=P==="html"?"preview":"source",D.value="preview",z.value="fit"});const K=B(()=>{const P=c.file;return!P||h.value!=="image"?null:P.sourceUrl?P.sourceUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:P.mime==="image/svg+xml"?`data:${P.mime};charset=utf-8,${encodeURIComponent(P.content)}`:null}),V=B(()=>{const P=c.file;return!P||h.value!=="video"?null:P.sourceUrl?P.sourceUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:null}),J=B(()=>{const P=c.file;return!P||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:null}),fe=B(()=>c.file?["",'',``,g.value].join(""):"");function oe(P){const le=[];let ne="",q=!1;for(let ee=0;eev.value.slice(0,200).map(oe));function ue(P){return P.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Se(){const P=c.file;if(!P)return"";const le=P.languageId?.toLowerCase();return le||(P.path.split(".").pop()?.toLowerCase()??"")}function Te(P){const le=Se();let ne=ue(P);return h.value==="json"||le==="json"||le==="jsonc"?(ne=ne.replace(/("[^&]*?")(\s*:)/g,'$1$2'),ne=ne.replace(/(:\s*)("[^&]*?")/g,'$1$2'),ne=ne.replace(/\b(true|false|null)\b/g,'$1'),ne=ne.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1$2'),ne):h.value==="html"||le==="html"||le==="xml"||le==="svg"?(ne=ne.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' $1$2'),ne=ne.replace(/(".*?")/g,'$1'),ne=ne.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1$2'),ne):(ne=ne.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'),ne=ne.replace(/(".*?"|'.*?')/g,'$1'),ne=ne.replace(/(\/\/.*)$/g,'$1'),ne)}function Ae(P,le=55){return!P||P.length<=le?P:"…"+P.slice(P.length-le+1)}return(P,le)=>(w(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),T("div",Tue,[_("span",null,O(e.error),1),e.closable?(w(),xe(Bt,{key:0,variant:"secondary",size:"sm",onClick:le[0]||(le[0]=ne=>u("close"))},{default:Ee(()=>[Je(O(C(n)("filePreview.close")),1)]),_:1})):ae("",!0)])):!e.file&&!e.loading?(w(),T("div",Nue,O(C(n)("filePreview.empty")),1)):e.loading?(w(),T("div",Iue,[le[7]||(le[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),T(Pe,{key:3},[re($a,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:le[6]||(le[6]=ne=>u("close"))},{default:Ee(()=>[re(Xt,{text:e.file.path},{default:Ee(()=>[_("span",Lue,O(Ae(e.file.path)),1)]),_:1},8,["text"]),_("span",$ue,[e.file.lineCount?(w(),T("span",Fue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ae("",!0),_("span",Oue,O(I(e.file.size)),1)]),h.value==="html"?(w(),xe(gs,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":H},null,8,["model-value","options"])):ae("",!0),h.value==="markdown"?(w(),xe(gs,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):ae("",!0),h.value==="image"?(w(),xe(gs,{key:2,"model-value":z.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ae("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),T("div",Rue,[Fn(_("input",{"onUpdate:modelValue":le[1]||(le[1]=ne=>y.value=ne),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Bue),[[_s,y.value]]),y.value.trim()?(w(),T("span",Due,O(A.value.length),1)):ae("",!0),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:le[2]||(le[2]=ne=>N(-1))},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:le[3]||(le[3]=ne=>N(1))},{default:Ee(()=>[re(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ae("",!0),re(Pn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:L},{default:Ee(()=>[F.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),xe(Pn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:le[4]||(le[4]=ne=>u("openExternal"))},{default:Ee(()=>[re(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):ae("",!0),e.externalActions?(w(),xe(Pn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:le[5]||(le[5]=ne=>u("reveal"))},{default:Ee(()=>[re(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):ae("",!0),e.downloadUrl?(w(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(Ve,{name:"download",size:"md"})],8,Pue)):ae("",!0),!e.file.isBinary&&h.value!=="image"?(w(),xe(Pn,{key:7,size:"sm",class:We({copied:E.value}),label:E.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[E.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ae("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),T("div",{key:0,class:We(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),xe(Wm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),T("div",Hue,[_("div",Wue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",Uue,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,que)],10,zue))),128))])]))],2)):h.value==="json"?(w(),T("div",jue,[_("div",Vue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",Gue,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,Yue)],10,Kue))),128))])])):h.value==="html"?(w(),T("div",Zue,[R.value==="preview"?(w(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:fe.value,title:e.file.path},null,8,Que)):(w(),T("div",Xue,[_("div",Jue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",tde,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,nde)],10,ede))),128))])]))])):h.value==="pdf"?(w(),T("div",ode,[J.value?(w(),T("iframe",{key:0,class:"fp-pdf-frame",src:J.value,title:e.file.path},null,8,sde)):(w(),T("div",ide,[_("span",rde,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),T("div",lde,[_("table",ade,[_("tbody",null,[(w(!0),T(Pe,null,ot(ce.value,(ne,q)=>(w(),T("tr",{key:q,class:We(x(q+1)),"data-line":q+1},[_("th",null,O(q+1),1),(w(!0),T(Pe,null,ot(ne,(ee,ge)=>(w(),T("td",{key:ge},O(ee),1))),128))],10,cde))),128))])])])):h.value==="image"?(w(),T("div",ude,[K.value?(w(),T("img",{key:0,src:K.value,alt:e.file.path,class:We(["fp-image",{actual:z.value==="actual"}])},null,10,dde)):(w(),T("div",fde,[_("span",hde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",pde,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:I(e.file.size)})),1)]))])):h.value==="video"?(w(),T("div",mde,[V.value?(w(),T("video",{key:0,src:V.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,gde)):(w(),T("div",vde,[_("span",yde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",kde,O(C(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:I(e.file.size)})),1)]))])):h.value==="text"?(w(),T("div",bde,[_("div",xde,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",_de,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,Sde)],10,wde))),128))])])):(w(),T("div",Cde,[_("div",Ade,[_("span",Mde,[re(Ve,{name:"file-off",size:"lg"})]),_("span",Ede,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:I(e.file.size)})),1)])]))],64)):ae("",!0)],512))}}),Nde=ct(Tde,[["__scopeId","data-v-ded222d2"]]),Ide={class:"tp"},Lde=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null);return Qe(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||mt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),T("div",Ide,[re($a,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(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"},O(e.text),513)]))}}),VC=ct(Lde,[["__scopeId","data-v-cf9c560b"]]),$de={class:"ap"},Fde={key:0,class:"ap-type"},Ode={key:1,class:"ap-reason"},Rde={key:2,class:"ap-field"},Bde={class:"ap-field-body"},Dde={key:3,class:"ap-field"},Pde={class:"ap-field-body ap-live"},Hde={key:4,class:"ap-field"},Wde={class:"ap-field-body ap-progress"},zde={key:0,class:"ap-call"},Ude={key:1,class:"ap-output"},qde=["onClick"],jde={key:5,class:"ap-field"},Vde={class:"ap-field-body"},Kde=8,KC=5,GC=2,Gde=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=B(()=>l(i.value)),c=X(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-KC-GC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=X(null);return Qe(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(w(),T("div",$de,[re($a,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ee(()=>[re(Ri,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Je(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),T("div",Fde,O(e.member.subagentType),1)):ae("",!0),e.member.suspendedReason?(w(),T("div",Ode,O(e.member.suspendedReason),1)):ae("",!0),e.member.prompt?(w(),T("div",Rde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Bde,O(e.member.prompt),1)])):ae("",!0),r.value?(w(),T("div",Dde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",Pde,O(r.value),1)])):ae("",!0),a.value.length>0?(w(),T("div",Hde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Wde,[(w(!0),T(Pe,null,ot(a.value,v=>(w(),T("div",{key:v.key,class:"ap-group"},[v.call?(w(),T("div",zde,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Je(" "+O(v.call),1)])):ae("",!0),v.output.length>0?(w(),T("div",Ude,[v.output.length<=Kde||u(v.key)?(w(!0),T(Pe,{key:0},ot(v.output,(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(w(),T(Pe,{key:1},[(w(!0),T(Pe,null,ot(v.output.slice(0,KC),(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,qde),(w(!0),T(Pe,null,ot(v.output.slice(-GC),(m,y)=>(w(),T("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):ae("",!0)]))),128))])])):ae("",!0),e.member.summary?(w(),T("div",jde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Vde,O(e.member.summary),1)])):ae("",!0)],512)]))}}),Yde=ct(Gde,[["__scopeId","data-v-715bd93e"]]),Zde={class:"diff-lines"},Qde={key:0,class:"hunk-text"},Xde={class:"dl-gutter old"},Jde={class:"dl-gutter new"},efe={class:"dl-sign"},tfe={class:"dl-text"},nfe=Ze({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(w(),T("div",Zde,[(w(!0),T(Pe,null,ot(e.lines,(r,l)=>(w(),T("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(w(),T("span",Qde,O(r.text),1)):(w(),T(Pe,{key:1},[_("span",Xde,O(t(r)),1),_("span",Jde,O(n(r)),1),_("span",efe,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",tfe,O(r.text),1)],64))],2))),128))]))}}),D5=ct(nfe,[["__scopeId","data-v-2f6bc1cc"]]),ofe={class:"tdp"},sfe={class:"tdp-body"},ife={key:1,class:"tdp-output"},rfe={key:2,class:"tdp-empty"},lfe=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Tt();return(s,i)=>(w(),T("div",ofe,[re($a,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",sfe,[e.target.lines&&e.target.lines.length>0?(w(),xe(D5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),T("div",ife,[(w(!0),T(Pe,null,ot(e.target.output,(r,l)=>(w(),T("div",{key:l},O(r),1))),128))])):(w(),T("div",rfe,O(C(o)("diff.noDiff")),1))])]))}}),afe=ct(lfe,[["__scopeId","data-v-76f2fbca"]]),cfe={class:"sc"},ufe={key:0,class:"sc-empty"},dfe={key:2,class:"sc-loading","aria-hidden":"true"},ffe={class:"sc-composer"},hfe=["placeholder"],pfe=["disabled"],mfe=Ze({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>n.turns.find(m=>m.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||s("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=X(""),c=X(null),u=X(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=B(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Qe(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(w(),T("div",cfe,[re($a,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),T("div",ufe,O(C(s)("sideChat.empty")),1)):(w(),xe(A5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(w(),T("div",dfe,[re(S5)])):ae("",!0)],512),_("div",ffe,[Fn(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,hfe),[[_s,a.value]]),re(Xt,{text:C(s)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(Ve,{name:"arrow-right",size:"sm"})],8,pfe)]),_:1},8,["text"])])]))}}),gfe=ct(mfe,[["__scopeId","data-v-f973798f"]]),vfe={class:"changes-pane"},yfe={class:"dv-path"},kfe={class:"diff-head"},bfe={class:"back-label"},xfe={key:0,class:"empty-state"},wfe={key:1,class:"dv-lines-wrap"},_fe={key:2,class:"empty-state"},Sfe={class:"dv-change-count"},Cfe={class:"ch-head"},Afe={class:"br-label"},Mfe={class:"br-name"},Efe={key:0,class:"sync-info"},Tfe={key:0,class:"ahead"},Nfe={key:0,class:"behind"},Ife={key:1,class:"empty-head"},Lfe={key:0,class:"ch-list"},$fe=["onClick"],Ffe={class:"fpath"},Ofe={key:1,class:"ch-list ch-tree"},Rfe={class:"tree-list"},Bfe=["onClick"],Dfe={class:"tree-name"},Pfe=["onClick"],Hfe={class:"tree-name"},Wfe={key:2,class:"empty-state"},zfe={key:3,class:"empty-state"},Ufe=Ze({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},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}=Tt(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+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),h=B(()=>o.fileDiff??[]),p=B(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=X("list");function y(F){m.value=F}function k(F){const S={children:[]},L=[...F].sort((R,D)=>R.path.localeCompare(D.path));for(const R of L){const D=R.path.split("/");let z=S;for(let H=0;HJ.name===U&&J.kind===(Z?"file":"folder"));V||(V={name:U,path:K,kind:Z?"file":"folder",status:Z?R.status:void 0,children:[]},z.children.push(V)),z=V}}return S.children}const A=B(()=>k(o.changes)),$=X(new Set);function N(F){return!$.value.has(F)}const x=B(()=>{const F=[];function S(L,R){for(const D of L)F.push({node:D,depth:R}),D.kind==="folder"&&N(D.path)&&S(D.children,R+1)}return S(A.value,0),F});function I(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function E(F){return`${16+F*16}px`}return(F,S)=>(w(),T("div",vfe,[f.value?(w(),T(Pe,{key:0},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[re(Xt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",yfe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",kfe,[e.hideBack?ae("",!0):(w(),xe(Bt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",bfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),T("div",xfe,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),T("div",wfe,[re(D5,{lines:h.value},null,8,["lines"])])):(w(),T("div",_fe,O(C(n)("diff.noDiff")),1))],64)):(w(),T(Pe,{key:1},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",Sfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(gs,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",Cfe,[c.value?(w(),T(Pe,{key:0},[_("span",Afe,O(C(n)("diff.branch")),1),_("span",Mfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),T("span",Efe,[re(Xt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(w(),T("span",Tfe,"↑"+O(e.gitInfo.ahead),1)):ae("",!0)]),_:1},8,["text"]),re(Xt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(w(),T("span",Nfe,"↓"+O(e.gitInfo.behind),1)):ae("",!0)]),_:1},8,["text"])])):ae("",!0)],64)):(w(),T("span",Ife,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(w(),T("div",Lfe,[(w(!0),T(Pe,null,ot(e.changes,L=>(w(),xe(Xt,{key:L.path,text:L.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:R=>g(L.path)},[_("span",{class:We(["badge",i(L.status)])},O(l(L.status)),3),_("span",Ffe,O(a(L.path)),1)],8,$fe)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(w(),T("div",Ofe,[_("ul",Rfe,[(w(!0),T(Pe,null,ot(x.value,({node:L,depth:R})=>(w(),T("li",{key:L.path,class:"tree-node"},[L.kind==="folder"?(w(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(R)}),onClick:D=>I(L)},[re(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Dfe,O(L.name),1)],12,Bfe)):(w(),xe(Xt,{key:1,text:L.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(R)}),onClick:D=>g(L.path)},[_("span",{class:We(["badge",i(L.status)])},O(l(L.status)),3),_("span",Hfe,O(L.name),1)],12,Pfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),T("div",Wfe,O(C(n)("diff.clean")),1)):(w(),T("div",zfe,O(C(n)("diff.empty")),1))],64))]))}}),qfe=ct(Ufe,[["__scopeId","data-v-7778610a"]]);function jk(e,t){let n=null;cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),po(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const jfe=["type","value","placeholder","disabled","readonly"],Vfe=Ze({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=X();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(w(),T("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,jfe))}}),Kc=ct(Vfe,[["__scopeId","data-v-340f0da2"]]),Kfe={class:"search-wrap"},Gfe={key:0,class:"tab-strip"},Yfe={key:1,class:"state-row"},Zfe={key:2,class:"state-row unavail"},Qfe={key:3,class:"model-list"},Xfe=["aria-selected","onClick","onMouseenter"],Jfe={class:"check"},ehe={class:"model-main"},the={class:"model-name"},nhe={class:"model-id"},ohe={key:0,class:"caps"},she={class:"model-provider"},ihe={class:"model-ctx"},rhe={key:0,class:"empty"},lhe={class:"footer-hint"},ahe=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=B(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=X(""),a=X(null),c=X(null),u=X("all");jk(c,a);const d=B(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=B(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),N=A.provider.toLowerCase().includes(y),x=A.id.toLowerCase().includes(y);return!y||$||N||x});return u.value!=="all"?k:k.sort((A,$)=>{const N=r(A.id)?1:0;return(r($.id)?1:0)-N})}),h=B(()=>f.value),p=X(0);Qe([l,u],()=>{p.value=0}),Qe(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Qe(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}cn(()=>{document.addEventListener("keydown",g)}),bn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",Kfe,[re(Kc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),T("div",Gfe,[(w(!0),T(Pe,null,ot(d.value,A=>(w(),xe(Bt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ee(()=>[Je(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ae("",!0),e.loading?(w(),T("div",Yfe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),T("div",Zfe,[re(Ve,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(w(),T("div",Qfe,[(w(!0),T(Pe,null,ot(h.value,A=>(w(),T("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",Jfe,[A.id===e.current?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",ehe,[_("span",the,O(A.displayName??A.model),1),_("span",nhe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(w(),T("span",ohe,[(w(!0),T(Pe,null,ot(A.capabilities,$=>(w(),xe(Ri,{key:$,variant:"info",size:"sm"},{default:Ee(()=>[Je(O($),1)]),_:2},1024))),128))])):ae("",!0)]),_("span",she,O(A.provider),1),_("span",ihe,O(C(n)("model.contextSuffix",{size:C(ir)(A.maxContextSize)})),1),re(Pn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt($=>s("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(w(),xe(Ve,{key:0,name:"star",size:"md"})):(w(),xe(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Xfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),T("div",rhe,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ae("",!0)])),_("div",lhe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),che=ct(ahe,[["__scopeId","data-v-56cefe51"]]),uhe={key:0,class:"ui-field__label"},dhe={key:1,class:"ui-field__error"},fhe={key:2,class:"ui-field__hint"},hhe=Ze({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),T("label",uhe,O(e.label),1)):ae("",!0),On(t.$slots,"default",{},void 0,!0),e.error?(w(),T("span",dhe,O(e.error),1)):e.hint?(w(),T("span",fhe,O(e.hint),1)):ae("",!0)],2))}}),fh=ct(hhe,[["__scopeId","data-v-49bce958"]]),phe=["value","disabled"],mhe=Ze({__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)=>(w(),T("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[On(s.$slots,"default",{},void 0,!0)],42,phe))}}),Yv=ct(mhe,[["__scopeId","data-v-92a040fd"]]),ghe={class:"prov-list"},vhe={key:0,class:"state-row"},yhe={key:1,class:"state-row unavail"},khe={key:2,class:"empty"},bhe={class:"prov-info"},xhe={class:"prov-type"},whe={key:0,class:"prov-url"},_he={class:"prov-meta"},She={key:0},Che={class:"prov-actions"},Ahe={key:0,class:"add-section"},Mhe={key:0,class:"add-btns"},Ehe={key:1,class:"add-form"},The=["value"],Nhe={key:0,class:"add-error"},Ihe={class:"form-btns"},Lhe={class:"footer-hint"},$he=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(null);jk(o);const s=t;function i(b){s("delete",b)}const r=X(!1),l=Bo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=X(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}cn(()=>document.addEventListener("keydown",h)),bn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",ghe,[e.loading?(w(),T("div",vhe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),T("div",yhe,[re(Ve,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),T("div",khe,O(C(n)("providers.empty")),1)):(w(!0),T(Pe,{key:3},ot(e.providers,m=>(w(),T("div",{key:m.id,class:"prov-row"},[re(Xt,{text:g(m.status)},{default:Ee(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:Yt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",bhe,[_("span",xhe,O(m.type),1),m.baseUrl?(w(),T("span",whe,O(m.baseUrl),1)):ae("",!0),_("span",_he,[re(Ri,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Je(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(w(),T("span",She," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):ae("",!0)])]),_("div",Che,[re(Xt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ee(()=>[Je(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Xt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ee(()=>[Je(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ae("",!0):(w(),T("div",Ahe,[r.value?(w(),T("div",Ehe,[re(fh,{label:C(n)("providers.fieldType")},{default:Ee(()=>[re(Yv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ee(()=>[(w(),T(Pe,null,ot(c,m=>_("option",{key:m,value:m},O(m),9,The)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[re(Kc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[re(Kc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[re(Kc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(w(),T("div",Nhe,O(a.value),1)):ae("",!0),_("div",Ihe,[re(Bt,{variant:"primary",size:"sm",onClick:f},{default:Ee(()=>[Je(O(C(n)("providers.add")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:d},{default:Ee(()=>[Je(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),T("div",Mhe,[re(Bt,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Bt,{variant:"primary",size:"sm",onClick:u},{default:Ee(()=>[re(Ve,{name:"plus",size:"sm"}),Je(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",Lhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Fhe=ct($he,[["__scopeId","data-v-cf73278e"]]),Ohe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Rhe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Bhe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},yg=Ze({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),T("svg",Ohe,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),T("svg",Rhe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),T("svg",Bhe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Dhe={key:0,class:"center-body"},Phe={class:"center-text"},Hhe={key:1,class:"nb"},Whe={class:"nb-lead"},zhe=["href"],Uhe={class:"nb-or"},qhe={class:"nb-fallback"},jhe={class:"nb-fb-text"},Vhe=["href"],Khe={class:"nb-code-row"},Ghe={class:"nb-code"},Yhe={class:"nb-status"},Zhe={class:"nb-status-text"},Qhe={class:"nb-countdown"},Xhe={key:2,class:"center-body"},Jhe={class:"center-text success-text"},epe={class:"center-hint"},tpe={class:"center-body"},npe={class:"center-text err-text"},ope={class:"center-hint"},spe={class:"actions"},ipe={class:"center-body"},rpe={class:"center-text warn-text"},lpe={class:"center-hint"},ape={class:"actions"},cpe=3,upe=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(!0),s=t,i=e,r=X("starting"),l=X(!1),a=X(null),c=X(0),u=X(!1);let d=null,f=null,h=0;cn(async()=>{await p()}),bn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const N=await i.onPollOAuthLogin();if(N===null){if(h+=1,h>=cpe){v(),l.value=!0,r.value="error";return}b($);return}h=0,N.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):N.status==="expired"||N.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Go(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const N=Math.floor($/60),x=$%60;return`${N}:${String(x).padStart(2,"0")}`}return($,N)=>(w(),xe(qr,{open:o.value,"onUpdate:open":N[0]||(N[0]=x=>o.value=x),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(w(),T("div",Dhe,[re(Ds,{size:"md"}),_("span",Phe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(w(),T("div",Hhe,[_("div",Whe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Je(O(C(n)("login.authorizeInBrowser"))+" ",1),re(Ve,{name:"external-link",size:"sm"})],8,zhe),_("div",Uhe,O(C(n)("login.orDivider")),1),_("div",qhe,[_("div",jhe,[Je(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,Vhe),Je(O(C(n)("login.fallbackSuffix")),1)]),_("div",Khe,[_("span",Ghe,O(a.value.userCode),1),re(Bt,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(w(),T(Pe,{key:0},[re(Ve,{name:"check",size:"sm"}),Je(" "+O(C(n)("login.copied")),1)],64)):(w(),T(Pe,{key:1},[re(Ve,{name:"copy",size:"sm"}),Je(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Yhe,[re(Ds,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",Zhe,O(C(n)("login.waitingAutoClose")),1),_("span",Qhe,O(A(c.value)),1)])])):r.value==="success"?(w(),T("div",Xhe,[re(yg,{kind:"success"}),_("span",Jhe,O(C(n)("login.success")),1),_("span",epe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),T(Pe,{key:3},[_("div",tpe,[re(yg,{kind:"expired"}),_("span",npe,O(C(n)("login.expiredTitle")),1),_("span",ope,O(C(n)("login.expiredHint")),1)]),_("div",spe,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),T(Pe,{key:4},[_("div",ipe,[re(yg,{kind:"error"}),_("span",rpe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",lpe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",ape,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):ae("",!0)]),_:1},8,["open","title"]))}}),dpe=ct(upe,[["__scopeId","data-v-8308a28f"]]);function fpe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const hpe=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Fi(e){const t=e.replaceAll("\\","/"),n=hpe.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function ppe(e,t){const n=Fi(t.cwd);return e.find(o=>Fi(o.root)===n)?.id??t.workspaceId??t.cwd}function mpe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(Fi)),r=new Map;for(const d of t){const f=Fi(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 h=Fi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:fpe(f),sessionCount:0})}const l=new Map;for(const d of n){const f=ppe(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Fi(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),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function gpe(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 YC(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function vpe(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 ype(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 kpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function bpe(e){return kpe.has(e.type)}const xpe=50,wpe=100,Zv=32*1024,_pe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,xpe)},cancelTask(e){clearTimeout(e)}};function Spe(e,t,n={}){const o=n.scheduler??_pe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??wpe)),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)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r{if(u||d()===0)return;let m=r;for(let y=r;y{u||(u=!0,f(),i.length=0,r=0)},b}function Qv(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 Cpe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Qv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=Zv)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 Ape(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Qv(e.appEvent),i=Qv(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>Zv)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 P5=["blue","mono"],H5=["light","dark","system"],W5=14,Mpe=12,Epe=20;function Tpe(){const e=mo(Ft.accent);return e&&P5.includes(e)?e:"blue"}function Npe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Ipe(){const e=mo(Ft.colorScheme);return e&&H5.includes(e)?e:"system"}function Lpe(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"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Vk(e){return Number.isFinite(e)?Math.min(Epe,Math.max(Mpe,Math.round(e))):W5}function $pe(){const e=mo(Ft.uiFontSize);return e===null?W5:Vk(Number(e))}function Fpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Vk(e)}px`)}const Kk=X(Ipe()),Gk=X(Tpe()),Yk=X($pe());Qe(Kk,Lpe,{immediate:!0});Qe(Gk,Npe,{immediate:!0});Qe(Yk,Fpe,{immediate:!0});function Ope(e){H5.includes(e)&&(Kk.value=e,So(Ft.colorScheme,e))}function Rpe(e){P5.includes(e)&&(Gk.value=e,So(Ft.accent,e))}function Bpe(e){const t=Vk(e);Yk.value=t,So(Ft.uiFontSize,String(t))}const Dpe=600,Ppe=250,Gm=250,Hpe=1e3,Wpe=160,Wp=X(!1);let va=[],xa=null,zp=-Gm;function zpe(){va=[],zp=-Gm,Wp.value=!1,xa!==null&&(clearTimeout(xa),xa=null)}function Upe(){Wp.value=!0,xa!==null&&clearTimeout(xa),xa=setTimeout(()=>{xa=null,va=[],zp=-Gm,Wp.value=!1},Hpe)}function qpe(e){if(e<=0)return;const t=Date.now();va.push({time:t,chars:e});const n=t-Dpe;if(va=va.filter(l=>l.time>=n),t-zpl+a.chars,0)/s*1e3>=Wpe&&Upe()}function z5(){return{colorScheme:Kk,accent:Gk,uiFontSize:Yk,fastMoon:Wp,setColorScheme:Ope,setAccent:Rpe,setUiFontSize:Bpe,resetFastMoon:zpe,recordMoonDelta:qpe}}function jpe(e,t,n){return e==="idle"&&!t&&!n}function Zk(e,t){const n=mo(e);return n===null?t:n==="1"}const Qk=X(Zk(Ft.notifyOnComplete,!0)),Xk=X(Zk(Ft.notifyOnQuestion,!1)),Jk=X(Zk(Ft.notifyOnApproval,!1)),e2=X(typeof Notification<"u"?Notification.permission:"denied"),Vpe="/favicon.ico";async function t2(e,t,n){if(!n){e.value=!1,So(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}e2.value=o,o==="granted"&&(e.value=!0,So(t,"1"))}function Kpe(e){return t2(Qk,Ft.notifyOnComplete,e)}function Gpe(e){return t2(Xk,Ft.notifyOnQuestion,e)}function Ype(e){return t2(Jk,Ft.notifyOnApproval,e)}function n2(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Zpe(e){return{title:_n.global.t("settings.notifyTitle"),body:n2(e,_n.global.t("settings.notifyFallback"))}}function Qpe(e,t){return{title:_n.global.t("settings.notifyQuestionTitle"),body:n2(t,e,_n.global.t("settings.notifyQuestionFallback"))}}function Xpe(e,t){return{title:_n.global.t("settings.notifyApprovalTitle"),body:n2(t,e,_n.global.t("settings.notifyApprovalFallback"))}}function o2(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{e2.value=i,i==="granted"&&ZC(t,n,o)});return}ZC(t,n,o)}}function ZC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Vpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Jpe(e,t){o2(Qk.value,t,Zpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function eme(e){o2(Xk.value,e,Qpe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function tme(e){o2(Jk.value,e,Xpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function nme(){return{notifyOnComplete:Qk,notifyOnQuestion:Xk,notifyOnApproval:Jk,notifyPermission:e2,setNotifyOnComplete:Kpe,setNotifyOnQuestion:Gpe,setNotifyOnApproval:Ype,maybeNotifyCompletion:Jpe,maybeNotifyQuestion:eme,maybeNotifyApproval:tme}}function ome(){return mo(Ft.soundOnComplete)==="1"}const cu=X(ome());function sme(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let kg=null;function U5(){const e=sme();if(!e)return null;if(kg===null)try{kg=new e}catch{return null}return kg}function q5(){if(!cu.value)return;const e=U5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Er("sound: audio context resumed",{state:e.state})},t=>{Er("sound: audio context resume rejected",{error:String(t)})})}let QC=!1;function ime(){if(QC||typeof window>"u")return;QC=!0;const e=()=>{q5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}ime();function rme(e){cu.value=e,So(Ft.soundOnComplete,e?"1":"0"),e&&q5()}function XC(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 s2(){const e=U5();if(e===null){Er("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Er("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Er("sound: context resumed for next time",{state:e.state})},t=>{Er("sound: resume rejected",{error:String(t)})});return}try{XC(e,880,0,.16,.18),XC(e,1320,.1,.22,.16),Er("sound: chime scheduled",{state:e.state})}catch(t){Er("sound: failed to play",{error:String(t)})}}function lme(){cu.value&&s2()}function ame(){cu.value&&s2()}function cme(){cu.value&&s2()}function ume(){return{soundOnComplete:cu,setSoundOnComplete:rme,maybePlayCompletionSound:lme,maybePlayQuestionSound:ame,maybePlayApprovalSound:cme}}const dme=1e3,fme=4096,JC=32*1024;function hme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await dt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:YC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],g=dt(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:JC});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=dt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?fme:JC});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:YC(m,b)}}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())},dme))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=X(0);let d=null;return Qe(()=>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}),Qe(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}function pme(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 mme(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&&pme(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 Xv="/sessions/";function e4(e){const{pathname:t}=e;if(!t.startsWith(Xv))return;const n=t.slice(Xv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function gme(e){return e===void 0||e.length===0?"/":`${Xv}${encodeURIComponent(e)}`}const vme=50,Jv=5,yme=40402,kme=40410,bme=40902,xme=2e3;function bg(e){return vi(e)&&e.code===bme}const wme=40904;function _me(e){return vi(e)&&e.code===wme}const ca=Bo({}),hh=Bo({}),xg=Bo({}),Yi=Bo(new Set),Ym=new Map,Fa=new Map,Up=new Map;let Sme=0;const da=new Map,Cme=3;let t4=0;function Ame(){return t4+=1,`${Date.now().toString(36)}-${t4}`}function Mme(e){return{generation:Ym.get(e)??0,pending:(Fa.get(e)?.size??0)>0}}function ey(e){const t=++Sme;Ym.set(e,t);const n=Fa.get(e)??new Set;return n.add(t),Fa.set(e,n),t}function ty(e,t){const n=Fa.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Fa.delete(e);const o=Up.get(e);Up.delete(e),o?.()}function Eme(e){Ym.delete(e),Fa.delete(e),Up.delete(e),da.delete(e)}function Tme(e,t){return!t.pending&&t.generation===(Ym.get(e)??0)}function Nme(e,t){if((Fa.get(e)?.size??0)===0){t();return}Up.set(e,t)}function Ime(e,t){const{t:n}=_n.global,{confirm:o}=tf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:N,persistSessionProfile:x,mergedWorkspaces:I,workspacesView:E,status:F,workspaceIdForSession:S,savePermissionToStorage:L,savePlanModeToStorage:R,saveSwarmModeToStorage:D,saveGoalModeToStorage:z,draftModes:H,saveUnread:U,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,resetFastMoon:J,initialized:fe,connectIssue:oe,selectedDiffPath:ce,fileDiffLines:ue,fileDiffLoading:Se}=t;let Te=!1;async function Ae(Q){if(e.messagesLoadingMoreBySession[Q])return;const be=e.messagesBySession[Q];if(!be||be.length===0)return;const ke=be[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!1};try{const Oe=await dt().listMessages(Q,{beforeId:ke,pageSize:vme}),Ye=[...Oe.items].reverse();b(Q,st=>[...Ye,...st]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[Q]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!0},l("loadOlderMessages",Oe,{sessionId:Q})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!1}}}function P(Q){s.loadTasksForSession(Q),q(Q),$(Q),N(Q),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,Q)||r.loadSkillsForSession(Q)}async function le(Q){const be=e.activeSessionId;if(be){ce.value=Q,ue.value=[],Se.value=!0;try{const Oe=await dt().getFileDiff(be,Q);if(ce.value!==Q)return;ue.value=mme(Oe.diff)}catch(ke){ce.value===Q&&(ue.value=[]),console.warn("[loadFileDiff] diff unavailable for",Q,ke)}finally{ce.value===Q&&(Se.value=!1)}}}function ne(){ce.value=null,ue.value=[],Se.value=!1}async function q(Q){try{const ke=await dt().getGitStatus(Q);e.gitStatusBySession={...e.gitStatusBySession,[Q]:ke}}catch{}}async function ee(){try{const be=await dt().getAuth();return e.authReady=be.ready,e.defaultModel=be.defaultModel,e.managedProviderStatus=be.managedProvider?.status??null,oe.value=null,"proceed"}catch(Q){return vi(Q)&&(Q.code===401||Q.code===x5)?(oe.value=null,"server-auth-required"):(oe.value=(Q instanceof Error?Q.message:String(Q)).slice(0,140),"retry")}}async function ge(){let Q=!0;for(;;){const be=await ee();if(be!=="retry")return be;Q&&(oe.value=null,Q=!1),await new Promise(ke=>{setTimeout(ke,xme)})}}async function de(){try{const Q=dt();e.config=await Q.getConfig()}catch{}}async function ve(Q){try{const ke=await dt().setConfig(Q);return e.config=ke,e.defaultModel=ke.defaultModel??null,!0}catch(be){return l("setConfig",be),!1}}const j=100,te=30,pe=720*60*1e3;async function Ce(){const Q=dt(),be=[];let ke,Oe;for(;;){let Ye;try{Ye=await Q.listSessions({pageSize:j,beforeId:ke,excludeEmpty:!0})}catch(st){if(be.length===0)throw st;Oe=st;break}if(be.push(...Ye.items),!Ye.hasMore||Ye.items.length===0)break;ke=Ye.items[Ye.items.length-1].id}return{sessions:be,error:Oe}}function $e(Q){const be=new Map(e.sessions.map(ke=>[ke.id,ke.usage]));u(Q.map(ke=>{const Oe=be.get(ke.id);return Oe!==void 0&&Hv(ke.usage)&&!Hv(Oe)?{...ke,usage:Oe}:ke}))}function De(Q){const be=[...Q],ke=new Set(be.map(Oe=>Oe.id));for(const Oe of e.sessions)ke.has(Oe.id)||(be.push(Oe),ke.add(Oe.id));return be.sort((Oe,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),be}async function me(Q){const be=dt(),ke=[],Oe=Date.now(),Ye=jt=>Oe-new Date(jt.updatedAt).getTime();let st,Ct=!1,Ot=!0,uo;for(;;){let jt;try{jt=await be.listSessions({workspaceId:Q,pageSize:Jv,beforeId:st,excludeEmpty:!0})}catch(Mt){if(Ot)throw Mt;uo=Mt,Ct=!0;break}if(Ct=jt.hasMore,jt.items.length===0)break;const wn=jt.items[jt.items.length-1],ls=Ye(wn)>=pe;if(!Ot&&ls){const Mt=jt.items.findIndex(Vt=>Ye(Vt)>=pe),Nt=Mt>=0?Mt+1:jt.items.length;ke.push(...jt.items.slice(0,Nt)),Ct=jt.hasMore||Ntme(Mt.id))),ke=[],Oe=new Set,Ye=new Map,st=new Set;let Ct;for(let Mt=0;Mtst.has(Mt.id)).map(Mt=>Mt.root)),uo=new Set(Q.map(Mt=>Mt.id));for(const Mt of e.sessions)!(Mt.workspaceId!==void 0&&uo.has(Mt.workspaceId)?st.has(Mt.workspaceId):Ot.has(Mt.cwd)||st.has(S(Mt)))||Oe.has(Mt.id)||(ke.push(Mt),Oe.add(Mt.id));const jt={},wn={},ls={};for(const{id:Mt}of Q){const Nt=Ye.get(Mt);if(Nt===void 0){const Vt=e.sessionsHasMoreByWorkspace[Mt],fo=e.sessionsCursorByWorkspace[Mt],oo=e.sessionsInitialCountByWorkspace[Mt];Vt!==void 0&&(jt[Mt]=Vt),fo!==void 0&&(wn[Mt]=fo),oo!==void 0&&(ls[Mt]=oo);continue}jt[Mt]=Nt.hasMore,wn[Mt]=Nt.items.length>0?Nt.items[Nt.items.length-1].id:void 0,ls[Mt]=Math.max(Nt.items.length,Jv)}return e.sessionsHasMoreByWorkspace=jt,e.sessionsCursorByWorkspace=wn,e.sessionsInitialCountByWorkspace=ls,e.sessionsFullyLoaded=!1,ke.sort((Mt,Nt)=>new Date(Nt.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),st.size>0&&l("load",Ct),ke}async function et(Q){if(e.sessionsLoadingMoreByWorkspace[Q]||e.sessionsHasMoreByWorkspace[Q]===!1)return;const be=e.sessionsCursorByWorkspace[Q];if(be!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!0};try{const ke=await dt().listSessions({workspaceId:Q,pageSize:te,beforeId:be,excludeEmpty:!0}),Oe=new Set(e.sessions.map(st=>st.id)),Ye=ke.items.filter(st=>!Oe.has(st.id));Ye.length>0&&u([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Q]:ke.items.length>0?ke.items[ke.items.length-1].id:be},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Q]:ke.hasMore}}catch(ke){l("loadMoreSessions",ke)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!1}}}}async function rt(){if(e.sessionsFullyLoaded)return;const Q=await Ce().catch(Oe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(Q===null)return;const be=Q.error===void 0?Q.sessions:De(Q.sessions);if($e(be),e.sessionsFullyLoaded=Q.error===void 0,Q.error!==void 0)return;const ke={};for(const Oe of e.workspaces)ke[Oe.id]=!1;e.sessionsHasMoreByWorkspace=ke}async function _t(){const Q=await dt().getMeta().catch(()=>null);Q!==null&&(e.serverVersion=Q.serverVersion,e.availableOpenInApps=Q.openInApps,e.dangerousBypassAuth=Q.dangerousBypassAuth,e.backend=Q.backend)}async function gt(){const Q=Date.now();let be="accepted";ko("app:load:start"),e.loading=!0;const ke=!fe.value;let Oe=!0;try{if(ke&&await ge()==="server-auth-required"){Oe=!1,be="auth-required";return}const Ye=dt();await Promise.all([Ye.getHealth().catch(()=>null),_t(),r.loadModels()]),ke||await ee(),await de(),await It();const st=await Ie(),Ct=st??e.sessions;st!==void 0&&$e(st);const Ot=Ct[0],uo=e.activeWorkspaceId;!(uo!==null&&I.value.some(ls=>ls.id===uo))&&Ot&&ht(S(Ot)),xn();const wn=typeof window<"u"?e4(window.location):void 0;!e.activeSessionId&&wn!==void 0&&(e.sessions.some(Mt=>Mt.id===wn)||await to(wn))&&await An(wn,{urlMode:"replace"}),!e.activeSessionId&&Ct.length>0&&await An(Ct[0].id,{urlMode:"replace"})}catch(Ye){be="failed",l("load",Ye)}finally{e.loading=!1,Oe&&(fe.value=!0),ko("app:load:complete",{status:be,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Q})}}async function It(){try{const Q=dt(),[be,ke]=await Promise.all([Q.listWorkspaces().catch(()=>[]),Q.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Ut(be),e.fsHome=ke.home||null,e.recentRoots=ke.recentRoots}catch{}}function Ut(Q){const be=zf();return Object.keys(be).length===0?Q:Q.map(ke=>{const Oe=be[ke.root];return Oe!==void 0?{...ke,name:Oe}:ke})}function ht(Q){e.activeWorkspaceId=Q,Z(Q)}function un(Q){ht(Q);const be=e.sessions.filter(ke=>S(ke)===Q);if(be.length>0){const ke=be[0];ke&&ke.id!==e.activeSessionId&&An(ke.id)}else g(void 0),qn(void 0,"push")}function dn(Q){const be=zf()[Q.root],ke=be!==void 0?{...Q,name:be}:Q,Oe=Fi(ke.root);e.hiddenWorkspaceRoots.some(Ct=>Fi(Ct)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Ct=>Fi(Ct)!==Oe),K(e.hiddenWorkspaceRoots));const Ye=e.workspaces.findIndex(Ct=>Ct.id===ke.id||Ct.root===ke.root);if(Ye===-1){e.workspaces=[ke,...e.workspaces];return}const st=[...e.workspaces];st[Ye]=ke,e.workspaces=st}function ns(Q){if(Q.type==="workspaceCreated"||Q.type==="workspaceUpdated"){dn(Q.workspace);return}const be=e.workspaces.find(Oe=>Oe.id===Q.workspaceId)?.root??Q.root;if(be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==Q.workspaceId&&Oe.root!==be),e.activeWorkspaceId===Q.workspaceId||e.activeWorkspaceId===be){const Oe=E.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)Z(Oe);else try{Na(Ft.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,ne(),qn(void 0,"replace")}}function Wt(){g(void 0),qn(void 0,"push")}function Hn(Q){ht(Q),Wt(),ne()}async function lo(Q){const be=I.value.find(wn=>wn.id===Q);if(!be)return null;const ke=e.thinking,Oe=dt();let Ye,st=be.root;try{const wn=await Oe.addWorkspace({root:be.root});Ye=wn.id,st=wn.root,dn(wn)}catch{}const Ct=r.draftModel.value??void 0,Ot=await Oe.createSession({workspaceId:Ye,cwd:st,model:Ct});r.draftModel.value=null;const uo=Ct!==void 0&&(!Ot.model||Ot.model.length===0)?{...Ot,model:Ct}:Ot;f(uo),ht(Ot.workspaceId??Ye??Q),await An(Ot.id);const jt=Ot.id;return ke!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[jt]:ke}),H.planMode&&(e.planModeBySession={...e.planModeBySession,[jt]:!0},R()),H.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[jt]:!0},D()),H.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[jt]:!0},z()),H.planMode=!1,H.swarmMode=!1,H.goalMode=!1,jt}async function it(Q,be,ke){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;await Mn(Oe,be,ke)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{Yi.delete(Q)}}}async function Gn(Q,be,ke){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;const Ye=e.planModeBySession[Oe]??!1,st=e.swarmModeBySession[Oe]??!1,Ct=e.sessions.find(jt=>jt.id===Oe),Ot=(Ct?.model&&Ct.model.length>0?Ct.model:e.defaultModel)??void 0;if(!await x({model:Ot,planMode:Ye,swarmMode:st,permissionMode:e.permission},Oe))return;await r.activateSkill(be,ke,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{Yi.delete(Q)}}}async function ao(Q,be){if(!Yi.has(Q)){Yi.add(Q);try{const ke=await lo(Q);if(!ke)return;await i.openSideChatOn(ke,be)}catch(ke){l("startSessionAndOpenSideChat",ke)}finally{Yi.delete(Q)}}}async function Yn(Q){const be=Q.trim();if(!be)return!1;const ke=dt();try{const Oe=await ke.addWorkspace({root:be});return dn(Oe),Hn(Oe.id),!0}catch(Oe){return console.warn("[kimi-web] addWorkspaceByPath failed for",be,Oe),!1}}async function go(Q){try{return await dt().browseFs(Q)}catch{return{path:"",parent:null,entries:[]}}}async function os(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function qn(Q,be){if(be==="none"||typeof window>"u"||!window.history)return;const ke=gme(Q);if(window.location.pathname!==ke)try{be==="push"?window.history.pushState(null,"",ke):window.history.replaceState(null,"",ke)}catch{}}async function to(Q){try{const be=await dt().getSession(Q);return e.sessions.some(ke=>ke.id===be.id)||h(be),!0}catch{return!1}}function vn(){const Q=e4(window.location);if(Q===void 0){g(void 0);return}if(Q!==e.activeSessionId){if(e.sessions.some(be=>be.id===Q)){An(Q,{urlMode:"none"});return}(async()=>{if(await to(Q)){await An(Q,{urlMode:"none"});return}const be=e.sessions[0];be?await An(be.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))})()}}let Zn=!1;function xn(){Zn||typeof window>"u"||(Zn=!0,window.addEventListener("popstate",vn))}async function An(Q,be){const ke=A(Q),Oe=!ke&&c.has(Q);c.delete(Q);try{qn(Q,be?.urlMode??"push"),e.sessionLoading=!ke&&!Oe,g(Q),J(),e.unreadBySession[Q]&&(e.unreadBySession={...e.unreadBySession,[Q]:!1},U({[Q]:!1})),ne();const Ye=e.sessions.find(st=>st.id===Q);if(Ye){const st=S(Ye);e.activeWorkspaceId!==st&&ht(st)}if(ke){if(await k(Q)==="not-found")return}else if(await y(Q)==="not-found")return;P(Q)}catch(Ye){l("selectSession",Ye,{sessionId:Q})}finally{e.activeSessionId===Q&&(e.sessionLoading=!1)}}async function Mn(Q,be,ke){const Oe=ey(Q);e.inFlightBySession={...e.inFlightBySession,[Q]:!0};const Ye=v();try{const st=dt(),Ct=[];be&&Ct.push({type:"text",text:be});for(const Vt of ke??[])Vt.kind==="video"?Ct.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Vt.kind==="file"?Ct.push({type:"file",fileId:Vt.fileId,name:Vt.name??"",mediaType:Vt.mediaType||"application/octet-stream",size:Vt.size??0}):Ct.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});if(Ct.length===0)return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},"rejected";const Ot={id:Ye,sessionId:Q,role:"user",content:Ct,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Q,Vt=>[...Vt,Ot]);const uo=e.sessions.find(Vt=>Vt.id===Q),jt=(uo?.model&&uo.model.length>0?uo.model:e.defaultModel)??void 0,wn=e.planModeBySession[Q]??!1,ls=e.swarmModeBySession[Q]??!1,Mt=e.goalModeBySession[Q]??!1;if(Mt&&be)try{await st.updateSession(Q,{goalObjective:be.trim()})}catch(Vt){return l("createGoal",Vt,{sessionId:Q}),e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,fo=>fo.some(oo=>oo.id===Ye)?fo.filter(oo=>oo.id!==Ye):fo),"rejected"}const Nt=await st.submitPrompt(Q,{content:Ct,model:jt,thinking:await r.resolveThinkingForPrompt(Q,jt)??e.thinking,permissionMode:e.permission,planMode:wn,swarmMode:ls});return Mt&&(e.goalModeBySession={...e.goalModeBySession,[Q]:!1},z()),e.promptIdBySession={...e.promptIdBySession,[Q]:Nt.promptId},b(Q,Vt=>{const fo=Vt.findIndex(zi=>zi.id===Ye);if(fo===-1)return Vt;const oo=[...Vt];return oo[fo]={...oo[fo],promptId:oo[fo].promptId??Nt.promptId},oo}),m()?.bindNextPromptId(Q,Nt.promptId),"ok"}catch(st){return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,Ct=>Ct.some(Ot=>Ot.id===Ye)?Ct.filter(Ot=>Ot.id!==Ye):Ct),l("sendPrompt",st,{sessionId:Q}),vi(st)?"rejected":"uncertain"}finally{ty(Q,Oe)}}async function Do(Q,be){const ke=e.activeSessionId;if(ke){if(a.value!=="idle"||e.inFlightBySession[ke]){kt(Q,be);return}if((e.queuedBySession[ke]?.length??0)>0){kt(Q,be),Ht(ke);return}await Mn(ke,Q,be)}}async function ze(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[],Ye=[],st=[];for(const Nt of Oe){const Vt=Nt.text.trim();Vt&&Ye.push(Vt),Nt.attachments?.length&&st.push(...Nt.attachments)}const Ct=Q.trim();if(Ct&&Ye.push(Ct),be?.length&&st.push(...be),Ye.length===0&&st.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[ke]:[]});const Ot=Ye.join(` + +`),uo=()=>{if(Oe.length===0)return;const Nt=e.queuedBySession[ke]??[];e.queuedBySession={...e.queuedBySession,[ke]:[...Oe,...Nt]}};if(a.value==="idle"&&!e.inFlightBySession[ke]){await Mn(ke,Ot,st)==="rejected"&&uo();return}const jt=[];Ot&&jt.push({type:"text",text:Ot});for(const Nt of st)Nt.kind==="video"?jt.push({type:"video",source:{kind:"file",fileId:Nt.fileId}}):Nt.kind==="file"?jt.push({type:"file",fileId:Nt.fileId,name:Nt.name??"",mediaType:Nt.mediaType||"application/octet-stream",size:Nt.size??0}):jt.push({type:"image",source:{kind:"file",fileId:Nt.fileId}});const wn=v(),ls={id:wn,sessionId:ke,role:"user",content:jt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(ke,Nt=>[...Nt,ls]);const Mt=ey(ke);try{const Nt=dt(),Vt=e.sessions.find(zi=>zi.id===ke),fo=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,oo=await Nt.submitPrompt(ke,{content:jt,model:fo,thinking:await r.resolveThinkingForPrompt(ke,fo)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[ke]??!1,swarmMode:e.swarmModeBySession[ke]??!1});if(b(ke,zi=>{const Ul=zi.findIndex(lf=>lf.id===wn);if(Ul===-1)return zi;const ql=[...zi];return ql[Ul]={...ql[Ul],promptId:ql[Ul].promptId??oo.promptId},ql}),oo.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[ke]:oo.promptId},m()?.bindNextPromptId(ke,oo.promptId);return}try{await Nt.steerPrompts(ke,[oo.promptId])}catch{}}catch(Nt){b(ke,Vt=>Vt.filter(fo=>fo.id!==wn)),vi(Nt)&&uo(),l("steer",Nt,{sessionId:ke})}finally{ty(ke,Mt)}}async function Xe(Q,be){try{const Oe=await dt().uploadFile({file:Q,name:be});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(ke){return l("uploadImage",ke),null}}function kt(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[],Ye={text:Q,attachments:be,id:Ame()};e.queuedBySession={...e.queuedBySession,[ke]:[...Oe,Ye]}}function Ht(Q){const[be,...ke]=e.queuedBySession[Q]??[];be!==void 0&&(e.queuedBySession={...e.queuedBySession,[Q]:ke},Mn(Q,be.text,be.attachments).then(Oe=>{if(Oe==="ok"){da.delete(Q);return}if(Oe==="uncertain"){da.delete(Q);return}if(!e.sessions.some(uo=>uo.id===Q)){da.delete(Q);return}const Ye=be.id??be.text,st=da.get(Q),Ct=st!==void 0&&st.key===Ye?st.count+1:1;if(Ct>=Cme){da.delete(Q),(e.queuedBySession[Q]?.length??0)>0&&Ht(Q);return}da.set(Q,{key:Ye,count:Ct});const Ot=e.queuedBySession[Q]??[];e.queuedBySession={...e.queuedBySession,[Q]:[be,...Ot]}}))}function Rn(Q,be){const ke=e.inFlightBySession[Q]===!0;if(e.inFlightBySession={...e.inFlightBySession,[Q]:!1},e.promptIdBySession[Q]!==void 0){const Ye={...e.promptIdBySession};delete Ye[Q],e.promptIdBySession=Ye}return Q===e.activeSessionId&&J(),(ke||be?.turnWasActive===!0||(e.turnActiveBySession[Q]??!1))&&Ht(Q),ke}function sn(Q,be){be.inFlightTurn!==null&&be.busy||Rn(Q)}async function Gt(){const Q=e.activeSessionId;if(!Q)return;const be=e.sessions.find(Ye=>Ye.id===Q);let ke=e.promptIdBySession[Q];if(ke===void 0){const Ye=be?.currentPromptId;Ye!==void 0&&Ye.length>0&&!Ye.startsWith("pr_")&&(ke=Ye)}const Oe=dt();if(ke!==void 0)try{if((await Oe.abortPrompt(Q,ke)).aborted)return;const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}catch(Ye){if(vi(Ye)&&Ye.code===yme){const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}else{l("abortCurrentPrompt",Ye,{sessionId:Q});return}}try{await Oe.abortSession(Q)}catch(Ye){l("abortCurrentPrompt",Ye,{sessionId:Q})}}function Wn(Q,be){const ke=e.approvalsBySession[Q]??[];e.approvalsBySession={...e.approvalsBySession,[Q]:ke.filter(Oe=>Oe.approvalId!==be)}}function En(Q,be){const ke=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:ke.filter(Oe=>Oe.questionId!==be)}}async function St(Q,be){const ke=e.activeSessionId;if(ke&&!hh[Q]){hh[Q]=!0;try{const Oe=dt(),Ye={decision:be.decision,scope:be.scope,feedback:be.feedback,selectedLabel:be.selectedLabel};await Oe.respondApproval(ke,Q,Ye),Wn(ke,Q)}catch(Oe){bg(Oe)?Wn(ke,Q):l("respondApproval",Oe,{sessionId:ke})}finally{delete hh[Q]}}}async function Po(Q,be){const ke=e.activeSessionId;if(ke&&!ca[Q]){ca[Q]="answer";try{await dt().respondQuestion(ke,Q,be),En(ke,Q)}catch(Oe){bg(Oe)?En(ke,Q):l("respondQuestion",Oe,{sessionId:ke})}finally{delete ca[Q]}}}async function Ao(Q){const be=e.activeSessionId;if(be&&!ca[Q]){ca[Q]="dismiss";try{await dt().dismissQuestion(be,Q),En(be,Q)}catch(ke){bg(ke)?En(be,Q):l("dismissQuestion",ke,{sessionId:be})}finally{delete ca[Q]}}}async function ss(Q){const be=e.activeSessionId;if(be&&!xg[Q]){xg[Q]=!0;try{const ke=dt(),Oe=(e.tasksBySession[be]??[]).find(st=>st.id===Q)?.backgroundTaskId;await ke.cancelTask(be,Oe??Q);const Ye=e.tasksBySession[be]??[];e.tasksBySession={...e.tasksBySession,[be]:Ye.map(st=>st.id===Q?{...st,status:"cancelled"}:st)}}catch(ke){_me(ke)||l("cancelTask",ke,{sessionId:be})}finally{delete xg[Q]}}}function Tn(Q){const be=e.activeSessionId;be?(e.planModeBySession={...e.planModeBySession,[be]:Q},R(),x({planMode:Q})):H.planMode=Q}function jn(){const Q=e.activeSessionId,be=Q?e.planModeBySession[Q]??!1:H.planMode;Tn(!be)}function Ps(Q){const be=e.activeSessionId;be?(e.swarmModeBySession={...e.swarmModeBySession,[be]:Q},D(),x({swarmMode:Q})):H.swarmMode=Q}async function ti(){const Q=e.activeSessionId,ke=!(Q?e.swarmModeBySession[Q]??!1:H.swarmMode);ke&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Ps(ke)}function Io(Q){const be=e.activeSessionId;be?(e.goalModeBySession={...e.goalModeBySession,[be]:Q},z()):H.goalMode=Q}function Ss(){const Q=e.activeSessionId,be=Q?e.goalModeBySession[Q]??!1:H.goalMode;Io(!be)}async function Wi(Q){const be=Q.trim();if(!be||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:be}),variant:"primary"}))return;let ke=e.activeSessionId;if(!ke){const Oe=e.activeWorkspaceId,Ye=Oe&&E.value.some(st=>st.id===Oe)?Oe:E.value[0]?.id??null;if(!Ye)return;try{ke=await lo(Ye)??void 0}catch(st){l("createGoal",st);return}if(!ke)return}try{await dt().updateSession(ke,{goalObjective:be})}catch(Oe){l("createGoal",Oe,{sessionId:ke,message:V(Oe)});return}e.goalModeBySession[ke]&&(e.goalModeBySession={...e.goalModeBySession,[ke]:!1},z()),e.activeSessionId===ke?await Do(be):await Mn(ke,be)}function Si(Q){const be=e.activeSessionId;be&&Promise.resolve(dt().updateSession(be,{goalControl:Q})).catch(ke=>{l("controlGoal",ke,{sessionId:be,message:V(ke)})})}function co(Q){e.permission=Q,L(Q),x({permissionMode:Q})}function ni(Q){const be=[...e.warnings];be.splice(Q,1),e.warnings=be}async function Ci(Q,be){try{await dt().updateSession(Q,{title:be}),d(Q,Oe=>({...Oe,title:be}))}catch(ke){l("renameSession",ke,{sessionId:Q})}}async function ar(Q,be){const ke=e.workspaces.find(Ye=>Ye.id===Q)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Q?{...Ye,name:be}:Ye)};try{if(await dt().updateWorkspace(Q,{name:be}),ke!==void 0){const Ye=zf();ke in Ye&&(delete Ye[ke],ew(Ye))}Oe()}catch(Ye){if(ke!==void 0&&vi(Ye)&&Ye.code===kme){ew({...zf(),[ke]:be}),Oe();return}l("renameWorkspace",Ye)}}async function no(Q){const be=e.workspaces.find(st=>st.id===Q)?.root??I.value.find(st=>st.id===Q)?.root??Q,ke=e.activeSessionId?e.sessions.find(st=>st.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===Q||e.activeWorkspaceId===be,Ye=!!(ke&&(ke.cwd===be||ke.workspaceId===Q||S(ke)===Q));be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(Q)}catch(st){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",Q,st)}if(e.workspaces=e.workspaces.filter(st=>st.id!==Q&&st.root!==be),Oe||Ye){const st=E.value[0]?.id??null;if(e.activeWorkspaceId=st,st)Z(st);else try{Na(Ft.activeWorkspace)}catch{}}(Oe||Ye)&&(g(void 0),e.sessionLoading=!1,ne(),qn(void 0,"replace"))}async function is(Q){try{await dt().archiveSession(Q),p(Q),i.clearSideChatForSession(Q);const{[Q]:ke,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===Q){const Ye=e.sessions[0];Ye?await An(Ye.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))}}catch(be){l("archiveSession",be,{sessionId:Q})}}async function rs(Q){if(Te)return;const be=Q??e.activeSessionId;if(!be){const Oe=n("commands.export.noSession");ko("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}Te=!0;const ke=Date.now();ko("export:start",{sessionId:be});try{const Oe=Qte(),{blob:Ye,fileName:st}=await dt().exportSession(be,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const Ct=URL.createObjectURL(Ye);let Ot;try{Ot=document.createElement("a"),Ot.href=Ct,Ot.download=st,document.body.append(Ot),Ot.click()}finally{Ot?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Ct)}catch{}},0)}ko("export:accepted",{sessionId:be,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-ke})}catch(Oe){const Ye=typeof Oe=="object"&&Oe!==null?Oe:void 0;ko("export:failed",{sessionId:be,status:"failed",durationMs:Date.now()-ke,errorName:typeof Ye?.name=="string"?Ye.name:typeof Oe,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),l("exportSession",Oe,{sessionId:be})}finally{Te=!1}}async function Lo(Q){try{const be=await dt().restoreSession(Q);return f(be),!0}catch(be){return l("restoreSession",be,{sessionId:Q}),!1}}function Ai(Q){return dt().listSessions({archivedOnly:!0,beforeId:Q?.beforeId,pageSize:Q?.pageSize??50})}async function zn(){try{await dt().logout(),await ee(),await gt()}catch(Q){l("logout",Q)}}function $o(Q){const be=e.activeSessionId;be&&dt().compactSession(be,Q).catch(ke=>{l("compact",ke,{sessionId:be})})}async function oi(Q){const be=Q??e.activeSessionId;if(be)try{const ke=await dt().forkSession(be);f(ke),await An(ke.id)}catch(ke){l("fork",ke,{sessionId:be})}}async function Ue(Q=1){const be=e.activeSessionId;if(!be)return null;const ke=(()=>{const Oe=e.messagesBySession[be]??[];for(let Ye=Oe.length-1;Ye>=0;Ye--){const st=Oe[Ye];if(st.role==="user"&&!(st.metadata?.origin&&st.metadata.origin.kind!=="user"))return st.content.filter(Ct=>Ct.type==="text").map(Ct=>Ct.text).join(` +`)}return null})();try{return await dt().undoSession(be,Q),await y(be),ke}catch(Oe){return l("undo",Oe,{sessionId:be}),null}}function Fe(Q){const be=e.activeSessionId;if(!be)return;const ke=e.queuedBySession[be]??[];if(Q<0||Q>=ke.length)return;const Oe=[...ke];Oe.splice(Q,1),e.queuedBySession={...e.queuedBySession,[be]:Oe}}function se(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[];if(Q===be||Q<0||Q>=Oe.length||be<0||be>=Oe.length)return;const Ye=[...Oe],[st]=Ye.splice(Q,1);st!==void 0&&(Ye.splice(be,0,st),e.queuedBySession={...e.queuedBySession,[ke]:Ye})}async function Ne(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().listDirectory(be,{path:Q,includeGitStatus:!0})).items}catch{return[]}}async function he(Q){const be=e.activeSessionId;if(!be)return null;try{const Oe=await dt().readFile(be,{path:Q});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(ke){return console.warn("[kimi-web] readFileContent failed for",Q,ke),null}}const we=10485760;function He(Q){const be=e.activeSessionId;return be?dt().getFileDownloadUrl(be,Q):null}async function Rt(Q,be){const ke=e.activeSessionId;if(!ke)return!1;try{return await dt().openFile(ke,{path:Q,line:be}),!0}catch(Oe){return l("openFile",Oe,{sessionId:ke}),!1}}async function Dt(Q){const be=e.activeSessionId;if(!be)return;const ke=F.value.cwd||".";try{await dt().openInApp(be,Q,ke)}catch(Oe){l("openInApp",Oe,{sessionId:be})}}async function rn(Q){const be=e.activeSessionId;if(!be)return!1;try{return await dt().revealFile(be,{path:Q}),!0}catch(ke){return l("revealFile",ke,{sessionId:be}),!1}}async function Un(Q){if(/^(https?:|data:|blob:)/i.test(Q))return Q;const be=e.activeSessionId;if(!be)return Q;let ke=Q;if(ke.startsWith("/")){const Oe=e.sessions.find(Ye=>Ye.id===be)?.cwd;if(Oe&&(ke===Oe||ke.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(ke=ke.slice(Oe.length).replace(/^\//,""),!ke)return Q}else return Q}try{const Ye=await dt().readFile(be,{path:ke,length:we});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Q:`data:${Ye.mime};base64,${Ye.content}`}catch{return Q}}async function Cs(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().searchFiles(be,{query:Q,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:ne,loadGitStatus:q,checkAuth:ee,loadConfig:de,updateConfig:ve,listAllSessionsGlobal:Ce,load:gt,refreshServerMeta:_t,loadWorkspaces:It,loadMoreSessions:et,loadAllSessions:rt,selectWorkspace:ht,openWorkspace:un,upsertWorkspacePreserveOrder:dn,applyWorkspaceEvent:ns,clearActiveSession:Wt,openWorkspaceDraft:Hn,startSessionAndSendPrompt:it,startSessionAndActivateSkill:Gn,startSessionAndOpenSideChat:ao,addWorkspaceByPath:Yn,browseFs:go,getFsHome:os,writeSessionUrl:qn,fetchSessionIntoList:to,onSessionRoutePopState:vn,bindSessionRoute:xn,selectSession:An,submitPromptInternal:Mn,finishPromptLocal:Rn,localTurnStartState:Mme,isLocalTurnSnapshotCurrent:Tme,afterLocalTurnStartsSettle:Nme,handleSessionSnapshot:sn,sendPrompt:Do,steerPrompt:ze,uploadImage:Xe,enqueue:kt,unqueue:Fe,reorderQueue:se,abortCurrentPrompt:Gt,respondApproval:St,respondQuestion:Po,dismissQuestion:Ao,pendingQuestionActions:ca,pendingApprovalActions:hh,cancelTask:ss,setPlanMode:Tn,togglePlanMode:jn,setSwarmMode:Ps,toggleSwarmMode:ti,setGoalMode:Io,toggleGoalMode:Ss,createGoal:Wi,controlGoal:Si,setPermission:co,dismissWarning:ni,renameSession:Ci,renameWorkspace:ar,deleteWorkspace:no,archiveSession:is,exportSession:rs,restoreSession:Lo,loadArchivedSessions:Ai,logout:zn,compact:$o,forkSession:oi,undo:Ue,listDir:Ne,readFileContent:he,getFileDownloadUrl:He,openWorkspaceFile:Rt,openInApp:Dt,revealWorkspaceFile:rn,resolveImageUrl:Un,searchFiles:Cs,loadOlderMessages:Ae,refreshSessionSidecars:P,isStartingFirstPrompt:()=>Yi.size>0}}const j5=Ft.starredModels,n4=new Error("profile persist failed");function Lme(){try{const e=mo(j5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function $me(e){try{So(j5,JSON.stringify(e))}catch{}}function Fme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=X([]),c=X(Lme()),u=X({}),d=X({}),f=X([]),h=X(null);function p(V){if(!(V==null||V.length===0))return a.value.find(J=>J.id===V)??a.value.find(J=>J.model===V)}function g(){const V=e.activeSessionId?e.sessions.find(fe=>fe.id===e.activeSessionId):void 0,J=V===void 0?h.value??e.defaultModel:V.model||e.defaultModel;return p(J)?.id??J??void 0}function b(V){if(V===void 0)return;const J=p(V);return J===void 0?void 0:Pd(J)}function v(V,J){const fe=V==null?void 0:e.thinkingBySession[V];return fe!==void 0&&xre(J,fe)?fe:Pd(J)}function m(V,J){if(J===void 0)return;const fe=p(J);return fe===void 0?void 0:v(V,fe)}async function y(V,J){return V!=null&&e.thinkingBySession[V]===void 0&&await o(V),m(V,J)}function k(V){e.thinking=V;const J=e.activeSessionId;return V!==void 0&&J!==null&&J!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:V}),V}Qe([()=>e.activeSessionId,()=>g(),()=>{const V=e.activeSessionId;return V==null?void 0:e.thinkingBySession[V]}],()=>{const V=p(g());V!==void 0&&(e.thinking=v(e.activeSessionId,V))});function A(V){dt().setConfig({thinking:wre(V,p(g())?.supportEfforts)}).catch(J=>n("setConfig",J))}async function $(V){try{const fe=await dt().listSkills(V);u.value={...u.value,[V]:fe}}catch{}}async function N(V){try{const fe=await dt().listSkillsForWorkspace(V);d.value={...d.value,[V]:fe}}catch{}}async function x(){try{const V=dt();a.value=await V.listModels();const J=p(g());J!==void 0&&(e.thinking=v(e.activeSessionId,J))}catch(V){n("loadModels",V)}}async function I(){try{const V=dt();f.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function E(V){const J=e.activeSessionId,fe=p(V),oe=e.thinking,ce=J?e.sessions.find(Te=>Te.id===J)?.model:void 0,ue=g()!==(fe?.id??V),Se=_re(fe,oe,ue);if(!J)return h.value=V,e.thinking=Se,Se!==oe&&Se!==void 0&&A(Se),!0;r(J,Te=>({...Te,model:V})),Se!==oe&&(e.thinking=Se,Se!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:Se}));try{await dt().updateSession(J,{model:V,thinking:Se!==oe?Se:void 0})}catch(Te){return r(J,Ae=>({...Ae,model:ce??Ae.model})),Se!==oe&&(e.thinking=oe,oe!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:oe})),n("setModel",Te,{sessionId:J}),!1}return Se!==oe&&Se!==void 0&&A(Se),await o(J),!0}function F(V){const J=new Set(c.value);J.has(V)?J.delete(V):J.add(V),c.value=Array.from(J),$me(c.value)}async function S(V,J,fe){const oe=fe??e.activeSessionId;if(!oe)return;const ce=i.value==="idle"&&!e.inFlightBySession[oe],ue=`msg_skill_opt_${Date.now().toString(36)}`,Se=ce?ey(oe):void 0;if(ce){e.inFlightBySession={...e.inFlightBySession,[oe]:!0};const Te={id:ue,sessionId:oe,role:"user",content:[{type:"text",text:`/${V}${J?` ${J}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:J}}};l(oe,Ae=>[...Ae,Te])}try{const Te=e.sessions.find(le=>le.id===oe)?.model,Ae=(Te&&Te.length>0?Te:e.defaultModel)??void 0;if(!await s({thinking:await y(oe,Ae)??e.thinking},oe))throw n4;await dt().activateSkill(oe,V,J)}catch(Te){ce&&(e.inFlightBySession={...e.inFlightBySession,[oe]:!1},l(oe,Ae=>Ae.filter(P=>P.id!==ue))),Te!==n4&&n("activateSkill",Te,{sessionId:oe})}finally{Se!==void 0&&ty(oe,Se)}}async function L(V){try{await dt().addProvider(V),await Promise.all([I(),x()])}catch(J){n("addProvider",J)}}async function R(V){try{await dt().deleteProvider(V),await Promise.all([I(),x()])}catch(J){n("deleteProvider",J)}}async function D(V){try{const J=await dt().refreshProvider(V);for(const fe of J.failed)n("refreshProvider",new Error(fe.reason),{message:fe.provider});await Promise.all([I(),x()])}catch(J){n("refreshProvider",J)}}async function z(){try{const V=await dt().refreshAllProviders();for(const J of V.failed)n("refreshAllProviders",new Error(J.reason),{message:J.provider});await Promise.all([I(),x()])}catch(V){n("refreshAllProviders",V)}}async function H(){try{return await dt().startOAuthLogin()}catch{return null}}async function U(){try{return await dt().pollOAuthLogin()}catch(V){return console.warn("[kimi-web] pollOAuthLogin failed",V),null}}async function Z(){try{await dt().cancelOAuthLogin()}catch{}}function K(V){const J=k(V);s({thinking:J}),J!==void 0&&A(J)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:$,loadSkillsForWorkspace:N,loadModels:x,loadProviders:I,setModel:E,thinkingLevelForModelId:b,thinkingLevelForSessionId:m,resolveThinkingForPrompt:y,toggleStarModel:F,activateSkill:S,addProvider:L,deleteProvider:R,refreshProvider:D,refreshAllProviders:z,startOAuthLogin:H,pollOAuthLogin:U,cancelOAuthLogin:Z,setThinking:K}}const V5="kimiWeb.compaction",Ome=/^read[_-]?media(?:file)?$/i,Rme=/^data:([^;]+);base64,(.*)$/s,Bme=/^<(image|video|audio)\s+path="([^"]+)">$/,Dme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Pme=/Mime type:\s*([^.\s]+)/i,Hme=/Size:\s*(\d+)\s*bytes/i,Wme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,zme="Image compressed to fit model limits:",Ume=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function qme(e){return e.includes(zme)?e.replace(Ume,""):e}function jme(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Vme(e){const t=Dme.exec(e.trim());return t?{kind:t[1],path:jme(t[2])}:null}const K5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Kme=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Gme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return K5.test(o)?o:void 0}const Yme=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Zme(e){const t=Yme.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Kme.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&K5.test(o)?o:void 0}}function Qme(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 Xme(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 Jme(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 e1e(e,t){if(!Ome.test(e))return;const n=Xme(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 h=d.text,p=Bme.exec(h);p&&(s=p[1],o=p[2]);const g=Pme.exec(h);g?.[1]&&(i=g[1]);const b=Hme.exec(h);b?.[1]&&(r=Number(b[1]));const v=Wme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Jme(d);f&&(a=f)}if(a===null)return;const c=Rme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Qme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function t1e(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 n1e(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,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,swarmIndex:e.swarmIndex}}function o1e(e,t){const n=e.split(` +`),o=t.split(` +`),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 s1e(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:o1e(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 i1e(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):r1e(e)}function r1e(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function l1e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function a1e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return i1e(t)}function c1e(e,t){const n=e.metadata?.origin??{},o=a1e(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 u1e(e,t,n){const{text:o,cron:s}=c1e(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function d1e(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 f1e(e){return e.metadata?.origin?.kind==="compaction_summary"}function h1e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function p1e(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 m1e(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 g1e(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 G5(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let g=0;gy.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(` +`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(` +`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=` +`+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=` +`+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=s1e(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:t1e(g.output),media:g.isError?void 0:e1e(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=p1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(f1e(h)){c();const m=h.metadata?.[V5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(` +`),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=l1e(h);if(c(),m!==void 0){i.push(u1e(h,r++,m));continue}if(!d1e(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],N=[];for(const x of h.content){if(x.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const E=Vme(x.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const L=Gme(E.path);if(L){N.push({url:n(L),kind:E.kind,fileId:L});continue}}const F=Zme(x.text);if(F){N.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=qme(x.text);if(S!==x.text&&S.trim().length===0)continue;$.push(S)}const I=f(x);if(I){N.push({url:I.url,kind:I.kind,name:x.type==="file"?x.name:void 0,fileId:I.fileId});continue}x.type==="file"&&n&&N.push({kind:"file",url:n(x.fileId),fileId:x.fileId,name:x.name,mediaType:x.mediaType||void 0,size:x.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(` +`),attachments:N.length>0?N:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;h1e(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=m1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>g1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function v1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=X({}),a=B(()=>{const E=e.activeSessionId;if(!E)return null;const F=l.value[E];return F?{parentId:E,agentId:F.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(F=>F.id===E.agentId&&F.status==="running"):!1}),h=B(()=>{const E=a.value;if(!E)return[];const F=e.sideChatMessagesByAgent[E.agentId]??[];return G5(F,[],S=>dt().getFileUrl(S),f.value)});function p(E,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:F(e.sideChatMessagesByAgent[E]??[])}}function g(E,F){p(E,S=>[...S,F])}function b(E){p(E,F=>{const S=[...F].reverse().findIndex(R=>R.role==="user");if(S===-1)return F;const L=F.length-1-S;return F.filter((R,D)=>D!==L)})}function v(E,F){p(E,S=>{const L=[...S];for(let R=L.length-1;R>=0;R-=1){const D=L[R];if(D.role==="user")return L[R]={...D,promptId:D.promptId??F},L}return S})}function m(E,F,S){S&&p(E,L=>{const R=L.at(-1);if(R?.role==="assistant"){const D=R.content[0],z=D?.type==="text"?D.text:"";return[...L.slice(0,-1),{...R,content:[{type:"text",text:`${z}${S}`}]}]}return[...L,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function y(E,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!S)return;const R=(e.sideChatMessagesByAgent[E]??[]).at(-1);(R?.role==="assistant"&&R.content[0]?.type==="text"?R.content[0].text:"").trim().length>0||m(E,F,S)}async function k(E){const F=e.activeSessionId;F&&await A(F,E)}async function A(E,F){if(!l.value[E]){let S;try{({agentId:S}=await dt().startBtw(E))}catch(L){n("openSideChat",L,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[E]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await $(E,F.trim())}async function $(E,F){const S=l.value[E],L=F.trim();if(!S||!L)return;const R=E,D=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!0};const z={id:o(),sessionId:R,role:"user",content:[{type:"text",text:L}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(D,z);try{const H=e.sessions.find(K=>K.id===R),U=(H?.model&&H.model.length>0?H.model:e.defaultModel)??void 0,Z=await dt().submitPrompt(R,{content:[{type:"text",text:L}],agentId:D,model:U,thinking:await r(R,U)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[R]??!1,swarmMode:e.swarmModeBySession[R]??!1});v(D,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[R]:[...e.sideChatUserMessageIdsBySession[R]??[],Z.userMessageId]}}catch(H){n("sendSideChatPrompt",H,{sessionId:R}),b(D),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!1}}}function N(){const E=e.activeSessionId;if(!E)return;const{[E]:F,...S}=l.value;l.value=S}async function x(E){const F=a.value;F&&await $(F.parentId,E)}function I(E){if(!l.value[E])return;const{[E]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:m,finishSideChatAgent:y,openSideChat:k,openSideChatOn:A,closeSideChat:N,sendSideChatPrompt:x,clearSideChatForSession:I}}const y1e="kimiWeb.optimisticUserMessage",o4="Sub Agent";function k1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function b1e(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 x1e(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 wg(e){return e.role==="user"&&e.metadata?.[y1e]===!0}function w1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function _1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const S1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function s4(e){let t="",n=0;for(const o of e.content)o.type==="text"?S1e.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 C1e(e,t){const n=s4(e),o=s4(t);return n.text===o.text&&n.media===o.media}function A1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&_1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&C1e(s,t))return o}return-1}function M1e(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}const E1e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function T1e(e){const t=_n.global.t,n=[],o=(r,l)=>{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?E1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function N1e(e,t,n){const o=b1e(e);switch(x1e(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"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"},[V5]: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)){if(t.message.role==="user"&&!w1e(t.message)){const a=A1e(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=>r.id!==t.messageId?r:{...r,content:t.content,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;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=M1e(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];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===o4&&a.description!==o4?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,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=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.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,T1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${_n.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function I1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function L1e(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"||Da(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:I1e(a.status)}]:[]})}}return[]}const $1e=["queued","working","suspended","completed","failed"];function Y5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function F1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function O1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:Y5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=F1e();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)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function R1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of $1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function B1e(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,phase:Y5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Cr=z5(),Ji=nme(),Hd=ume(),Z5=Ft.permission,Q5=Ft.activeWorkspace,X5=Ft.planMode,J5=Ft.swarmMode,e8=Ft.goalMode,i4=40401,t8=Ft.onboarded;Na(Ft.codeFont);Na(Ft.theme);Na(Ft.thinking);function D1e(){try{const e=mo(Z5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function P1e(e){try{So(Z5,e)}catch{}}function _g(e){const t=mo(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 i2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);So(e,JSON.stringify(n))}catch{}}function n8(){i2(X5,ye.planModeBySession)}function o8(){i2(J5,ye.swarmModeBySession)}function s8(){i2(e8,ye.goalModeBySession)}function H1e(){try{return mo(Q5)}catch{return null}}const i8=Ft.hiddenWorkspaces;function W1e(){try{const e=mo(i8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function z1e(e){try{So(i8,JSON.stringify(e))}catch{}}function U1e(e){try{So(Q5,e)}catch{}}function q1e(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 ye=Bo({...k1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:D1e(),thinking:void 0,thinkingBySession:{},planModeBySession:_g(X5),swarmModeBySession:_g(J5),goalModeBySession:_g(e8),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Dy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:H1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:W1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Zm=Bo({planMode:!1,swarmMode:!1,goalMode:!1});function r8(e){ye.sessions=e}function Qm(e,t){ye.sessions=ye.sessions.map(n=>n.id===e?t(n):n)}function j1e(e){ye.sessions=[e,...ye.sessions.filter(t=>t.id!==e.id)]}function V1e(e){ye.sessions=[...ye.sessions,e]}function K1e(e){ye.sessions=ye.sessions.filter(t=>t.id!==e)}function l8(){const e=ye.activeSessionId;e&&ye.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!1},Py({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ft.unread&&(ye.unreadBySession=Dy(),l8())});function ny(){if(xi===null||!xi.health().stale)return;ko("ws:stale-reconnect",{sessionId:ye.activeSessionId,status:"stale"}),Er("ws: stale socket on focus, reconnecting",{activeSessionId:ye.activeSessionId}),xi.reconnect();const e=ye.activeSessionId;e&&Vp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(l8(),ny())});typeof window<"u"&&(window.addEventListener("focus",ny),window.addEventListener("online",ny));function r2(e){ye.activeSessionId=e}function G1e(e){ye.messagesBySession=e}function Y1e(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t}}function a8(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t(ye.messagesBySession[e]??[])}}function Z1e(e){const{[e]:t,...n}=ye.messagesBySession;ye.messagesBySession=n}function c8(e){xi?.unsubscribe(e),b0e(e),qp.discard(({meta:t})=>t.sessionId===e),K1e(e),Z1e(e),delete ye.approvalsBySession[e],delete ye.questionsBySession[e],delete ye.tasksBySession[e],delete ye.goalBySession[e],delete ye.gitStatusBySession[e],delete ye.lastSeqBySession[e],delete ye.compactionBySession[e],delete ye.messagesLoadingMoreBySession[e],delete ye.messagesHasMoreBySession[e],delete ye.messagesLoadMoreErrorBySession[e],delete oy[e],jp.delete(e),Bh.delete(e),x8.delete(e),Eme(e),delete ye.queuedBySession[e],delete ye.promptIdBySession[e],delete ye.inFlightBySession[e],delete ye.turnActiveBySession[e],delete ye.planModeBySession[e],delete ye.swarmModeBySession[e],delete ye.goalModeBySession[e],delete ye.thinkingBySession[e],n8(),o8(),s8()}const u8=X(null),d8=X([]),f8=X(!1),h8=X(!1),p8=X(null);async function of(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Qm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),ye.swarmModeBySession={...ye.swarmModeBySession,[e]:t.swarmMode},ye.planModeBySession={...ye.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(ye.thinkingBySession={...ye.thinkingBySession,[e]:t.thinkingEffort})}async function Q1e(e){const t=ye.goalVersionBySession[e]??0;let n;try{n=await dt().getSessionGoal(e)}catch{return}if((ye.goalVersionBySession[e]??0)!==t)return;const o={...ye.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,ye.goalBySession=o}function m8(e,t){const n=t??ye.activeSessionId;return n?Promise.resolve(dt().updateSession(n,e)).then(()=>of(n)).then(()=>!0).catch(o=>(sf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const g8=Ft.conversationToc;function X1e(){try{const e=mo(g8);return e===null?!0:e==="true"}catch{return!0}}function J1e(e){try{So(g8,e?"true":"false")}catch{}}const v8=X(X1e());function e0e(e){v8.value=e,J1e(e)}function t0e(e){try{return mo(e)??""}catch{return""}}const y8=X(t0e(t8)==="1");function n0e(e){y8.value=e;try{So(t8,e?"1":"0")}catch{}}let xi=null,r4=0;function k8(){return r4+=1,`msg_opt_${Date.now().toString(36)}_${r4}`}function o0e(e,t,n){const o={sessions:ye.sessions,activeSessionId:ye.activeSessionId,messagesBySession:ye.messagesBySession,approvalsBySession:ye.approvalsBySession,planReviewByToolCallId:ye.planReviewByToolCallId,questionsBySession:ye.questionsBySession,tasksBySession:ye.tasksBySession,goalBySession:ye.goalBySession,goalVersionBySession:ye.goalVersionBySession,lastSeqBySession:ye.lastSeqBySession,turnActiveBySession:ye.turnActiveBySession,compactionBySession:ye.compactionBySession,config:ye.config,warnings:ye.warnings},s=N1e(o,e,{sessionId:t,seq:n});r8(s.sessions),r2(s.activeSessionId),G1e(s.messagesBySession),ye.approvalsBySession=s.approvalsBySession,ye.planReviewByToolCallId=s.planReviewByToolCallId,ye.questionsBySession=s.questionsBySession,ye.tasksBySession=s.tasksBySession,ye.goalBySession=s.goalBySession,ye.goalVersionBySession=s.goalVersionBySession,ye.lastSeqBySession=s.lastSeqBySession,ye.turnActiveBySession=s.turnActiveBySession,ye.compactionBySession=s.compactionBySession,ye.config=s.config??null,ye.warnings=s.warnings,e.type==="configChanged"&&(ye.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(In.loadModels(),In.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(ye.swarmModeBySession={...ye.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(ye.planModeBySession={...ye.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(ye.thinkingBySession={...ye.thinkingBySession,[e.sessionId]:e.thinking}))}function s0e(e,t){const n=ye.lastSeqBySession[t.sessionId]??0,o=ye.turnActiveBySession[t.sessionId]??!1;o0e(e,t.sessionId,t.seq);const s=fs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&fs.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?fs.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?fs.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&fs.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;ye.promptIdBySession[i]!==e.message.promptId&&(ye.promptIdBySession={...ye.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===ye.activeSessionId&&Cr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;Age(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&&Cge(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&ye.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&Mge(e.sessionId,e.question),e.type==="approvalRequested"&&Ege(e.sessionId,e.approval)}const qp=Spe(({appEvent:e,meta:t})=>s0e(e,t),({appEvent:e})=>bpe(e),{coalesce:Ape});function b8(){if(xi!==null||typeof WebSocket>"u")return;ko("ws:connection",{status:"connecting"}),ye.connection="connecting",xi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of Cpe({appEvent:t,meta:n}))qp(o)},onResync(t,n,o){ko("ws:resync",{sessionId:t,status:"required",seq:n}),qp.flush(),jp.add(t),Vp.request(t)},onError(t,n,o){ko("ws:error",{status:"failed",errorCode:t,fatal:o}),l2({severity:"error",title:_n.global.t("warnings.wsTitle"),message:n,details:[Qn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){ko("ws:connection",{status:t?"connected":"disconnected"}),ye.connected=t,ye.connection=t?"connected":"disconnected",t&&(f0e(),ut.refreshServerMeta())}})}const oy={},jp=new Set,Bh=new Set,x8=new Set;function i0e(e){return vi(e)&&e.code===i4?!0:typeof e=="object"&&e!==null&&e.code===i4}function Qn(e,t){if(!(t==null||t===""))return{label:_n.global.t(`warnings.details.${e}`),value:w8(t)}}function w8(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 r0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function l0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function a0e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function c0e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function l4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function u0e(e,t,n){const o=$k(t),s=vi(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Qn("operation",e),Qn("sessionId",n??ye.activeSessionId),Qn("connection",ye.connection),Qn("timestamp",c0e(i??Date.now()))];return o?l.push(Qn("duration",l4(r)),Qn("request",`${t.method} ${t.path}`),Qn("endpoint",t.url),Qn("requestId",t.requestId),Qn("phase",t.phase),Qn("timeout",`${t.timeoutMs}ms`),Qn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Qn("contentType",t.contentType),Qn("responsePreview",t.bodyPreview),Qn("cause",t.cause)):s?l.push(Qn("duration",l4(r)),Qn("code",t.code),Qn("requestId",t.requestId),Qn("message",t.message),Qn("details",t.details)):l.push(Qn("errorName",r0e(t)),Qn("message",l0e(t)??w8(t)),Qn("stack",a0e(t))),l.filter(a=>a!==void 0)}function d0e(e,t,n={}){const o=$k(t),s=vi(t),i=n.title??(o?_n.global.t("warnings.daemonNetworkTitle"):s?_n.global.t("warnings.daemonApiTitle"):_n.global.t("warnings.operationFailedTitle")),r=n.message??(o?_n.global.t("warnings.daemonNetworkMessage"):s?t.message:_n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:u0e(e,t,n.sessionId)}}function l2(e){ye.warnings=[...ye.warnings,e]}function f0e(){const e=_n.global.t("warnings.wsTitle"),t=ye.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==ye.warnings.length&&(ye.warnings=t)}function sf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=vi(t),s=$k(t);ko("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}),l2(d0e(e,t,n))}const h0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function p0e(e){if(!vi(e))return;const t=h0e[e.code];return t?_n.global.t(t):void 0}async function m0e(e){if(c8(e),ye.activeSessionId!==e)return;const t=ye.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(r2(void 0),ye.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const a4=new Set;async function g0e(e){if(!a4.has(e)){a4.add(e);try{const t=await dt().getSessionWarnings(e),n=_n.global.t("warnings.noteLabel");for(const o of t)l2(`${n}: ${o.message}`)}catch{}}}async function a2(e){const t=ut.localTurnStartState(e);try{const o=await dt().getSessionSnapshot(e);if(!ye.sessions.some(a=>a.id===e))return"ok";qp.flush();const s=ye.lastSeqBySession[e]??0,i=oy[e];if(!(jp.has(e)||Kp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Bh.delete(e)||(Bh.add(e),Vp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Vp.request(e)}),"ok";const l=Hv(o.session.usage);Qm(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})),Y1e(e,gpe(ye.messagesBySession[e]??[],o.messages)),ye.tasksBySession={...ye.tasksBySession,[e]:vpe(o.subagents,ye.tasksBySession[e]??[])},ye.messagesHasMoreBySession={...ye.messagesHasMoreBySession,[e]:o.hasMoreMessages},ye.approvalsBySession={...ye.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&&(ye.planReviewByToolCallId={...ye.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}ye.questionsBySession={...ye.questionsBySession,[e]:o.pendingQuestions},ye.lastSeqBySession={...ye.lastSeqBySession,[e]:o.asOfSeq},oy[e]=o.epoch,jp.delete(e),Bh.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...ye.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],ye.turnActiveBySession=a}return b8(),xi&&(xi.seedSnapshot(e,o),xi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),k0e(e)),Kp.delete(e),l&&of(e),g0e(e),"ok"}catch(n){return i0e(n)?(await m0e(e),"not-found"):(sf("getSessionSnapshot",n,{title:_n.global.t("warnings.sessionSnapshotTitle"),message:_n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Vp=ype(a2);function v0e(e){return Object.prototype.hasOwnProperty.call(ye.messagesBySession,e)}const y0e=4,Ar=[],Kp=new Set;function k0e(e){const t=Ar.indexOf(e);for(t!==-1&&Ar.splice(t,1),Ar.unshift(e);Ar.length>y0e;){let n=-1;for(let s=Ar.length-1;s>=0;s--)if(Ar[s]!==ye.activeSessionId){n=s;break}if(n===-1)break;const[o]=Ar.splice(n,1);if(o===void 0)break;xi?.unsubscribe(o),Kp.add(o)}}function b0e(e){const t=Ar.indexOf(e);t!==-1&&Ar.splice(t,1),Kp.delete(e)}async function x0e(e){return a2(e)}function c2(e,t){return(ye.inFlightBySession[e]??!1)||(ye.turnActiveBySession[e]??!1)||(t??ye.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function u2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return _n.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 w0e=3e4,Wd=X(0);let Sg=null;function _0e(){Sg===null&&(Sg=setInterval(()=>{Wd.value=(Wd.value+1)%Number.MAX_SAFE_INTEGER},w0e),Sg.unref?.())}function S0e(e,t){const n=e.split(` +`),o=t.split(` +`),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 C0e(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:S0e(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 A0e(e){return{questionId:e.questionId,sessionId:e.sessionId,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 M0e(e){const t=ye.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 E0e(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=_n.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=_n.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??M0e(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const T0e=B(()=>{const e=ye.sessions.find(n=>n.id===ye.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:ye.workspaceName,branch:t}}),N0e=B(()=>(Wd.value,ye.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:u2(e.updatedAt),busy:c2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),I0e=B(()=>ye.activeSessionId??""),L0e=B(()=>{const e=ye.activeSessionId;if(e)return In.skillsBySession.value[e]??[];const t=Jm.value;return t?In.skillsByWorkspace.value[t]??[]:[]}),d2=B(()=>{const e=ye.activeSessionId;return e?ye.inFlightBySession[e]??!1:!1}),$0e=B(()=>ut.isStartingFirstPrompt()),fs=v1e(ye,{pushOperationFailure:sf,nextOptimisticMsgId:k8,connectEventsIfNeeded:b8,getEventConn:()=>xi,resolveThinkingForPrompt:(e,t)=>In.resolveThinkingForPrompt(e,t)}),rf=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=fs.sideChatTargetBySession.value[e]?.agentId;return(ye.tasksBySession[e]??[]).filter(n=>n.id!==t)}),_8=hme(ye,rf),F0e=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=new Set(ye.sideChatUserMessageIdsBySession[e]??[]),n=(ye.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=ye.approvalsBySession[e]??[];return G5(n,o,s=>dt().getFileUrl(s),Xm.value,ye.planReviewByToolCallId)}),Xm=B(()=>{const e=ye.activeSessionId;return e?(ye.turnActiveBySession[e]??!1)||(ye.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),O0e=B(()=>d2.value||Xm.value),R0e=B(()=>(_8.taskClock.value,rf.value.map(E0e))),S8=B(()=>O1e(rf.value)),B0e=B(()=>B1e(rf.value)),bc=B(()=>{const e=ye.activeSessionId;return e?ye.goalBySession[e]??null:null}),D0e=B(()=>{const e=ye.activeSessionId;return e?L1e(ye.messagesBySession[e]??[]):[]}),P0e=B(()=>{const e=ye.activeSessionId;return e?ye.compactionBySession[e]??null:null}),H0e=B(()=>ye.connection),W0e=B(()=>ye.loading),z0e=B(()=>ye.sessionLoading),U0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadingMoreBySession[e]??!1:!1}),q0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesHasMoreBySession[e]??!1:!1}),j0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadMoreErrorBySession[e]??!1:!1}),V0e=B(()=>ye.serverVersion),K0e=B(()=>ye.backend),G0e=B(()=>ye.dangerousBypassAuth);function Y0e(){ye.dangerousBypassAuth=!1}const Z0e=B(()=>ye.permission),Q0e=B(()=>ye.thinking),C8=B(()=>{const e=ye.activeSessionId;return e?ye.planModeBySession[e]??!1:Zm.planMode}),X0e=B(()=>{const e=ye.activeSessionId;return e?ye.swarmModeBySession[e]??!1:Zm.swarmMode}),J0e=B(()=>{const e=ye.activeSessionId;return e?ye.goalModeBySession[e]??!1:Zm.goalMode}),ege=B(()=>{const e=R1e(S8.value);return{plan:C8.value,goal:bc.value&&bc.value.status!=="complete"?{status:bc.value.status,turnsUsed:bc.value.turnsUsed,elapsedMs:bc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),tge=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=dt();return(ye.queuedBySession[e]??[]).map(n=>({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}))}))}),nge=B(()=>ye.warnings),oge=B(()=>{const e=ye.activeSessionId;return e?(ye.questionsBySession[e]??[]).map(A0e):[]}),sge=B(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:C0e(t),agentName:t.agentName})):[]}),f2=B(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).length>0?"awaiting-approval":(ye.questionsBySession[e]??[]).length>0?"awaiting-question":d2.value||Xm.value?"running":"idle":"idle"}),In=Fme(ye,{pushOperationFailure:sf,refreshSessionStatus:of,persistSessionProfile:m8,activity:f2,updateSession:Qm,updateSessionMessages:a8}),sy=B(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),ige=B(()=>{const e=ye.activeSessionId;return e?ye.gitStatusBySession[e]?.pullRequest??null:null}),rge=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=ye.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),lge=B(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),A8=B(()=>{const e=ye.sessions.find(r=>r.id===ye.activeSessionId),t=sy.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?In.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??ye.defaultModel)??"—",s=In.models.value.find(r=>r.id===o)??In.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:ye.permission,branch:t,cwd:e?.cwd??"",isGitRepo:sy.value!==null}}),age=B(()=>d8.value),cge=B(()=>ye.sessions.find(t=>t.id===ye.activeSessionId)?.usage.totalCostUsd??0),uge=B(()=>ye.authReady),dge=B(()=>ye.defaultModel),fge=B(()=>ye.managedProviderStatus),hge=B(()=>ye.config),pge=B(()=>{const e=ye.activeSessionId;if(!e)return{};const t=ye.gitStatusBySession[e];return t?{...t.entries}:{}});function tu(e){const t=Fi(e.cwd);return ye.workspaces.find(n=>Fi(n.root)===t)?.id??e.workspaceId??e.cwd}const h2=B(()=>mpe({workspaces:ye.workspaces,sessions:ye.sessions,hiddenWorkspaceRoots:ye.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:ye.sessionsHasMoreByWorkspace})),Gp=X(yI()),nu=X(kI()==="manual"?"manual":"recent");Qe(()=>[h2.value.map(e=>e.id).join("\0"),ye.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=FI(n,Gp.value);o!==null&&(Gp.value=o,kA(o))});const Oa=B(()=>{const e=h2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:q1e(t.root,ye.fsHome),sessionCount:t.sessionCount}));if(nu.value==="recent"){const t=new Map;for(const n of ye.sessions){if(n.parentSessionId)continue;const o=tu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return BI(e,t)}return OI(e,Gp.value)}),Jm=B(()=>{const e=ye.activeWorkspaceId,t=Oa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(Jm,e=>{e&&(Object.prototype.hasOwnProperty.call(In.skillsByWorkspace.value,e)||In.loadSkillsForWorkspace(e))},{immediate:!0});const mge=B(()=>{const e=Jm.value;return e?Oa.value.find(t=>t.id===e)??null:null}),gge=B(()=>{Wd.value;const e=new Set(Oa.value.map(n=>n.id)),t=new Map(Oa.value.map(n=>[n.id,n.name]));return ye.sessions.filter(n=>!n.parentSessionId&&e.has(tu(n))).map(n=>{const o=tu(n);return{id:n.id,title:n.title,time:u2(n.updatedAt),busy:c2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),vge=B(()=>{Wd.value;const e=new Map;for(const t of ye.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=tu(t),o={id:t.id,title:t.title,time:u2(t.updatedAt),busy:c2(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 Oa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:ye.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:ye.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:ye.sessionsInitialCountByWorkspace[t.id]??Jv}))});function yge(e){Gp.value=e,kA(e),nu.value!=="manual"&&(nu.value="manual",bA("manual"))}function kge(e){nu.value!==e&&(nu.value=e,bA(e))}const M8=B(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),bge=B(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),xge=B(()=>{const e={};for(const[t,n]of Object.entries(ye.unreadBySession))n&&(e[t]=!0);return e}),wge=B(()=>{const e={},t=M8.value;for(const n of ye.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=tu(n);e[s]=(e[s]??0)+o}return e}),_ge=B(()=>ye.recentRoots),Sge=B(()=>ye.availableOpenInApps),ut=Ime(ye,{taskPoller:_8,sideChat:fs,modelProvider:In,pushOperationFailure:sf,activity:f2,sessionsKnownEmpty:x8,setSessions:r8,updateSession:Qm,upsertSessionFront:j1e,appendSession:V1e,forgetSession:c8,setActiveSessionId:r2,updateSessionMessages:a8,nextOptimisticMsgId:k8,getEventConn:()=>xi,syncSessionFromSnapshot:a2,reopenSession:x0e,hasLoadedMessages:v0e,refreshSessionStatus:of,refreshSessionGoal:Q1e,persistSessionProfile:m8,mergedWorkspaces:h2,workspacesView:Oa,status:A8,workspaceIdForSession:tu,savePermissionToStorage:P1e,savePlanModeToStorage:n8,saveSwarmModeToStorage:o8,saveGoalModeToStorage:s8,draftModes:Zm,saveUnread:Py,saveActiveWorkspaceToStorage:U1e,saveHiddenWorkspacesToStorage:z1e,goalErrorMessage:p0e,resetFastMoon:Cr.resetFastMoon,initialized:h8,connectIssue:p8,selectedDiffPath:u8,fileDiffLines:d8,fileDiffLoading:f8});function p2(e){return e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function Cge(e){if(ye.turnActiveBySession[e]){const t={...ye.turnActiveBySession};delete t[e],ye.turnActiveBySession=t}ye.inFlightBySession[e]&&(ye.inFlightBySession={...ye.inFlightBySession,[e]:!1})}function Age(e,t,n){const o=ye.promptIdBySession[e];ut.finishPromptLocal(e,{turnWasActive:n}),e===ye.activeSessionId?(ut.loadGitStatus(e),of(e)):t==="idle"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!0},Py({[e]:!0}));const s=(ye.approvalsBySession[e]??[]).length>0,i=(ye.questionsBySession[e]??[]).length>0;jpe(t,s,i)&&Ji.maybeNotifyCompletion(e,{isUserWatching:p2(e),sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Hd.maybePlayCompletionSound()}function Mge(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Ji.maybeNotifyQuestion({isUserWatching:p2(e),sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayQuestionSound()}function Ege(e,t){Ji.maybeNotifyApproval({isUserWatching:p2(e),sessionTitle:ye.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayApprovalSound()}function m2(){return _0e(),{workspace:T0e,sessions:N0e,activeSessionId:I0e,workspacesView:Oa,workspaceSortMode:nu,visibleWorkspace:mge,activeWorkspaceId:Jm,sessionsForView:gge,workspaceGroups:vge,attentionBySession:M8,pendingBySession:bge,attentionByWorkspace:wge,unreadBySession:xge,recentRoots:_ge,turns:F0e,tasks:R0e,activeAppTasks:rf,todos:D0e,goal:bc,swarms:S8,swarmMembersByToolCallId:B0e,activationBadges:ege,compaction:P0e,status:A8,sessionCost:cge,fileDiff:age,selectedDiffPath:u8,fileDiffLoading:f8,changes:rge,gitInfo:sy,gitDiffStats:lge,activePullRequest:ige,changesByPath:pge,pendingApprovals:sge,availableOpenInApps:Sge,connection:H0e,loading:W0e,sessionLoading:z0e,loadingMoreMessages:U0e,hasMoreMessages:q0e,loadMoreMessagesError:j0e,serverVersion:V0e,backend:K0e,dangerousBypassAuth:G0e,clearDangerousBypassAuth:Y0e,initialized:h8,connectIssue:p8,permission:Z0e,thinking:Q0e,planMode:C8,swarmMode:X0e,goalMode:J0e,queued:tge,warnings:nge,questions:oge,activity:f2,turnActive:Xm,inFlight:d2,working:O0e,isStartingFirstPrompt:$0e,fastMoon:Cr.fastMoon,models:In.models,starredModelIds:In.starredModelIds,providers:In.providers,uiFontSize:Cr.uiFontSize,setUiFontSize:Cr.setUiFontSize,conversationToc:v8,setConversationToc:e0e,colorScheme:Cr.colorScheme,setColorScheme:Cr.setColorScheme,accent:Cr.accent,setAccent:Cr.setAccent,notifyOnComplete:Ji.notifyOnComplete,notifyOnQuestion:Ji.notifyOnQuestion,notifyOnApproval:Ji.notifyOnApproval,notifyPermission:Ji.notifyPermission,setNotifyOnComplete:Ji.setNotifyOnComplete,setNotifyOnQuestion:Ji.setNotifyOnQuestion,setNotifyOnApproval:Ji.setNotifyOnApproval,soundOnComplete:Hd.soundOnComplete,setSoundOnComplete:Hd.setSoundOnComplete,onboarded:y8,setOnboarded:n0e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:fs.sideChatVisible,sideChatSessionId:fs.sideChatSessionId,sideChatTurns:fs.sideChatTurns,sideChatRunning:fs.sideChatRunning,sideChatSending:fs.sideChatSending,openSideChat:fs.openSideChat,closeSideChat:fs.closeSideChat,sendSideChatPrompt:fs.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:In.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:yge,setWorkspaceSortMode:kge,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,loadModels:In.loadModels,loadProviders:In.loadProviders,skills:L0e,activateSkill:In.activateSkill,setModel:In.setModel,toggleStarModel:In.toggleStarModel,addProvider:In.addProvider,deleteProvider:In.deleteProvider,refreshProvider:In.refreshProvider,refreshAllProviders:In.refreshAllProviders,authReady:uge,defaultModel:dge,managedProviderStatus:fge,config:hge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:In.startOAuthLogin,pollOAuthLogin:In.pollOAuthLogin,cancelOAuthLogin:In.cancelOAuthLogin,logout:ut.logout}}const E8=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=_A.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&SA(s)}return(s,i)=>(w(),xe(gs,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),Tge=["aria-checked","aria-label","disabled"],Nge=Ze({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("button",{class:We(["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,Tge))}}),yr=ct(Nge,[["__scopeId","data-v-dbe22dc4"]]),Ige=["aria-label"],Lge=["aria-selected","onClick"],$ge={class:"body"},Fge={class:"panel"},Oge={class:"sec"},Rge={class:"sec-title"},Bge={class:"row"},Dge={class:"rlabel"},Pge={class:"row"},Hge={class:"rlabel"},Wge={class:"row"},zge={class:"rlabel"},Uge={class:"num-field"},qge=["value","aria-label"],jge={class:"row"},Vge={class:"rlabel"},Kge={class:"row"},Gge={class:"rlabel"},Yge={class:"hint"},Zge={class:"sec"},Qge={class:"sec-title"},Xge={class:"row"},Jge={class:"rlabel"},eve={key:0,class:"hint"},tve={class:"row"},nve={class:"rlabel"},ove={key:0,class:"hint"},sve={class:"row"},ive={class:"rlabel"},rve={key:0,class:"hint"},lve={class:"row"},ave={class:"rlabel"},cve={class:"panel"},uve={class:"sec"},dve={class:"sec-title"},fve={class:"row"},hve={class:"rlabel"},pve={key:0,class:"rvalue"},mve={class:"actions"},gve={class:"panel"},vve={class:"sec"},yve={class:"sec-head"},kve={class:"sec-title"},bve={key:0,class:"saving"},xve={class:"row"},wve={class:"rlabel"},_ve={class:"hint"},Sve={key:0,class:"select-wrap"},Cve={key:0,value:"",disabled:""},Ave=["label"],Mve=["value"],Eve={key:1,class:"rvalue mono"},Tve={class:"row"},Nve={class:"rlabel"},Ive={class:"hint"},Lve={class:"row"},$ve={class:"rlabel"},Fve={class:"hint"},Ove={class:"row"},Rve={class:"rlabel"},Bve={class:"hint"},Dve={class:"row"},Pve={class:"rlabel"},Hve={class:"hint"},Wve={key:1,class:"empty-config"},zve={class:"panel"},Uve={class:"sec"},qve={class:"sec-title"},jve={class:"row"},Vve={class:"rlabel"},Kve={class:"rvalue mono"},Gve={class:"row"},Yve={class:"rlabel"},Zve={class:"rvalue mono"},Qve={class:"row"},Xve={class:"rlabel"},Jve={class:"rvalue mono"},eye={key:0,class:"row"},tye={class:"rlabel"},nye={class:"hint"},oye={class:"hint"},sye={class:"row"},iye={class:"rlabel"},rye={key:0,class:"hint"},lye={class:"panel"},aye={class:"panel-head"},cye={class:"panel-title"},uye={class:"panel-desc"},dye={class:"archive-toolbar"},fye={class:"archive-search"},hye=["placeholder"],pye={value:"all"},mye=["value"],gye={key:0,class:"archive-empty"},vye={key:0,class:"archive-list"},yye={class:"archive-workspace"},kye={class:"path"},bye={class:"count"},xye={class:"setting-card"},wye={class:"archive-meta"},_ye={class:"archive-name"},Sye={class:"archive-time"},Cye={key:1,class:"archive-empty"},Aye=100,Mye=Ze({__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:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=AI(),a=B(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=X(null);jk(d);function f(oe){oe.key==="Escape"&&s("close")}cn(()=>document.addEventListener("keydown",f)),bn(()=>document.removeEventListener("keydown",f));function h(){h5()}const p=B(()=>{const oe=new Map;for(const ce of o.models??[])oe.set(ce.id,{id:ce.id,label:ce.displayName??ce.model??ce.id,provider:ce.provider});for(const[ce,ue]of Object.entries(o.config?.models??{})){if(oe.has(ce))continue;const Se=v(ue);oe.set(ce,{id:ce,label:m(ce,ue,Se),provider:Se??ce})}return Array.from(oe.values())}),g=B(()=>{const oe=new Map;for(const ce of p.value){const ue=oe.get(ce.provider)??[];ue.push(ce),oe.set(ce.provider,ue)}for(const ce of oe.values())ce.sort((ue,Se)=>ue.label.localeCompare(Se.label));return Array.from(oe.entries()).toSorted(([ce],[ue])=>ce.localeCompare(ue)).map(([ce,ue])=>({provider:ce,options:ue}))}),b=B(()=>{const oe=o.config?.defaultPermissionMode;return oe==="auto"||oe==="yolo"||oe==="manual"?oe:"manual"});function v(oe){if(!oe||typeof oe!="object")return;const ce=oe;return typeof ce.provider=="string"?ce.provider:void 0}function m(oe,ce,ue){if(!ce||typeof ce!="object")return oe;const Se=ce,Te=typeof Se.model=="string"?Se.model:void 0,Ae=ue??v(ce);return Te&&Ae?`${oe} (${Ae}/${Te})`:Te?`${oe} (${Te})`:oe}function y(oe){return oe===!0}function k(oe){!oe||oe===o.config?.defaultModel||s("updateConfig",{defaultModel:oe})}function A(oe){oe!==b.value&&s("updateConfig",{defaultPermissionMode:oe})}function $(oe){const ce=o.config?.[oe];s("updateConfig",{[oe]:!y(ce)})}function N(){const oe=o.config?.thinking;return!oe||typeof oe!="object"?!0:oe.enabled!==!1}function x(){s("updateConfig",{thinking:{enabled:!N()}})}function I(){const oe=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!oe})}function E(oe){i.value=oe}const F=m2(),S=X([]),L=X(!1),R=X(!1),D=X(""),z=X("all"),H=X("archived-desc");async function U(){if(!(L.value||R.value)){L.value=!0;try{const oe=[];let ce;for(;;){const ue=await F.loadArchivedSessions({beforeId:ce,pageSize:Aye});if(oe.push(...ue.items),!ue.hasMore||ue.items.length===0)break;const Se=ue.items.at(-1)?.id;if(Se===void 0)break;ce=Se}S.value=oe,R.value=!0}catch(oe){console.warn("loadAllArchived failed",oe)}finally{L.value=!1}}}Qe(i,oe=>{oe==="archived"&&!R.value&&U()});const Z=B(()=>{const oe=new Set;for(const ce of S.value)oe.add(ce.cwd);return Array.from(oe).sort((ce,ue)=>ce.localeCompare(ue))}),K=B(()=>{const oe=D.value.trim().toLowerCase();let ce=S.value.filter(ue=>ue.archived===!0);return z.value!=="all"&&(ce=ce.filter(ue=>ue.cwd===z.value)),oe&&(ce=ce.filter(ue=>ue.title.toLowerCase().includes(oe))),ce=ce.slice(),H.value==="archived-desc"?ce.sort((ue,Se)=>Se.updatedAt.localeCompare(ue.updatedAt)):H.value==="created-desc"?ce.sort((ue,Se)=>Se.createdAt.localeCompare(ue.createdAt)):ce.sort((ue,Se)=>ue.title.localeCompare(Se.title,"zh")),ce}),V=B(()=>{const oe=new Map;for(const ce of K.value){const ue=oe.get(ce.cwd)??[];ue.push(ce),oe.set(ce.cwd,ue)}return Array.from(oe.entries()).map(([ce,ue])=>({cwd:ce,items:ue}))});async function J(oe){await F.restoreSession(oe)&&(S.value=S.value.filter(ue=>ue.id!==oe))}function fe(oe){const ce=new Date(oe);if(Number.isNaN(ce.getTime()))return oe;const ue=Se=>String(Se).padStart(2,"0");return`${ce.getFullYear()}-${ue(ce.getMonth()+1)}-${ue(ce.getDate())} ${ue(ce.getHours())}:${ue(ce.getMinutes())}`}return(oe,ce)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ce[19]||(ce[19]=ue=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),T(Pe,null,ot(r,ue=>_("button",{key:ue.id,type:"button",class:We(["tab",{on:i.value===ue.id}]),role:"tab","aria-selected":i.value===ue.id,onClick:Se=>E(ue.id)},O(C(n)(ue.labelKey)),11,Lge)),64))],8,Ige),_("div",$ge,[Fn(_("section",Fge,[_("section",Oge,[_("h3",Rge,O(C(n)("settings.appearance")),1),_("div",Bge,[_("span",Dge,O(C(n)("theme.colorSchemeLabel")),1),re(gs,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":ce[0]||(ce[0]=ue=>s("setColorScheme",ue))},null,8,["model-value","options"])]),_("div",Pge,[_("span",Hge,O(C(n)("theme.accentLabel")),1),re(gs,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ce[1]||(ce[1]=ue=>s("setAccent",ue))},null,8,["model-value","options"])]),_("div",Wge,[_("span",zge,O(C(n)("settings.uiFontSize")),1),_("label",Uge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ce[2]||(ce[2]=ue=>s("setUiFontSize",Number(ue.target.value)))},null,40,qge),ce[20]||(ce[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",jge,[_("span",Vge,O(C(n)("sidebar.language")),1),re(E8)]),_("div",Kge,[_("span",Gge,[Je(O(C(n)("settings.conversationToc"))+" ",1),_("span",Yge,O(C(n)("settings.conversationTocHint")),1)]),re(yr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ce[3]||(ce[3]=ue=>s("setConversationToc",ue))},null,8,["model-value","label"])])]),_("section",Zge,[_("h3",Qge,O(C(n)("settings.notifications")),1),_("div",Xge,[_("span",Jge,[Je(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",eve,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ce[4]||(ce[4]=ue=>s("setNotify",ue))},null,8,["model-value","disabled","label"])]),_("div",tve,[_("span",nve,[Je(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",ove,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ce[5]||(ce[5]=ue=>s("setNotifyQuestion",ue))},null,8,["model-value","disabled","label"])]),_("div",sve,[_("span",ive,[Je(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",rve,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ce[6]||(ce[6]=ue=>s("setNotifyApproval",ue))},null,8,["model-value","disabled","label"])]),_("div",lve,[_("span",ave,O(C(n)("settings.soundOnComplete")),1),re(yr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ce[7]||(ce[7]=ue=>s("setSound",ue))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),Fn(_("section",cve,[_("section",uve,[_("h3",dve,O(C(n)("settings.account")),1),_("div",fve,[_("span",hve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Xt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(w(),T("span",pve,O(e.accountModel),1)):ae("",!0)]),_:1},8,["text"])]),_("div",mve,[re(Bt,{variant:"secondary",size:"sm",onClick:ce[8]||(ce[8]=ue=>{s("openOnboarding"),s("close")})},{default:Ee(()=>[Je(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),xe(Bt,{key:0,variant:"danger-soft",size:"sm",onClick:ce[9]||(ce[9]=ue=>s("logout"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),xe(Bt,{key:1,variant:"primary",size:"sm",onClick:ce[10]||(ce[10]=ue=>s("login"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),Fn(_("section",gve,[_("section",vve,[_("div",yve,[_("h3",kve,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),T("span",bve,O(C(n)("settings.saving")),1)):ae("",!0)]),e.config?(w(),T(Pe,{key:0},[_("div",xve,[_("span",wve,[Je(O(C(n)("settings.defaultModel"))+" ",1),_("span",_ve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(w(),T("div",Sve,[re(Yv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?ae("",!0):(w(),T("option",Cve,O(C(n)("settings.noDefaultModel")),1)),(w(!0),T(Pe,null,ot(g.value,ue=>(w(),T("optgroup",{key:ue.provider,label:ue.provider},[(w(!0),T(Pe,null,ot(ue.options,Se=>(w(),T("option",{key:Se.id,value:Se.id},O(Se.label),9,Mve))),128))],8,Ave))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),T("span",Eve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",Tve,[_("span",Nve,[Je(O(C(n)("settings.defaultPermission"))+" ",1),_("span",Ive,O(C(n)("settings.defaultPermissionHint")),1)]),re(gs,{"model-value":b.value,options:c.map(ue=>({value:ue,label:C(n)(u[ue])})),"onUpdate:modelValue":ce[11]||(ce[11]=ue=>A(ue))},null,8,["model-value","options"])]),_("div",Lve,[_("span",$ve,[Je(O(C(n)("settings.defaultThinking"))+" ",1),_("span",Fve,O(C(n)("settings.defaultThinkingHint")),1)]),re(yr,{"model-value":N(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ce[12]||(ce[12]=ue=>x())},null,8,["model-value","disabled","label"])]),_("div",Ove,[_("span",Rve,[Je(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Bve,O(C(n)("settings.defaultPlanModeHint")),1)]),re(yr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ce[13]||(ce[13]=ue=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Dve,[_("span",Pve,[Je(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Hve,O(C(n)("settings.mergeSkillsHint")),1)]),re(yr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ce[14]||(ce[14]=ue=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),T("div",Wve,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),Fn(_("section",zve,[_("section",Uve,[_("h3",qve,O(C(n)("settings.advanced")),1),_("div",jve,[_("span",Vve,O(C(n)("sidebar.daemon")),1),_("span",Kve,O(C(l)),1)]),_("div",Gve,[_("span",Yve,O(C(n)("settings.backend")),1),_("span",Zve,O(a.value),1)]),_("div",Qve,[_("span",Xve,O(C(n)("settings.serverVersion")),1),_("span",Jve,O(e.serverVersion||"-"),1)]),e.config?(w(),T("div",eye,[_("span",tye,[Je(O(C(n)("settings.telemetry"))+" ",1),_("span",nye,O(C(n)("settings.telemetryHint")),1),_("span",oye,O(C(n)("settings.telemetryRestartHint")),1)]),re(yr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ce[15]||(ce[15]=ue=>I())},null,8,["model-value","disabled","label"])])):ae("",!0),_("div",sye,[_("span",iye,[Je(O(C(n)("settings.exportLog"))+" ",1),C(Hi)()?ae("",!0):(w(),T("span",rye,O(C(n)("settings.logHint")),1))]),re(Bt,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Je(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),Fn(_("section",lye,[_("div",aye,[ce[21]||(ce[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",cye,O(C(n)("settings.archivedTitle")),1),_("p",uye,O(C(n)("settings.archivedDesc")),1)]),_("div",dye,[_("label",fye,[ce[22]||(ce[22]=_("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)),Fn(_("input",{"onUpdate:modelValue":ce[16]||(ce[16]=ue=>D.value=ue),placeholder:C(n)("settings.archivedSearch")},null,8,hye),[[_s,D.value]])]),re(Yv,{"model-value":z.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ce[17]||(ce[17]=ue=>z.value=ue)},{default:Ee(()=>[_("option",pye,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),T(Pe,null,ot(Z.value,ue=>(w(),T("option",{key:ue,value:ue},O(ue),9,mye))),128))]),_:1},8,["model-value","aria-label"]),re(gs,{size:"sm","model-value":H.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ce[18]||(ce[18]=ue=>H.value=ue)},null,8,["model-value","options"])]),L.value?(w(),T("div",gye,O(C(n)("settings.archivedLoadingAll")),1)):(w(),T(Pe,{key:1},[V.value.length>0?(w(),T("div",vye,[(w(!0),T(Pe,null,ot(V.value,ue=>(w(),T("section",{key:ue.cwd,class:"archive-card"},[_("div",yye,[ce[23]||(ce[23]=_("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",kye,O(ue.cwd),1),_("span",bye,O(C(n)("settings.archivedSessionsCount",{count:ue.items.length})),1)]),_("div",xye,[(w(!0),T(Pe,null,ot(ue.items,Se=>(w(),T("div",{key:Se.id,class:"archive-row"},[_("div",wye,[_("div",_ye,O(Se.title),1),_("div",Sye,O(C(n)("settings.archivedAt",{time:fe(Se.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:Te=>J(Se.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),T("div",Cye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Eye=ct(Mye,[["__scopeId","data-v-2377814f"]]),Tye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,T8=/^[A-Za-z]:[\\/]/,Nye=/^\/\/(?!\/)/;function Cg(e){return Tye.test(e.trim())}function Iye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Lye(e){return Nye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function $ye(e){return T8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Fye(e){return T8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function iy(e,t){let n=Lye(Iye(e.trim(),t));const o=$ye(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=Fye(n),d=ad.value.trim().length>0);let g=0,b=null;const v=B(()=>Cg(d.value)),m=X("idle"),y=X(""),k=X("/"),A=X([]),$=X(""),N=X(null),x=X(null),I=B(()=>m.value!=="valid"?null:Rye(d.value,$.value,x.value));let E=0,F=null;function S(ce,ue){const Se=ce.toLowerCase(),Te=ue.toLowerCase();let Ae=0;for(let P=0;P0&&le=c4))break;ne.depth+1{b&&clearTimeout(b),F&&clearTimeout(F),E++,m.value="idle",A.value=[],x.value=null;const ue=ce.trim();if(ue===""){g++,h.value=[],f.value=!1;return}if(Cg(ue)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void R(ue),150);return}b=setTimeout(()=>void L(ce),220)});async function R(ce){const ue=++E;m.value="checking",x.value=null;const Se=iy(ce,$.value),{target:Te}=Se;try{const P=await o.browseFs(Te);if(ue!==E)return;if(P.path){m.value="valid",A.value=[],x.value=Te,a.value=P.path,c.value=P.parent,u.value=P.entries,l.value=!1;return}}catch{}if(ue!==E)return;const Ae=Se.base.toLowerCase();y.value=Se.parent,k.value=Se.separator;try{const P=await o.browseFs(Se.parent);if(ue!==E)return;if(P.path){A.value=P.entries.filter(le=>le.isDir&&le.name.toLowerCase().startsWith(Ae)),m.value="not-found";return}}catch{}ue===E&&(A.value=[],m.value="bad-parent")}function D(ce){d.value=Oye(y.value,ce,k.value),N.value?.focus()}const z=B(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),H=B(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function U(ce){if(ce.key==="Escape"){d.value?d.value="":s("close");return}if(ce.key!=="Enter")return;const ue=d.value.trim();if(Cg(ue)){if(ce.preventDefault(),l.value){const{target:Se}=iy(ue,$.value);Se&&s("add",Se);return}m.value==="valid"?oe():m.value==="not-found"&&A.value[0]&&D(A.value[0].name)}}const Z=B(()=>{const ce=a.value;if(!ce)return[];const ue=ce.split("/").filter(Boolean),Se=[{label:"/",path:"/"}];let Te="";for(const Ae of ue)Te+=`/${Ae}`,Se.push({label:Ae,path:Te});return Se}),K=B(()=>!(a.value.length===0||v.value&&I.value===null));async function V(ce){r.value=!0;try{const ue=await o.browseFs(ce);if(!ue.path){l.value=!0;return}a.value=ue.path,c.value=ue.parent,u.value=ue.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function J(ce){ce.isDir&&V(ce.path)}function fe(){c.value&&V(c.value)}function oe(){K.value&&s("add",I.value??a.value)}return cn(async()=>{r.value=!0;try{const ce=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ce.home&&($.value=ce.home),o.defaultPath&&(await V(o.defaultPath),!l.value))return;$.value?await V($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ce,ue)=>(w(),xe(qr,{open:i.value,"onUpdate:open":ue[2]||(ue[2]=Se=>i.value=Se),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:ue[3]||(ue[3]=Se=>s("close"))},{default:Ee(()=>[_("div",Bye,[l.value?ae("",!0):(w(),T("div",Dye,[re(Pn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",Pye,[(w(!0),T(Pe,null,ot(Z.value,(Se,Te)=>(w(),T(Pe,{key:Se.path},[Te>1?(w(),T("span",Hye,"/")):ae("",!0),_("button",{class:We(["crumb",{last:Te===Z.value.length-1}]),onClick:Ae=>V(Se.path)},O(Se.label),11,Wye)],64))),128))])])),!r.value||l.value?(w(),T("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[re(Ve,{class:"filter-icon",name:"search",size:"md"}),Fn(_("input",{ref_key:"filterEl",ref:N,"onUpdate:modelValue":ue[0]||(ue[0]=Se=>d.value=Se),class:"filter-input",type:"text",placeholder:z.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(U,["stop"])},null,40,zye),[[_s,d.value]]),f.value||m.value==="checking"?(w(),xe(Ds,{key:0,size:"sm"})):ae("",!0)],2)):ae("",!0),l.value?(w(),T("div",ske,O(C(n)("workspace.degradedHint")),1)):(w(),T("div",Uye,[r.value?(w(),T("div",qye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(w(),T(Pe,{key:1},[m.value==="checking"?(w(),T("div",jye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(w(),T(Pe,{key:1},[A.value.length>0?(w(),T("div",Vye,O(C(n)("workspace.pathPickHint")),1)):ae("",!0),(w(!0),T(Pe,null,ot(A.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>D(Se.name)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Gye,O(Se.name),1)],8,Kye))),128)),A.value.length===0?(w(),T("div",Yye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):ae("",!0)],64)):m.value==="bad-parent"?(w(),T("div",Zye,O(C(n)("workspace.badParent",{parent:y.value})),1)):ae("",!0)],64)):p.value&&!v.value?(w(),T(Pe,{key:2},[(w(!0),T(Pe,null,ot(h.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>V(Se.path)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Xye,O(Se.rel),1)],8,Qye))),128)),!f.value&&h.value.length===0?(w(),T("div",Jye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),T("div",eke,O(C(n)("workspace.searching")),1)):ae("",!0)],64)):(w(),T(Pe,{key:3},[(w(!0),T(Pe,null,ot(u.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>J(Se)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",nke,O(Se.name),1)],8,tke))),128)),u.value.length===0?(w(),T("div",oke,O(C(n)("workspace.noSubfolders")),1)):ae("",!0)],64))])),e.error?(w(),T("div",ike,O(e.error),1)):ae("",!0),_("div",rke,[re(Xt,{text:a.value},{default:Ee(()=>[l.value?ae("",!0):(w(),xe(Bt,{key:0,variant:"primary",disabled:!K.value,onClick:oe},{default:Ee(()=>[Je(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Bt,{variant:"secondary",onClick:ue[1]||(ue[1]=Se=>s("close"))},{default:Ee(()=>[Je(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",lke,O(H.value),1)])]),_:1},8,["open","title"]))}}),dke=ct(uke,[["__scopeId","data-v-07cbb13d"]]),fke={key:0,class:"confirm-dialog__message"},hke=Ze({__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}=Tt();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),po(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(qr,{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:Ee(()=>[re(Bt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ee(()=>[Je(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),re(Bt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ee(()=>[Je(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(w(),T("p",fke,O(e.message),1)):ae("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),pke=ct(hke,[["__scopeId","data-v-2e719024"]]),mke=Ze({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=tf();function i(){s()}return(r,l)=>(w(),xe(pke,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),gke={class:"rows"},vke={class:"row"},yke={class:"row"},kke={class:"row"},bke={class:"row"},xke={class:"row"},wke={class:"row"},_ke={class:"ctx-text"},Ske={key:0,class:"bar"},Cke={class:"row"},Ake=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!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:ir(o.status.ctxUsed),max:ir(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,g)=>(w(),xe(qr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ee(()=>[_("dl",gke,[_("div",vke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",yke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",kke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Yt({color:c.value})},O(a(e.status.permission)),5)]),_("div",bke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",xke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",wke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",_ke,O(l.value),1),e.status.ctxMax>0?(w(),T("span",Ske,[_("i",{style:Yt({width:r.value+"%"})},null,4)])):ae("",!0)])]),_("div",Cke,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Mke=ct(Ake,[["__scopeId","data-v-39844d89"]]),Eke={class:"ui-toast__icon","aria-hidden":"true"},Tke={class:"ui-toast__body"},Nke={class:"ui-toast__title"},Ike={key:0,class:"ui-toast__msg"},Lke=Ze({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",Eke,[On(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),xe(Ve,{key:0,name:"check"})):e.variant==="danger"?(w(),xe(Ve,{key:1,name:"close"})):e.variant==="warning"?(w(),xe(Ve,{key:2,name:"alert-triangle"})):(w(),xe(Ve,{key:3,name:"info"}))],!0)]),_("div",Tke,[_("div",Nke,O(e.title),1),e.message?(w(),T("div",Ike,O(e.message),1)):ae("",!0),On(t.$slots,"default",{},void 0,!0)]),re(Pn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),$ke=ct(Lke,[["__scopeId","data-v-adc6f346"]]),Fke={key:0,class:"actions"},Oke=["onClick"],Rke=["onClick"],Bke={key:1,class:"details"},Dke=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const I=[x.title];x.message&&I.push(x.message);const E=x.details??[];if(E.length>0){I.push("",`${s("warnings.diagnostics")}:`);for(const F of E)I.push(`${F.label}: ${F.value}`)}return I.join(` +`)}let f=1;const h=X([]),p=new Map,g=new Map;function b(x){const I=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?I+5e3:I}function v(x,I){const E=p.get(x)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>N(x),I),E.deadline=Date.now()+I,p.set(x,E)}function m(x){const I=p.get(x);I&&I.handle!==null&&clearTimeout(I.handle),p.delete(x)}function y(x){const I=p.get(x);!I||I.handle===null||(clearTimeout(I.handle),I.handle=null,I.remaining=Math.max(0,I.deadline-Date.now()))}function k(x){if(h.value.find(F=>F.id===x)?.detailsOpen)return;const E=p.get(x);!E||E.handle!==null||v(x,E.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?y(x.id):k(x.id)}async function $(x){if(!await Go(d(x.warning)))return;x.copied=!0;const E=g.get(x.id);E&&clearTimeout(E),g.set(x.id,setTimeout(()=>{x.copied=!1,g.delete(x.id)},1400))}function N(x){m(x);const I=g.get(x);I&&clearTimeout(I),g.delete(x);const E=h.value.findIndex(F=>F.id===x);E!==-1&&(h.value=h.value.filter(F=>F.id!==x),o("dismiss",E))}return Qe(()=>n.warnings,x=>{const I=[...h.value];h.value=x.map(E=>{const F=u(E),S=I.findIndex(D=>D.key===F),L=S===-1?void 0:I.splice(S,1)[0];if(L)return L.warning=E,L;const R={id:f++,key:F,warning:E,detailsOpen:!1,copied:!1};return v(R.id,b(E)),R});for(const E of I){m(E.id);const F=g.get(E.id);F&&clearTimeout(F),g.delete(E.id)}},{immediate:!0,flush:"post"}),bn(()=>{p.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),p.clear(),g.forEach(x=>clearTimeout(x)),g.clear()}),(x,I)=>(w(),xe(J9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(w(!0),T(Pe,null,ot(h.value,E=>(w(),xe($ke,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>N(E.id),onPointerenter:F=>y(E.id),onPointerleave:F=>k(E.id)},{default:Ee(()=>[a(E.warning)?.length?(w(),T("div",Fke,[_("button",{class:"link",type:"button",onClick:F=>A(E)},O(E.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Oke),_("button",{class:"link",type:"button",onClick:F=>$(E)},O(E.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Rke)])):ae("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),T("dl",Bke,[(w(!0),T(Pe,null,ot(a(E.warning),F=>(w(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):ae("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Pke=ct(Dke,[["__scopeId","data-v-6cc72bd4"]]),Hke={class:"topbar"},Wke={class:"wsq"},zke=["aria-label"],Uke={class:"tb-path"},qke={class:"ws"},jke={class:"se"},Vke={class:"tb-sub"},Kke=Ze({__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}=Tt(),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)=>(w(),T("div",Hke,[_("span",Wke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",Uke,[_("span",qke,O(r.value),1),e.sessionTitle?(w(),T(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",jke,O(e.sessionTitle),1)],64)):ae("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Vke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(w(),T(Pe,{key:0},[Je(" · "+O(e.branch),1)],64)):ae("",!0),e.sessionCount>0?(w(),T(Pe,{key:1},[Je(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ae("",!0)])],8,zke),re(Pn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ee(()=>[re(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Gke=ct(Kke,[["__scopeId","data-v-6b4b901f"]]),Yke={key:0,class:"sheet-root"},Zke=["aria-label"],Qke=["aria-label"],Xke={key:0,class:"sheet-head"},Jke={class:"sheet-title"},e2e={class:"sheet-body"},t2e=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),bn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(Il,{name:"sheet"},{default:Ee(()=>[e.modelValue?(w(),T("div",Yke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Qke),e.title?(w(),T("div",Xke,[_("span",Jke,O(e.title),1)])):ae("",!0),_("div",e2e,[On(l.$slots,"default",{},void 0,!0)])],8,Zke)])):ae("",!0)]),_:3}))}}),N8=ct(t2e,[["__scopeId","data-v-745ee5a2"]]),n2e={class:"mlist"},o2e={key:0,class:"mempty"},s2e=["onClick"],i2e={class:"mgh-main"},r2e={class:"mgh-name"},l2e={class:"mgh-path"},a2e={key:2,class:"att"},c2e={key:0,class:"mempty small"},u2e=["onClick"],d2e={class:"m"},f2e={class:"s"},h2e={key:0,class:"att"},p2e=["disabled","onClick"],m2e=["onClick"],g2e=Ze({__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}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=X(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,y.value=null,N.value=null}const h=X(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(L=>L.id===o.activeId)){const L=F.sessions.find(R=>R.id===o.activeId);if(L)return[...S,L]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=X(null);function k(F){y.value=y.value===F?null:F,N.value=null}function A(F){y.value=null;const L=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();L&&s("rename",F.id,L)}function $(F){y.value=null,s("archive",F)}const N=X(null);function x(F){N.value=N.value===F?null:F,y.value=null}function I(F){Go(F.root),N.value=null}function E(F){N.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(w(),xe(N8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=L=>s("update:modelValue",L))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:a},[re(Ve,{name:"message",size:"sm"}),Je(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[re(Ve,{name:"folder",size:"sm"}),Je(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",n2e,[e.groups.length===0?(w(),T("div",o2e,O(C(n)("workspace.noWorkspace")),1)):ae("",!0),(w(!0),T(Pe,null,ot(e.groups,L=>(w(),T("div",{key:L.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:L.workspace.id===e.activeWorkspaceId}]),onClick:R=>f(L.workspace.id)},[d(L.workspace.id)?(w(),xe(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),xe(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",i2e,[_("span",r2e,O(L.workspace.name),1),re(Xt,{text:L.workspace.root},{default:Ee(()=>[_("span",l2e,O(L.workspace.shortPath),1)]),_:2},1032,["text"])]),d(L.workspace.id)&&m(L.workspace.id)>0?(w(),T("span",a2e,O(m(L.workspace.id)),1)):ae("",!0),re(Pn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(R=>x(L.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(Pn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(R=>l(L.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),N.value===L.workspace.id?(w(),xe(kl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:R=>I(L.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:R=>E(L.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ae("",!0)],10,s2e),Fn(_("div",null,[L.sessions.length===0?(w(),T("div",c2e,O(C(n)("sidebar.noSessions")),1)):ae("",!0),(w(!0),T(Pe,null,ot(b(L),R=>(w(),T("div",{key:R.id,class:We(["srow",{cur:R.id===e.activeId}]),onClick:D=>r(R.id)},[_("div",d2e,[_("div",{class:We(["t",{run:R.busy,aborted:!R.busy&&(e.attentionBySession[R.id]??0)===0&&(R.lastTurnReason==="cancelled"||R.lastTurnReason==="failed")}])},O(R.title),3),_("div",f2e,O(R.time),1)]),(e.attentionBySession[R.id]??0)>0?(w(),T("span",h2e,O(e.attentionBySession[R.id]),1)):ae("",!0),re(Pn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(D=>k(R.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===R.id?(w(),xe(kl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:D=>A(R)},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:D=>$(R.id)},{default:Ee(()=>[Je(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ae("",!0)],10,u2e))),128)),L.hasMore||L.loadingMore?(w(),T("button",{key:1,type:"button",class:"mshow-more",disabled:L.loadingMore,onClick:bt(R=>v(L.workspace.id),["stop"])},O(L.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,L.workspace.sessionCount-L.sessions.length)})),9,p2e)):ae("",!0),L.sessions.length>L.initialCount?(w(),T("button",{key:2,type:"button",class:"mshow-more",onClick:bt(R=>g(L.workspace.id),["stop"])},O(p(L.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:L.sessions.length-L.initialCount})),9,m2e)):ae("",!0)],512),[[mi,!d(L.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),v2e=ct(g2e,[["__scopeId","data-v-df277098"]]),y2e={class:"group-title"},k2e={class:"srow-main"},b2e={class:"srow-label"},x2e={class:"srow-sub"},w2e={class:"srow read-only"},_2e={class:"srow-main"},S2e={class:"srow-label"},C2e={key:0,class:"srow-sub"},A2e={class:"cache-note"},M2e={class:"srow-main"},E2e={class:"srow-label"},T2e={class:"srow-sub"},N2e=["aria-checked"],I2e={class:"srow-main"},L2e={class:"srow-label"},$2e={class:"srow-sub"},F2e=["aria-checked"],O2e={class:"srow-main"},R2e={class:"srow-label"},B2e={class:"srow read-only"},D2e={class:"srow-main"},P2e={class:"srow-label"},H2e={class:"srow-sub"},W2e=["aria-label"],z2e={class:"group-title"},U2e={class:"srow-main"},q2e={class:"srow-label"},j2e={class:"srow-sub"},V2e={class:"srow read-only pref"},K2e={class:"srow-main"},G2e={class:"srow-label"},Y2e={class:"srow read-only pref"},Z2e={class:"srow-main"},Q2e={class:"srow-label"},X2e={class:"srow read-only pref"},J2e={class:"srow-main"},ebe={class:"srow-label"},tbe={class:"num-field"},nbe=["value","aria-label"],obe={class:"srow-main"},sbe={class:"srow-label"},ibe={class:"srow-sub"},rbe=["aria-checked"],lbe={class:"srow-main"},abe={class:"srow-label"},cbe={class:"srow-main"},ube={class:"srow-label"},dbe={key:2,class:"srow read-only"},fbe={class:"srow-main"},hbe={class:"srow-label"},pbe={class:"srow-val dim"},mbe={class:"arch-subhead"},gbe={class:"arch-count"},vbe={class:"arch-tools"},ybe={key:0,class:"arch-empty"},kbe={class:"arch-meta"},bbe={class:"arch-name"},xbe={class:"arch-time"},wbe={key:2,class:"arch-empty"},_be=100,Sbe=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(V){s("setColorScheme",V)}const r=["manual","auto","yolo"],l=B(()=>o.models?.find(V=>V.id===o.status?.modelId)),a=B(()=>Vm(l.value)),c=B(()=>Km(l.value)),u=B(()=>Pp(l.value,o.thinking)),d=B(()=>c.value.includes(u.value)?u.value:""),f=B(()=>c.value.map(V=>({value:V,label:Gv(V)}))),h=B(()=>o.planMode===!0),p=B(()=>o.swarmMode===!0),g=B(()=>{const V=o.status.permission;return V==="yolo"?"var(--color-danger)":V==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=B(()=>{const V=o.status.permission,J=n(V==="yolo"?"mobile.permYoloSub":V==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${V} · ${J}`}),v=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),m=B(()=>o.status.ctxMax>0?`${ir(o.status.ctxUsed)}/${ir(o.status.ctxMax)}`:n("status.statusNone"));function y(V){s("setThinking",Uk(l.value,V))}function k(){const V=r.indexOf(o.status.permission),J=r[(V+1)%r.length];s("setPermission",J)}function A(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function N(){s("logout"),s("update:modelValue",!1)}const x=m2(),I=X("main"),E=X([]),F=X(!1),S=X(!1),L=X(""),R=X("archived-desc");async function D(){if(!F.value){F.value=!0,S.value=!1;try{const V=[];let J;for(;;){const fe=await x.loadArchivedSessions({beforeId:J,pageSize:_be});if(V.push(...fe.items),!fe.hasMore||fe.items.length===0)break;const oe=fe.items.at(-1)?.id;if(oe===void 0)break;J=oe}E.value=V,S.value=!0}catch(V){console.warn("loadAllArchived failed",V)}finally{F.value=!1}}}function z(){I.value="archived",L.value="",D()}function H(){I.value="main"}const U=B(()=>{const V=L.value.trim().toLowerCase();let J=E.value.filter(fe=>fe.archived===!0);return V&&(J=J.filter(fe=>fe.title.toLowerCase().includes(V))),J=J.slice(),R.value==="archived-desc"?J.sort((fe,oe)=>oe.updatedAt.localeCompare(fe.updatedAt)):R.value==="created-desc"?J.sort((fe,oe)=>oe.createdAt.localeCompare(fe.createdAt)):J.sort((fe,oe)=>fe.title.localeCompare(oe.title,"zh")),J});async function Z(V){await x.restoreSession(V)&&(E.value=E.value.filter(fe=>fe.id!==V))}function K(V){const J=new Date(V);if(Number.isNaN(J.getTime()))return V;const fe=oe=>String(oe).padStart(2,"0");return`${J.getFullYear()}-${fe(J.getMonth()+1)}-${fe(J.getDate())} ${fe(J.getHours())}:${fe(J.getMinutes())}`}return Qe(()=>o.modelValue,V=>{V||(I.value="main")}),(V,J)=>(w(),xe(N8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":J[6]||(J[6]=fe=>s("update:modelValue",fe))},{default:Ee(()=>[I.value==="main"?(w(),T(Pe,{key:0},[_("div",y2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",k2e,[_("span",b2e,O(C(n)("status.statusModel")),1),_("span",x2e,O(e.status.model),1)]),J[7]||(J[7]=_("span",{class:"chev"},"›",-1))]),_("div",w2e,[_("span",_2e,[_("span",S2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),T("span",C2e,O(C(n)("status.modeNotSupported")),1)):ae("",!0)]),c.value.length>1?(w(),xe(gs,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),T("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Gv)(u.value)),3))]),_("div",A2e,O(C(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:J[0]||(J[0]=fe=>s("togglePlan"))},[_("span",M2e,[_("span",E2e,O(C(n)("status.statusPlanMode")),1),_("span",T2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,N2e)]),_("button",{type:"button",class:"srow",onClick:J[1]||(J[1]=fe=>s("toggleSwarm"))},[_("span",I2e,[_("span",L2e,O(C(n)("status.statusSwarmMode")),1),_("span",$2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,F2e)]),_("button",{type:"button",class:"srow",onClick:k},[_("span",O2e,[_("span",R2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Yt({color:g.value})},O(b.value),5)]),J[8]||(J[8]=_("span",{class:"chev"},"›",-1))]),_("div",B2e,[_("span",D2e,[_("span",P2e,O(C(n)("status.statusContext")),1),_("span",H2e,O(m.value),1)]),_("span",{class:"ctx-meter","aria-label":m.value},[_("i",{style:Yt({width:v.value+"%"})},null,4)],8,W2e)]),_("div",z2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:z},[_("span",U2e,[_("span",q2e,O(C(n)("mobile.archivedSessions")),1),_("span",j2e,O(C(n)("mobile.archivedSessionsSub")),1)]),J[9]||(J[9]=_("span",{class:"chev"},"›",-1))]),_("div",V2e,[_("span",K2e,[_("span",G2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(gs,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",Y2e,[_("span",Z2e,[_("span",Q2e,O(C(n)("sidebar.language")),1)]),re(E8)]),_("div",X2e,[_("span",J2e,[_("span",ebe,O(C(n)("settings.uiFontSize")),1)]),_("label",tbe,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:J[2]||(J[2]=fe=>s("setUiFontSize",Number(fe.target.value)))},null,40,nbe),J[10]||(J[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:J[3]||(J[3]=fe=>s("setConversationToc",!e.conversationToc))},[_("span",obe,[_("span",sbe,O(C(n)("settings.conversationToc")),1),_("span",ibe,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,rbe)]),e.authReady?(w(),T("button",{key:0,type:"button",class:"srow acct out",onClick:N},[_("span",lbe,[_("span",abe,O(C(n)("sidebar.signOut")),1)])])):(w(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",cbe,[_("span",ube,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),T("div",dbe,[_("span",fbe,[_("span",hbe,O(C(n)("settings.serverVersion")),1)]),_("span",pbe,O(e.serverVersion),1)])):ae("",!0)],64)):(w(),T(Pe,{key:1},[_("div",mbe,[_("button",{type:"button",class:"arch-back",onClick:H},[J[11]||(J[11]=_("span",{class:"chev back"},"‹",-1)),Je(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",gbe,O(C(n)("mobile.sessionCount",{n:U.value.length})),1)]),_("div",vbe,[re(Kc,{class:"arch-search-input","model-value":L.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":J[4]||(J[4]=fe=>L.value=fe)},null,8,["model-value","placeholder"]),re(gs,{size:"sm","model-value":R.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":J[5]||(J[5]=fe=>R.value=fe)},null,8,["model-value","options"])]),F.value?(w(),T("div",ybe,O(C(n)("settings.archivedLoadingAll")),1)):U.value.length>0?(w(!0),T(Pe,{key:1},ot(U.value,fe=>(w(),T("div",{key:fe.id,class:"arch-row"},[_("div",kbe,[_("div",bbe,O(fe.title),1),_("div",xbe,O(C(n)("settings.archivedAt",{time:K(fe.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:oe=>Z(fe.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),T("div",wbe,O(E.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),Cbe=ct(Sbe,[["__scopeId","data-v-c244b2fe"]]),Abe={class:"ob-brand"},Mbe={class:"ob-brand-text"},Ebe={class:"ob-title"},Tbe={class:"ob-sub"},Nbe={class:"ob-sec"},Ibe={class:"ob-label"},Lbe={class:"ob-sec"},$be={class:"ob-label"},Fbe={class:"ob-sec"},Obe={class:"ob-label"},Rbe=Ze({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=z5();function c(d){s.value!==d&&SA(d)}function u(){n("complete")}return(d,f)=>(w(),xe(qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",Abe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",Mbe,[_("div",Ebe,O(C(o)("onboarding.title")),1),_("div",Tbe,O(C(o)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",Nbe,[_("div",Ibe,O(C(o)("onboarding.languageLabel")),1),re(gs,{"model-value":C(s),options:C(_A).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",Lbe,[_("div",$be,O(C(o)("theme.colorSchemeLabel")),1),re(gs,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",Fbe,[_("div",Obe,O(C(o)("theme.accentLabel")),1),re(gs,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),re(Bt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Je(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Bbe=ct(Rbe,[["__scopeId","data-v-fbdd3eab"]]),Dbe=["aria-label"],Pbe={class:"gload-box"},Hbe={class:"gload-text"},Wbe={key:0,class:"gload-issue"},zbe={class:"gload-issue-detail"},Ube=Ze({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,o)=>(w(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",Pbe,[o[0]||(o[0]=Ay('',1)),re(Ds,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Hbe,O(C(t)("app.connecting")),1),e.issue?(w(),T("div",Wbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",zbe,O(e.issue),1)])):ae("",!0)])],8,Dbe))}}),qbe=ct(Ube,[["__scopeId","data-v-0b6dec6a"]]),jbe={class:"kap-root"},Vbe={class:"kap-head"},Kbe={class:"kap-count"},Gbe={class:"kap-head-actions"},Ybe={class:"kap-filters"},Zbe=["value"],Qbe={class:"kap-check"},Xbe={class:"kap-check"},Jbe={class:"kap-view-toggle",role:"group"},exe={key:0,class:"kap-empty"},txe=["onClick"],nxe={class:"kap-ts"},oxe={class:"kap-label"},sxe={key:0,class:"kap-detail"},ixe={class:"kap-detail-actions"},rxe=["onClick"],lxe={key:1,class:"kap-agg"},axe={class:"mono"},cxe={class:"mono"},uxe={class:"num"},dxe={class:"num"},fxe={key:0},hxe={class:"mono"},pxe={class:"num"},mxe={class:"num"},gxe={key:0},vxe=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=X("all"),s=X(""),i=X(""),r=X(!1),l=X("timeline"),a=B(()=>(Ik.value,[...Wte()])),c=B(()=>{const I=new Set;for(const E of a.value)E.sessionId&&I.add(E.sessionId);return[...I].sort()});function u(I){return I.kind==="rest:error"||I.code!==void 0&&I.code!==0||I.eventType==="error"||I.eventType==="parse-error"}const d=B(()=>{const I=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||I&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(I)))}),f=B(()=>{const I=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const F=E.kind==="ws:in"?"←":"→",S=`${F} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,L=I.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:F,count:0};L.count++,E.seq!==void 0&&(L.lastSeq=E.seq),I.set(S,L)}return[...I.values()].sort((E,F)=>F.count-E.count)}),h=B(()=>{const I=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const F=`${E.method??"?"} ${E.path??"?"}`,S=I.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),I.set(F,S)}return[...I.entries()].map(([E,F])=>({key:E,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((E,F)=>F.count-E.count)}),p=X(null),g=X(!0),b=X(null),v=X(null);Qe(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const I=b.value;I&&(I.scrollTop=I.scrollHeight)});function m(I){p.value=p.value===I?null:I}function y(I){const E=new Date(I),F=(S,L=2)=>String(S).padStart(L,"0");return`${F(E.getHours())}:${F(E.getMinutes())}:${F(E.getSeconds())}.${F(E.getMilliseconds(),3)}`}function k(I){return JSON.stringify(I,null,2)}async function A(I){await Go(k(I))&&(v.value=I.id,setTimeout(()=>{v.value===I.id&&(v.value=null)},1500))}function $(){h5(d.value)}function N(I){return u(I)||I.source==="client"?"b-err":I.source==="rest"?"b-rest":I.kind==="ws:lifecycle"?"b-life":I.kind==="ws:out"?"b-out":"b-in"}function x(I){return I.source==="rest"?"REST":I.source==="client"?"APP":"WS"}return(I,E)=>(w(),T("section",jbe,[_("header",Vbe,[E[11]||(E[11]=_("strong",null,"KAP debug",-1)),_("span",Kbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",Gbe,[_("button",{type:"button",class:We({on:C(Gu)}),onClick:E[0]||(E[0]=F=>Gu.value=!C(Gu))},O(C(Gu)?"resume":"pause"),3),_("button",{type:"button",onClick:E[1]||(E[1]=F=>C(zte)())},"clear"),_("button",{type:"button",onClick:E[2]||(E[2]=F=>$())},"export jsonl"),re(Xt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:E[3]||(E[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Ybe,[Fn(_("select",{"onUpdate:modelValue":E[4]||(E[4]=F=>o.value=F),"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),[[qg,o.value]]),Fn(_("select",{"onUpdate:modelValue":E[5]||(E[5]=F=>i.value=F),"aria-label":"Session filter"},[E[13]||(E[13]=_("option",{value:""},"all sessions",-1)),(w(!0),T(Pe,null,ot(c.value,F=>(w(),T("option",{key:F,value:F},O(F),9,Zbe))),128))],512),[[qg,i.value]]),Fn(_("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_s,s.value]]),_("label",Qbe,[Fn(_("input",{"onUpdate:modelValue":E[7]||(E[7]=F=>r.value=F),type:"checkbox"},null,512),[[np,r.value]]),E[14]||(E[14]=Je(" errors",-1))]),_("label",Xbe,[Fn(_("input",{"onUpdate:modelValue":E[8]||(E[8]=F=>g.value=F),type:"checkbox"},null,512),[[np,g.value]]),E[15]||(E[15]=Je(" follow",-1))]),_("div",Jbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:E[9]||(E[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),T("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),T("div",exe," No trace entries yet. REST calls and WS frames will appear here. ")):ae("",!0),(w(!0),T(Pe,null,ot(d.value,F=>(w(),T("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",nxe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",N(F)])},O(x(F)),3),_("span",oxe,O(F.label),1)],10,txe),p.value===F.id?(w(),T("div",sxe,[_("div",ixe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,rxe)]),_("pre",null,O(k(F)),1)])):ae("",!0)]))),128))],512)):(w(),T("div",lxe,[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,[(w(!0),T(Pe,null,ot(f.value,F=>(w(),T("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",axe,O(F.eventType),1),_("td",cxe,O(F.sessionId),1),_("td",uxe,O(F.count),1),_("td",dxe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),T("tr",fxe,[...E[16]||(E[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ae("",!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,[(w(!0),T(Pe,null,ot(h.value,F=>(w(),T("tr",{key:F.key},[_("td",hxe,O(F.key),1),_("td",pxe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",mxe,O(F.avgMs),1)]))),128)),h.value.length===0?(w(),T("tr",gxe,[...E[18]||(E[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ae("",!0)])])]))]))}}),yxe=ct(vxe,[["__scopeId","data-v-3cda6fe3"]]),kxe=Ze({__name:"DebugPanel",setup(e){const t=X(!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 h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}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 p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}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=op(yxe,{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 cn(()=>{c()}),po(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),xe(Xt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),bxe=ct(kxe,[["__scopeId","data-v-21346738"]]);function xxe({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),o=B(()=>e.initialized.value&&!n.value),s="/login",i=X(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Qe(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return bn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function wxe({running:e,showAuthGate:t}){const{t:n}=Tt(),o=["◐","◓","◑","◒"],s=X(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Qe(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});mT(()=>{typeof document<"u"&&(document.title=a.value)}),bn(()=>{l()})}const I8=X(typeof window>"u"?0:window.innerWidth);let ph=0,Yp=!1;function ry(){I8.value=window.innerWidth}function _xe(){Yp||typeof window>"u"||(window.addEventListener("resize",ry),Yp=!0,ry())}function Sxe(){!Yp||typeof window>"u"||(window.removeEventListener("resize",ry),Yp=!1)}function L8(e,t,n){return Math.max(t,e-n)}function ly(e,t,n){return Math.min(n,Math.max(t,e))}function $8(){return cn(()=>{ph+=1,_xe()}),po(()=>{ph=Math.max(0,ph-1),ph===0&&Sxe()}),{viewportWidth:I8}}const Cxe="kimi-web.file-preview-width",xc=320;function Axe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=$8(),i=B(()=>Math.max(0,s.value-t.value)),r=B(()=>L8(i.value,xc,xc));function l(ne){return ly(Math.round(ne),xc,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=X(c.value),d=B(()=>ly(u.value,xc,r.value)),f=X(null),h=B(()=>{const ne=f.value;if(!ne)return null;const ee=e.turns.value.find(ge=>ge.id===ne.turnId)?.blocks?.[ne.blockIndex];return ee?.kind==="thinking"?ee.thinking:null}),p=B(()=>h.value!==null);function g(ne){const q=f.value;if(q&&q.turnId===ne.turnId&&q.blockIndex===ne.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ne}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=X(null),m=B(()=>{const ne=v.value;if(!ne)return null;const q=e.turns.value.find(ee=>ee.id===ne.turnId);return q?.role==="compaction"&&q.text?q.text:null}),y=B(()=>m.value!==null);function k(ne){if(v.value?.turnId===ne.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=ne}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=X(null);function N(ne){const q=e.activeAppTasks.value,ee=q.find(de=>de.id===ne)??q.find(de=>de.parentToolCallId===ne);if(ee)return ee.id;const ge=q.filter(de=>de.kind==="subagent"&&!de.parentToolCallId);if(ge.length===1)return ge[0].id}const x=B(()=>{const ne=$.value;if(!ne)return null;const q=e.activeAppTasks.value.find(ee=>ee.id===ne.subagentId);return q?n1e(q):null}),I=B(()=>x.value!==null);function E(ne){const q=N(ne);if(q){if($.value?.subagentId===q){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:q},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=X(null),L=B(()=>{const ne=S.value;if(!ne)return null;const q=vH(e.turns.value,ne);return q?{id:ne,title:Pa(q.name),path:gH(q.arg),lines:q.status==="error"?null:MA(q),output:q.output}:null}),R=B(()=>L.value!==null);function D(ne){if(n.value==="toolDiff"&&S.value===ne){z();return}n.value="toolDiff",S.value=ne}function z(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const H=X("list"),U=X(null);function Z(){if(n.value==="diff"){K();return}n.value="diff",H.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function K(){n.value==="diff"&&(n.value=null),H.value="list",U.value=null,e.clearFileDiff()}async function V(ne){H.value="detail",U.value=ne,await e.loadFileDiff(ne)}async function J(ne){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,ne):await e.openSideChat(ne),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function oe(){n.value==="btw"&&(n.value=null)}const ce=B(()=>e.sideChatVisible.value),ue=B(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||I.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||ce.value)),Se=X(!1),Te=X({});function Ae(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function P(ne){if(ne)switch(ne.kind){case"thinking":f.value={turnId:ne.turnId,blockIndex:ne.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:ne.turnId},n.value="compaction";break;case"agent":$.value={subagentId:ne.subagentId},n.value="agent";break;case"toolDiff":S.value=ne.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function le(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&I.value?(F(),!0):n.value==="toolDiff"&&R.value?(z(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(K(),!0):n.value==="btw"?(fe(),!0):!1}return Qe(e.activeSessionId,(ne,q)=>{if(q){const ee=Ae();ee?Te.value[q]=ee:delete Te.value[q]}o(),b(),A(),F(),z(),K(),oe(),ne&&P(Te.value[ne])}),{PREVIEW_WIDTH_KEY:Cxe,PREVIEW_MIN:xc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:I,openAgentPanel:E,closeAgentPanel:F,toolDiffTarget:L,toolDiffVisible:R,openToolDiff:D,closeToolDiff:z,detailDiffMode:H,detailDiffPath:U,openDiffDetail:Z,closeDiffDetail:K,selectDiffFile:V,btwVisible:ce,openSideChatTab:J,closeSideChat:fe,hideSideChatPanel:oe,sidePanelVisible:ue,panelDragging:Se,closeOpenSidePanel:le}}const Mxe=Ft.sidebarWidth,u4=Ft.sidebarCollapsed,d4=270,Ag=170,Exe=480,Txe=320;function Nxe(e={}){const{viewportWidth:t}=$8(),n=X(d4),o=X(!1),s=X(!1),i=B(()=>{const u=Txe+(O4(e.previewOpen)?xc:0);return Math.min(Exe,L8(t.value,Ag,u))}),r=B(()=>ly(n.value,Ag,i.value));function l(){try{o.value=mo(u4)==="true"}catch{o.value=!1}}function a(){try{So(u4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:Mxe,SIDEBAR_DEFAULT:d4,SIDEBAR_MIN:Ag,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function Ixe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function Lxe({client:e,detailTarget:t}){const{t:n}=Tt(),o=X(null),s=X(null),i=X(!1),r=X(null),l=X(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const N=l.value;return N?e.getFileDownloadUrl(N):null}),f=B(()=>o.value!==null);function h(N){return N.length>1?N.replace(/\/+$/,""):N}function p(N){const x=[];for(const I of N.split(/[\\/]+/))if(!(!I||I===".")){if(I===".."){x.pop();continue}x.push(I)}return x.join("/")}function g(N){const x=N.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const I=h(e.status.value.cwd);if(x.startsWith("/")){if(!I||x!==I&&!x.startsWith(`${I}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===I?"":x.slice(I.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(x);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function b(N){const x=o.value;if(t.value==="file"&&x&&x.path===N.path&&x.line===N.line){k();return}const I=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=N,l.value=null;const E=g(N.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const F=await e.readFileContent(E.path);if(I!==a)return;F?s.value={...F,path:F.path||E.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(I!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{I===a&&(i.value=!1)}}function v(N){return/^data:([^;,]+)/i.exec(N)?.[1]}function m(N){if(N.kind!=="image"&&N.kind!=="video")return;const x=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const I=N.kind==="video",E={path:N.path??(I?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:N.mimeType??v(N.url)??(I?"video/*":"image/*"),isBinary:!0,size:N.bytes??0};N.fileId?(i.value=!0,s.value=E,dt().getFileBlob(N.fileId).then(F=>{if(x===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(F),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(s.value&&(s.value={...s.value,sourceUrl:N.url}),i.value=!1)})):(i.value=!1,s.value=Ixe(N.url)?{...E,sourceUrl:N.url}:E)}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Qe(t,(N,x)=>{x==="file"&&N!=="file"&&y()});function A(){const N=s.value?.path??o.value?.path;N&&e.openWorkspaceFile(N,o.value?.line)}function $(){const N=s.value?.path??o.value?.path;N&&e.revealWorkspaceFile(N)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const $xe=640,Fxe=`(max-width: ${$xe}px)`;function Oxe(){const e=X(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Fxe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const Rxe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Bxe={class:"server-auth-card"},Dxe={class:"server-auth-body"},Pxe={class:"server-auth-foot"},Hxe=Ze({__name:"ServerAuthDialog",setup(e){const t=X(""),n=X(null),o=X(!1);cn(()=>{mt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,k5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),T("div",Rxe,[_("div",Bxe,[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"},[Je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Je("). ")])],-1)),_("div",Dxe,[re(Kc,{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",Pxe,[re(Bt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ee(()=>[Je(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Wxe=ct(Hxe,[["__scopeId","data-v-6f624612"]]),zxe=["aria-label"],Uxe=Ze({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=FB;return(o,s)=>C(n)?(w(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,zxe)):ae("",!0)}}),qxe=ct(Uxe,[["__scopeId","data-v-166b3735"]]),jxe={class:"app-shell"},Vxe={key:1,class:"auth-page"},Kxe={class:"auth-page-inner"},Gxe={class:"auth-page-copy"},Yxe=["aria-label","aria-hidden"],Zxe=Ze({__name:"App",setup(e){$ne();const t=X(!1);let n=null;const o=m2(),s=B(()=>!o.dangerousBypassAuth.value&&t.value);Ln("resolveImage",o.resolveImageUrl),Ln("resolveSwarmMembers",Fe=>o.swarmMembersByToolCallId.value.get(Fe)??[]);const{t:i}=Tt(),{confirm:r}=tf(),l=Hi(),a=Oxe(),c=X(!1),u=X(!1),d=B(()=>{const Fe=o.activeSessionId.value;return o.sessions.value.find(se=>se.id===Fe)?.title??""}),f=B(()=>o.visibleWorkspace.value?.sessionCount??0),h=B(()=>o.activity.value!=="idle"),p=X(null),{showAuthGate:g,blinkAuthLogo:b}=xxe({client:o,authLogoRef:p});wxe({running:h,showAuthGate:g});function v(Fe){const se=o.models.value.find(He=>He.id===o.status.value.modelId),Ne=Km(se),he=Ne.indexOf(Pp(se,Fe)),we=Ne[(he+1)%Ne.length]??Ne[0]??"off";return Uk(se,we)}const m=B(()=>{const Fe=o.models.value.find(se=>se.id===o.status.value.modelId);return Pp(Fe,o.thinking.value)}),y=X(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function N(){const Fe=window.visualViewport,se=document.documentElement.style;se.setProperty("--app-height",`${Fe?.height??window.innerHeight}px`),se.setProperty("--app-top",`${Fe?.offsetTop??0}px`)}function x(){$||($=requestAnimationFrame(()=>{$=0,N()}))}cn(()=>{n=Rne(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ne(),N(),window.visualViewport?.addEventListener("resize",x),window.visualViewport?.addEventListener("scroll",x),window.addEventListener("resize",x),document.addEventListener("keydown",I,!0)}),bn(()=>{document.removeEventListener("keydown",I,!0),window.visualViewport?.removeEventListener("resize",x),window.visualViewport?.removeEventListener("scroll",x),window.removeEventListener("resize",x),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function I(Fe){Fe.key==="Escape"&&(Xe.value||os()&&(Fe.stopPropagation(),Fe.preventDefault()))}const E=X(null),F=X(!1);Qe(o.activeSessionId,()=>{F.value=!0,mt(()=>{F.value=!1})});const{previewTarget:S,previewFile:L,previewLoading:R,previewError:D,previewDownloadUrl:z,previewExternalActions:H,openFilePreview:U,openMediaPreview:Z,closeFilePreview:K,openPreviewInEditor:V,revealPreviewFile:J}=Lxe({client:o,detailTarget:E}),fe=B(()=>E.value!==null),{SIDEBAR_WIDTH_KEY:oe,SIDEBAR_DEFAULT:ce,SIDEBAR_MIN:ue,sidebarMax:Se,sessionColWidth:Te,sidebarCollapsed:Ae,sidebarDragging:P,sideWidth:le,loadSidebarCollapsed:ne,toggleSidebarCollapse:q}=Nxe({previewOpen:fe}),{PREVIEW_WIDTH_KEY:ee,PREVIEW_MIN:ge,previewDefaultWidth:de,previewMax:ve,previewWidth:j,previewPanelWidth:te,thinkingPanelText:pe,thinkingVisible:Ce,openThinkingPanel:$e,closeThinkingPanel:De,compactionPanelText:me,compactionPanelVisible:Ie,openCompactionPanel:et,closeCompactionPanel:rt,agentPanelMember:_t,openAgentPanel:gt,closeAgentPanel:It,toolDiffTarget:Ut,openToolDiff:ht,closeToolDiff:un,detailDiffMode:dn,detailDiffPath:ns,openDiffDetail:Wt,closeDiffDetail:Hn,selectDiffFile:lo,btwVisible:it,openSideChatTab:Gn,closeSideChat:ao,sidePanelVisible:Yn,panelDragging:go,closeOpenSidePanel:os}=Axe({client:o,sideWidth:le,detailTarget:E,closeFilePreview:K}),qn=X(null),to=X(!1),vn=X(!1),Zn=X(!1),xn=X(!1),An=X(!1),Mn=X(!1),Do=X(null),ze=X(null),Xe=B(()=>vc.value>0||to.value||vn.value||Zn.value||xn.value||An.value||Mn.value||y.value||c.value||u.value),kt=X(!1),Ht=X(!1),Rn=X(!1),sn=X(!1),Gt=X(!1);async function Wn(){kt.value=!0,Ht.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Ht.value=!0}finally{kt.value=!1}}async function En(){Rn.value=!0,sn.value=!1,vn.value=!0;try{await o.loadProviders()}catch{sn.value=!0}finally{Rn.value=!1}}function St(){Zn.value=!0}async function Po(Fe){to.value=!1,await Ao(Fe)}async function Ao(Fe){await o.setModel(Fe)&&Fe!==o.defaultModel.value&&o.updateConfig({defaultModel:Fe})}async function ss(Fe){await o.addProvider(Fe)}async function Tn(Fe){await o.refreshProvider(Fe)}async function jn(Fe){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Fe)})}async function Ps(Fe){const se=o.workspacesView.value.find(Ne=>Ne.id===Fe)?.name??Fe;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:se}),variant:"danger",action:()=>o.deleteWorkspace(Fe)})}async function ti(Fe){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Fe)})}async function Io(Fe){Gt.value=!0;try{await o.updateConfig(Fe)&&await o.checkAuth()}finally{Gt.value=!1}}async function Ss(){return o.startOAuthLogin()}async function Wi(){return o.pollOAuthLogin()}async function Si(){return o.cancelOAuthLogin()}async function co(){Zn.value=!1,await o.checkAuth(),await o.load()}async function ni(Fe){await o.undo(1),await mt(),qn.value?.loadComposerForEdit(Fe.text,Fe.attachments)}function Ci(Fe){if(Fe==="/compact"||Fe.startsWith("/compact ")){o.compact(Fe.slice(8).trim()||void 0);return}if(Fe==="/swarm"||Fe.startsWith("/swarm ")){const se=Fe.slice(6).trim();se==="on"?o.setSwarmMode(!0):se==="off"?o.setSwarmMode(!1):se?(o.setSwarmMode(!0),o.sendPrompt(se)):o.toggleSwarmMode();return}if(Fe==="/goal"||Fe.startsWith("/goal ")){const se=Fe.slice(5).trim();se==="pause"||se==="resume"||se==="cancel"?o.controlGoal(se):se?o.createGoal(se):o.toggleGoalMode();return}if(Fe==="/btw"||Fe.startsWith("/btw ")){const se=Fe.slice(4).trim();!se&&o.sideChatVisible.value?ao():Gn(se||void 0);return}switch(Fe){case"/new":case"/clear":$o();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(v(o.thinking.value));break;case"/status":An.value=!0;break;case"/login":St();break;default:{const se=Fe.indexOf(" "),Ne=vre((se===-1?Fe:Fe.slice(0,se)).slice(1)),he=se===-1?void 0:Fe.slice(se+1).trim()||void 0;if(!Ne)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Ne,he):o.activateSkill(Ne,he);break}}}function ar(Fe){o.unqueue(Fe)}function no(Fe){o.unqueue(Fe)}function is(Fe){o.reorderQueue(Fe.from,Fe.to)}async function rs(Fe){const se=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&se){await o.startSessionAndSendPrompt(se,Fe.text,Fe.attachments);return}if(!o.activeSessionId.value&&!se){Do.value=Fe,xn.value=!0;return}o.sendPrompt(Fe.text,Fe.attachments)}async function Lo(Fe){if(ze.value=null,!await o.addWorkspaceByPath(Fe)){ze.value=i("workspace.addFailed");return}xn.value=!1;const Ne=Do.value;Do.value=null;const he=o.activeWorkspaceId.value;Ne&&he&&await o.startSessionAndSendPrompt(he,Ne.text,Ne.attachments)}function Ai(){Do.value=null,ze.value=null,xn.value=!1}function zn(){mt(()=>{qn.value?.focusComposer()})}function $o(){const Fe=o.activeWorkspaceId.value;Fe?o.openWorkspaceDraft(Fe):o.clearActiveSession(),zn()}function oi(Fe){o.openWorkspaceDraft(Fe),zn()}function Ue(Fe){Fe&&window.open(Fe,"_blank","noopener")}return(Fe,se)=>(w(),T("div",jxe,[s.value?(w(),xe(Wxe,{key:0})):ae("",!0),C(g)?(w(),T("section",Vxe,[_("div",Kxe,[(w(),T("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:se[0]||(se[0]=bt(()=>{},["prevent"])),onClick:se[1]||(se[1]=(...Ne)=>C(b)&&C(b)(...Ne))},[...se[98]||(se[98]=[Ay('',2)])],544)),_("div",Gxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Bt,{class:"auth-page-btn",variant:"primary",onClick:St},{default:Ee(()=>[re(Ve,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(w(),T("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(Ae)&&!C(a),"macos-desktop":C(Dc)}]),style:Yt({"--preview-w":C(te)+"px"})},[C(a)?(w(),xe(Gke,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:se[19]||(se[19]=Ne=>c.value=!0),onOpenSettings:se[20]||(se[20]=Ne=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),T(Pe,{key:0},[re(oD,{collapsed:C(Ae),dragging:C(P),"col-width":C(le),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:se[2]||(se[2]=Ne=>C(o).selectSession(Ne)),onCreate:$o,onCreateInWorkspace:se[3]||(se[3]=Ne=>oi(Ne)),onSelectWorkspace:se[4]||(se[4]=Ne=>C(o).openWorkspace(Ne)),onAddWorkspace:se[5]||(se[5]=Ne=>xn.value=!0),onRename:se[6]||(se[6]=(Ne,he)=>C(o).renameSession(Ne,he)),onArchive:se[7]||(se[7]=Ne=>jn(Ne)),onFork:se[8]||(se[8]=Ne=>C(o).forkSession(Ne)),onExport:se[9]||(se[9]=Ne=>C(o).exportSession(Ne)),onRenameWorkspace:se[10]||(se[10]=(Ne,he)=>C(o).renameWorkspace(Ne,he)),onDeleteWorkspace:se[11]||(se[11]=Ne=>Ps(Ne)),onReorderWorkspaces:se[12]||(se[12]=Ne=>C(o).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:se[13]||(se[13]=Ne=>C(o).setWorkspaceSortMode(Ne)),onLoadMoreSessions:se[14]||(se[14]=Ne=>void C(o).loadMoreSessions(Ne)),onLoadAllSessions:se[15]||(se[15]=Ne=>void C(o).loadAllSessions()),onOpenSettings:se[16]||(se[16]=Ne=>Mn.value=!0),onCollapse:C(q)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),Fn(re(fw,{class:"side-handle","storage-key":C(oe),"default-width":C(ce),min:C(ue),max:C(Se),"onUpdate:width":se[17]||(se[17]=Ne=>Te.value=Ne),"onUpdate:dragging":se[18]||(se[18]=Ne=>P.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(Ae)]])],64)),re(_ue,{ref_key:"conversationPaneRef",ref:qn,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:se[21]||(se[21]=Ne=>C(Wt)()),onSelectWorkspace:se[22]||(se[22]=Ne=>oi(Ne)),onAddWorkspace:se[23]||(se[23]=Ne=>xn.value=!0),onOpenPr:Ue,onSubmit:se[24]||(se[24]=Ne=>rs(Ne)),onSteer:se[25]||(se[25]=Ne=>C(o).steerPrompt(Ne.text,Ne.attachments)),onApproval:se[26]||(se[26]=(Ne,he)=>C(o).respondApproval(Ne,he)),onCancelTask:se[27]||(se[27]=Ne=>C(o).cancelTask(Ne)),onAnswer:se[28]||(se[28]=(Ne,he)=>C(o).respondQuestion(Ne,he)),onDismiss:se[29]||(se[29]=Ne=>C(o).dismissQuestion(Ne)),onCommand:Ci,onInterrupt:se[30]||(se[30]=Ne=>C(o).abortCurrentPrompt()),onUnqueue:ar,onEditQueued:no,onReorderQueue:is,onSetPermission:se[31]||(se[31]=Ne=>C(o).setPermission(Ne)),onSetThinking:se[32]||(se[32]=Ne=>C(o).setThinking(Ne)),onTogglePlan:se[33]||(se[33]=Ne=>C(o).togglePlanMode()),onToggleSwarm:se[34]||(se[34]=Ne=>C(o).toggleSwarmMode()),onToggleGoal:se[35]||(se[35]=Ne=>C(o).toggleGoalMode()),onCreateGoal:se[36]||(se[36]=Ne=>C(o).createGoal(Ne)),onControlGoal:se[37]||(se[37]=Ne=>C(o).controlGoal(Ne)),onRefreshGitStatus:se[38]||(se[38]=Ne=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:se[39]||(se[39]=(Ne,he)=>C(o).renameSession(Ne,he)),onForkSession:se[40]||(se[40]=Ne=>C(o).forkSession(Ne)),onArchiveSession:se[41]||(se[41]=Ne=>jn(Ne)),onExportSession:se[42]||(se[42]=Ne=>C(o).exportSession(Ne)),onCompact:se[43]||(se[43]=Ne=>C(o).compact()),onPickModel:se[44]||(se[44]=Ne=>Wn()),onSelectModel:se[45]||(se[45]=Ne=>Ao(Ne)),onOpenFile:se[46]||(se[46]=Ne=>C(U)(Ne)),onOpenMedia:se[47]||(se[47]=Ne=>C(Z)(Ne)),onOpenThinking:se[48]||(se[48]=Ne=>C($e)(Ne)),onOpenCompaction:se[49]||(se[49]=Ne=>C(et)(Ne)),onOpenAgent:se[50]||(se[50]=Ne=>C(gt)(Ne)),onOpenToolDiff:se[51]||(se[51]=Ne=>C(ht)(Ne)),onEditMessage:ni},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-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"]),!C(a)&&(C(Dc)||C(Ae))?(w(),xe(Pn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Ae)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(q)},{default:Ee(()=>[re(Ve,{name:C(Ae)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ae("",!0),C(Yn)&&!C(a)?(w(),xe(fw,{key:3,class:"preview-handle","storage-key":C(ee),"default-width":C(de),min:C(ge),max:C(ve),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":se[52]||(se[52]=Ne=>j.value=Ne),"onUpdate:dragging":se[53]||(se[53]=Ne=>go.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ae("",!0),!C(a)||C(Yn)?(w(),T("aside",{key:4,class:We(["global-preview",{open:C(Yn),mobile:C(a),"no-anim":C(go)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Yn)},[E.value==="thinking"&&C(Ce)?(w(),xe(VC,{key:0,text:C(pe)??"",onClose:C(De)},null,8,["text","onClose"])):E.value==="compaction"&&C(Ie)?(w(),xe(VC,{key:1,text:C(me)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(rt)},null,8,["text","subtitle","onClose"])):E.value==="agent"&&C(_t)?(w(),xe(Yde,{key:2,member:C(_t),onClose:C(It)},null,8,["member","onClose"])):E.value==="btw"&&C(it)?(w(),xe(gfe,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:se[54]||(se[54]=Ne=>C(o).sendSideChatPrompt(Ne)),onClose:C(ao)},null,8,["turns","running","sending","onClose"])):E.value==="diff"?(w(),xe(qfe,{key:4,mode:C(dn),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(lo),onBack:se[55]||(se[55]=Ne=>{dn.value="list",ns.value=null,C(o).clearFileDiff()}),onClose:C(Hn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):E.value==="toolDiff"&&C(Ut)?(w(),xe(afe,{key:5,target:C(Ut),onClose:C(un)},null,8,["target","onClose"])):E.value==="file"?(w(),xe(Nde,{key:6,file:C(L),loading:C(R),error:C(D),line:C(S)?.line,"download-url":C(z),closable:"","external-actions":C(H),"open-file":C(U),onClose:C(K),onOpenExternal:C(V),onReveal:C(J)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ae("",!0)],10,Yxe)):ae("",!0),re(qxe,{class:"internal-build-fab"}),to.value?(w(),xe(che,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:kt.value,unavailable:Ht.value,onSelect:se[56]||(se[56]=Ne=>Po(Ne)),onToggleStar:se[57]||(se[57]=Ne=>C(o).toggleStarModel(Ne)),onClose:se[58]||(se[58]=Ne=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ae("",!0),Mn.value?(w(),xe(Eye,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Gt.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:se[59]||(se[59]=Ne=>C(o).setColorScheme(Ne)),onSetAccent:se[60]||(se[60]=Ne=>C(o).setAccent(Ne)),onSetUiFontSize:se[61]||(se[61]=Ne=>C(o).setUiFontSize(Ne)),onSetNotify:se[62]||(se[62]=Ne=>C(o).setNotifyOnComplete(Ne)),onSetNotifyQuestion:se[63]||(se[63]=Ne=>C(o).setNotifyOnQuestion(Ne)),onSetNotifyApproval:se[64]||(se[64]=Ne=>C(o).setNotifyOnApproval(Ne)),onSetSound:se[65]||(se[65]=Ne=>C(o).setSoundOnComplete(Ne)),onSetConversationToc:se[66]||(se[66]=Ne=>C(o).setConversationToc(Ne)),onUpdateConfig:se[67]||(se[67]=Ne=>Io(Ne)),onLogin:se[68]||(se[68]=()=>{Mn.value=!1,St()}),onLogout:C(o).logout,onOpenOnboarding:se[69]||(se[69]=()=>{Mn.value=!1,A()}),onOpenProviders:se[70]||(se[70]=()=>{Mn.value=!1,En()}),onClose:se[71]||(se[71]=Ne=>Mn.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","onLogout"])):ae("",!0),vn.value?(w(),xe(Fhe,{key:7,providers:C(o).providers.value,loading:Rn.value,unavailable:sn.value,onAdd:se[72]||(se[72]=Ne=>ss(Ne)),onRefresh:se[73]||(se[73]=Ne=>Tn(Ne)),onDelete:se[74]||(se[74]=Ne=>ti(Ne)),onOpenLogin:se[75]||(se[75]=()=>{vn.value=!1,St()}),onClose:se[76]||(se[76]=Ne=>vn.value=!1)},null,8,["providers","loading","unavailable"])):ae("",!0),An.value?(w(),xe(Mke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:se[77]||(se[77]=Ne=>An.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ae("",!0),xn.value?(w(),xe(dke,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:ze.value,onAdd:se[78]||(se[78]=Ne=>Lo(Ne)),onClose:Ai},null,8,["browse-fs","get-fs-home","default-path","error"])):ae("",!0),re(Il,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?ae("",!0):(w(),xe(qbe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(w(),xe(Bbe,{key:10,onComplete:k,onSkip:k})):ae("",!0),re(Pke,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),xe(bxe,{key:11})):ae("",!0),re(mke),C(a)?(w(),xe(v2e,{key:12,modelValue:c.value,"onUpdate:modelValue":se[79]||(se[79]=Ne=>c.value=Ne),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:se[80]||(se[80]=Ne=>C(o).selectSession(Ne)),onCreate:$o,onCreateInWorkspace:se[81]||(se[81]=Ne=>oi(Ne)),onAddWorkspace:se[82]||(se[82]=Ne=>xn.value=!0),onRename:se[83]||(se[83]=(Ne,he)=>C(o).renameSession(Ne,he)),onArchive:se[84]||(se[84]=Ne=>jn(Ne)),onDeleteWorkspace:se[85]||(se[85]=Ne=>Ps(Ne)),onLoadMore:se[86]||(se[86]=Ne=>void C(o).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ae("",!0),C(a)?(w(),xe(Cbe,{key:13,modelValue:u.value,"onUpdate:modelValue":se[87]||(se[87]=Ne=>u.value=Ne),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:se[88]||(se[88]=Ne=>Wn()),onSetThinking:se[89]||(se[89]=Ne=>C(o).setThinking(Ne)),onTogglePlan:se[90]||(se[90]=Ne=>C(o).togglePlanMode()),onToggleSwarm:se[91]||(se[91]=Ne=>C(o).toggleSwarmMode()),onSetPermission:se[92]||(se[92]=Ne=>C(o).setPermission(Ne)),onSetColorScheme:se[93]||(se[93]=Ne=>C(o).setColorScheme(Ne)),onSetUiFontSize:se[94]||(se[94]=Ne=>C(o).setUiFontSize(Ne)),onSetConversationToc:se[95]||(se[95]=Ne=>C(o).setConversationToc(Ne)),onLogin:se[96]||(se[96]=()=>{u.value=!1,St()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ae("",!0)],6)),Zn.value?(w(),xe(dpe,{key:3,"on-start-o-auth-login":Ss,"on-poll-o-auth-login":Wi,"on-cancel-o-auth-login":Si,onSuccess:co,onClose:se[97]||(se[97]=Ne=>Zn.value=!1)})):ae("",!0)]))}}),Qxe=ct(Zxe,[["__scopeId","data-v-8cd3196b"]]);Gte();op(Qxe).use(_n).mount("#app");export{LE as $,e3 as A,wT as B,bo as C,Zwe as D,y4 as E,Pe as F,Ay as G,Je as H,re as I,tT as J,xwe as K,Li as L,Ze as M,G9 as N,Cwe as O,Awe as P,Twe as Q,Ph as R,Rc as S,dm as T,Mwe as U,Ey as V,Swe as W,Xwe as X,Ewe as Y,jwe as Z,Jxe as _,K4 as a,jo as a$,Yo as a0,uy as a1,lwe as a2,gy as a3,y9 as a4,mn as a5,su as a6,hwe as a7,t_e as a8,vwe as a9,X4 as aA,$T as aB,PT as aC,cn as aD,DT as aE,BT as aF,dy as aG,RT as aH,bn as aI,yy as aJ,rT as aK,w as aL,j9 as aM,dwe as aN,Ln as aO,R4 as aP,uwe as aQ,qh as aR,Bo as aS,Wh as aT,X as aU,Pwe as aV,uN as aW,ot as aX,On as aY,WT as aZ,wwe as a_,bwe as aa,kwe as ab,ywe as ac,Wwe as ad,n_e as ae,Kt as af,S9 as ag,cm as ah,_l as ai,Hr as aj,ho as ak,Hwe as al,Ks as am,Nl as an,pt as ao,Lwe as ap,$we as aq,yn as ar,mt as as,T9 as at,We as au,Xxe as av,Yt as aw,LT as ax,OT as ay,po as az,cwe as b,_X as b$,Gwe as b0,kd as b1,Zh as b2,Vwe as b3,Tl as b4,QE as b5,twe as b6,Ba as b7,hT as b8,Kwe as b9,_s as bA,mi as bB,C9 as bC,Uwe as bD,Qe as bE,mT as bF,pwe as bG,gT as bH,Owe as bI,Ee as bJ,Nwe as bK,Fn as bL,nr as bM,zwe as bN,bt as bO,fwe as bP,gn as bQ,ms as bR,f_e as bS,fJ as bT,PM as bU,p_e as bV,WQ as bW,kk as bX,h_e as bY,yv as bZ,b_e as b_,ewe as ba,O as bb,mh as bc,_we as bd,en as be,swe as bf,owe as bg,O4 as bh,Dwe as bi,nwe as bj,C as bk,Vd as bl,e_e as bm,Qwe as bn,Z9 as bo,mwe as bp,Rwe as bq,pT as br,Jwe as bs,Iwe as bt,gwe as bu,V4 as bv,np as bw,iN as bx,P3 as by,qg as bz,qwe as c,wX as c0,gk as c1,xX as c2,c_e as c3,FQ as c4,a_e as c5,Mp as c6,i_e as c7,bX as c8,$M as c9,k_e as ca,r_e as cb,w_e as cc,Sv as cd,Ec as ce,wv as cf,__e as cg,x_e as ch,d_e as ci,qs as cj,l_e as ck,u_e as cl,UQ as cm,y_e as cn,_v as co,xv as cp,v_e as cq,s_e as cr,g_e as cs,m_e as ct,Ve as cu,o_e as cv,ct as cw,Bwe as d,Sl as e,iwe as f,Il as g,J9 as h,rwe as i,awe as j,wi as k,Ud as l,No as m,tm as n,Wr as o,Ywe as p,B as q,op as r,xe as s,ae as t,T as u,_ as v,c9 as w,Fwe as x,a9 as y,dN as z}; diff --git a/apps/kimi-code/dist-web/assets/index10-DTJJNuIm.js b/apps/kimi-code/dist-web/assets/index10-DTJJNuIm.js new file mode 100644 index 0000000000..bf06061535 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index10-DTJJNuIm.js @@ -0,0 +1,2 @@ +import{bQ as Ve,M as Ze,c0 as Ne,bT as De,bl as Ie,af as Xe,bZ as Ye,bE as b,aU as m,as as X,aD as _e,cc as Fe,az as Oe,aL as u,u as c,aY as ue,v as t,bk as s,bb as O,au as x,t as $,aw as ce,bL as Ue,bB as Re,s as Ae,I as qe,bJ as Ge,bO as Je,g as Ke,T as Qe,q as M,cd as Te,ce as W,cf as We,c8 as He,c2 as e1,cg as n1,b$ as o1}from"./index-DtRfJ0vw.js";var ee=(Y,ve,l)=>new Promise((a,U)=>{var L=r=>{try{B(l.next(r))}catch(p){U(p)}},w=r=>{try{B(l.throw(r))}catch(p){U(p)}},B=r=>r.done?a(r.value):Promise.resolve(r.value).then(L,w);B((l=l.apply(Y,ve)).next())});const t1=["data-markstream-mode"],l1={key:0,class:"infographic-block-header flex justify-between items-center border-b"},a1={key:0},i1={key:1,class:"flex items-center gap-x-2 overflow-hidden"},r1=["innerHTML"],s1={key:2},u1={key:3,class:"infographic-mode-toggle flex items-center gap-0.5"},c1=["disabled"],d1={class:"flex items-center gap-x-1"},v1={class:"flex items-center gap-x-1"},m1={key:4},h1={key:5,class:"infographic-header-actions flex items-center"},p1=["aria-pressed"],w1={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"},f1={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"},g1=["disabled"],C1=["disabled"],k1={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"},x1={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"},y1={key:0,class:"infographic-source"},b1={class:"infographic-source-code text-sm font-mono whitespace-pre-wrap"},M1={key:1,class:"relative"},B1={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},F1={class:"flex items-center gap-2 backdrop-blur rounded-lg"},T1={class:"dialog-panel infographic-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},H1={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},ne="infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",de=Ve(Ze({__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(Y,{emit:ve}){const l=Y,{t:a}=Ne(),U=De(),L=m(!1),w=m(!1),B=m(),r=m(),p=m(!0),me=m(!1),F=m(!1),z=m(),R=m(null),j=m(!1),_=m(null),S=m(typeof window>"u"),$e=Ie(),g=Xe(Ye,null);let T="";const he=M(()=>o1(l,$e));typeof window<"u"&&b(()=>B.value,n=>{var e;if((e=_.value)==null||e.destroy(),_.value=null,!n)return void(S.value=!1);const o=U(n,{rootMargin:"160px"});_.value=o,S.value=o.isVisible.value,o.whenVisible.then(()=>{S.value=!0})},{immediate:!0});const P=M(()=>l.node.code),oe=M(()=>{var n;return(function(e){if(l.maxHeight==="none")return Te(e,void 0,null);const o=W(l.maxHeight);return Te(e,void 0,o)})((n=W(l.estimatedPreviewHeightPx))!=null?n:We(P.value))}),te=m(`${oe.value}px`),je=M(()=>W(l.estimatedPreviewHeightPx)!=null);function pe(){var n;if(!r.value||je.value)return;const e=r.value.scrollHeight;if(e>0){const o=(n=W((function(d){if(l.maxHeight==="none")return`${d}px`;if(l.maxHeight!=null){const C=Number.parseFloat(String(l.maxHeight));if(Number.isFinite(C))return`${Math.min(d,C)}px`}const H=r.value;if(H){const C=getComputedStyle(H).getPropertyValue("--ms-size-code-max-height").trim(),i=Number.parseFloat(C);if(Number.isFinite(i))return`${Math.min(d,i)}px`}return`${Math.min(d,500)}px`})(e)))!=null?n:e;te.value=`${Math.max(o,oe.value)}px`}}const y=m(1),V=m(0),Z=m(0),N=m(!1),A=m({x:0,y:0}),Pe=M(()=>P.value);function we(n){return!n||n.disabled}function h(n,e,o="top"){if(we(n.currentTarget))return;const d=n,H=d?.clientX!=null&&d?.clientY!=null?{x:d.clientX,y:d.clientY}:void 0;He(n.currentTarget,e,o,!1,H,l.isDark)}function v(){e1()}function fe(n){if(we(n.currentTarget))return;const e=L.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=n,d=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;He(n.currentTarget,e,"top",!1,d,l.isDark)}function Ee(){return ee(this,null,function*(){try{const n=P.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n)),L.value=!0,setTimeout(()=>{L.value=!1},1e3)}catch(n){console.error("Failed to copy:",n)}})}function ge(n){(n!=="preview"||Fe())&&(me.value=!0,p.value=n==="source")}function Le(){var n;const e=(n=r.value)==null?void 0:n.querySelector("svg");e?(function(o){ee(this,null,function*(){try{const d=new XMLSerializer().serializeToString(o),H=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),C=URL.createObjectURL(H);if(typeof document<"u"){const i=document.createElement("a");i.href=C,i.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(i),i.click(),document.body.removeChild(i)}catch{}URL.revokeObjectURL(C)}}catch(d){console.error("Failed to export SVG:",d)}})})(e):console.error("SVG element not found")}function le(n){n.key==="Escape"&&F.value&&ae()}function ae(){if(F.value=!1,z.value&&(z.value.innerHTML=""),R.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",le)}catch{}}function ze(){(function(){if(F.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",le)}catch{}X(()=>{if(r.value&&z.value){z.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=r.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="auto",n.appendChild(e),z.value.appendChild(n),R.value=n,n.style.transform=`translate(${V.value}px, ${Z.value}px) scale(${y.value})`}})})()}function Ce(){y.value<3&&(y.value+=.1)}function ke(){y.value>.5&&(y.value-=.1)}function xe(){y.value=1,V.value=0,Z.value=0}function q(n){N.value=!0,n instanceof MouseEvent?A.value={x:n.clientX-V.value,y:n.clientY-Z.value}:A.value={x:n.touches[0].clientX-V.value,y:n.touches[0].clientY-Z.value}}function G(n){if(!N.value)return;let e,o;n instanceof MouseEvent?(e=n.clientX,o=n.clientY):(e=n.touches[0].clientX,o=n.touches[0].clientY),V.value=e-A.value.x,Z.value=o-A.value.y}function D(){N.value=!1}let f=null,ie=!1,re=!1,J=!1,K="";function ye(n=!1){return ee(this,null,function*(){var e,o;if(!S.value||!r.value)return;if(ie)return re=!0,void(J=J||n);const d=Pe.value;if(!n&&d===K&&j.value)return;ie=!0,(function(){const i=he.value;i&&T!==i&&(T&&g?.markSettled(T),T=i,g?.markPending(i))})();const H=r.value.innerHTML,C=j.value;try{const i=yield n1();if(!i)return void console.warn("Infographic library failed to load.");f&&((e=f.destroy)==null||e.call(f),f=null),r.value.innerHTML="",f=new i({container:r.value,width:"100%",height:"100%"});let E="";if((o=f.on)==null||o.call(f,"error",se=>{E=(Array.isArray(se)?se:[se]).map(k=>{var Be;return k instanceof Error?k.message:typeof k=="string"?k:String(k&&typeof k=="object"&&"message"in k?(Be=k.message)!=null?Be:"":k??"")}).filter(Boolean).join("; ")}),f.render(P.value),E)throw new Error(E);if(!r.value.childNodes.length)throw new Error("Infographic render returned empty output.");j.value=!0,K=d,X(()=>{pe()})}catch(i){l.loading===!1?(console.error("Failed to render infographic:",i),j.value=!1,K="",r.value&&(r.value.innerHTML=`
      Failed to render infographic: ${i instanceof Error?i.message:"Unknown error"}
      `)):(j.value=C,C&&r.value&&(r.value.innerHTML=H))}finally{if(ie=!1,re){const i=J;re=!1,J=!1,X(()=>{ye(i)})}else(function(){ee(this,null,function*(){const i=T;i&&(T="",yield X(),(function(E=he.value){E&&B.value&&g?.reportHeight(E,B.value.offsetHeight)})(i),g?.markSettled(i))})})()}})}function I(n=!1){!S.value||p.value||w.value||X(()=>{ye(n)})}b(()=>P.value,()=>{I(!0)}),b(()=>l.loading,(n,e)=>{e&&!n&&I(!0)}),b(()=>p.value,n=>{n||I(!0)}),b(()=>w.value,n=>{n||I()}),b(()=>l.maxHeight,()=>{X(()=>{pe()})}),b([()=>l.estimatedPreviewHeightPx,()=>P.value],()=>{j.value||p.value||(te.value=`${oe.value}px`)}),b(()=>S.value,n=>{!n||p.value||w.value||I()}),_e(()=>{!me.value&&Fe(),I()}),Oe(()=>{var n,e;if((n=_.value)==null||n.destroy(),_.value=null,(function(){const o=T;o&&(T="",g?.markSettled(o))})(),f&&((e=f.destroy)==null||e.call(f),f=null),K="",typeof window<"u")try{window.removeEventListener("keydown",le)}catch{}});const be=M(()=>!0),Q=M(()=>p.value||w.value),Se=M(()=>p.value?"fallback":j.value?"preview":"pending"),Me=M(()=>({transform:`translate(${V.value}px, ${Z.value}px) scale(${y.value})`}));return b(Me,n=>{F.value&&R.value&&(R.value.style.transform=n.transform)}),(n,e)=>(u(),c("div",{ref_key:"viewportTarget",ref:B,class:x(["infographic-block-container rounded-lg border overflow-hidden",[{"is-rendering":l.loading,dark:l.isDark}]]),"data-markstream-infographic":"1","data-markstream-mode":Se.value},[l.showHeader?(u(),c("div",l1,[n.$slots["header-left"]?(u(),c("div",a1,[ue(n.$slots,"header-left",{},void 0,!0)])):(u(),c("div",i1,[t("span",{class:"icon-slot action-icon shrink-0",innerHTML:s(` +`)},null,8,r1),e[21]||(e[21]=t("span",{class:"infographic-label font-medium font-mono truncate"},"Infographic",-1))])),n.$slots["header-center"]?(u(),c("div",s1,[ue(n.$slots,"header-center",{},void 0,!0)])):l.showModeToggle?(u(),c("div",u1,[t("button",{class:x(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[p.value?"":"is-active",be.value?"opacity-50 cursor-not-allowed":""]]),disabled:be.value,onClick:e[0]||(e[0]=()=>ge("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",d1,[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,O(s(a)("common.preview")||"Preview"),1)])],42,c1),t("button",{class:x(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[p.value?"is-active":""]]),onClick:e[3]||(e[3]=()=>ge("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",v1,[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,O(s(a)("common.source")||"Source"),1)])],34)])):$("",!0),n.$slots["header-right"]?(u(),c("div",m1,[ue(n.$slots,"header-right",{},void 0,!0)])):(u(),c("div",h1,[l.showCollapseButton?(u(),c("button",{key:0,class:x(ne),"aria-pressed":w.value,onClick:e[6]||(e[6]=o=>w.value=!w.value),onMouseenter:e[7]||(e[7]=o=>h(o,w.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onFocus:e[8]||(e[8]=o=>h(o,w.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onMouseleave:v,onBlur:v},[(u(),c("svg",{style:ce({rotate:w.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,p1)):$("",!0),l.showCopyButton?(u(),c("button",{key:1,class:x(ne),onClick:Ee,onMouseenter:e[9]||(e[9]=o=>fe(o)),onFocus:e[10]||(e[10]=o=>fe(o)),onMouseleave:v,onBlur:v},[L.value?(u(),c("svg",f1,[...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)])])):(u(),c("svg",w1,[...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)):$("",!0),l.showExportButton?(u(),c("button",{key:2,class:x(`${ne} ${Q.value?"opacity-50 cursor-not-allowed":""}`),disabled:Q.value,onClick:Le,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,g1)):$("",!0),l.showFullscreenButton?(u(),c("button",{key:3,class:x(`${ne} ${Q.value?"opacity-50 cursor-not-allowed":""}`),disabled:Q.value,onClick:ze,onMouseenter:e[13]||(e[13]=o=>h(o,F.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onFocus:e[14]||(e[14]=o=>h(o,F.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onMouseleave:v,onBlur:v},[F.value?(u(),c("svg",x1,[...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)])])):(u(),c("svg",k1,[...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,C1)):$("",!0)]))])):$("",!0),Ue(t("div",null,[p.value?(u(),c("div",y1,[t("pre",b1,O(P.value),1)])):(u(),c("div",M1,[l.showZoomControls?(u(),c("div",B1,[t("div",F1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Ce,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:ke,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:xe,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},O(Math.round(100*y.value))+"% ",33)])])):$("",!0),t("div",{class:"infographic-preview relative transition-all overflow-hidden block",style:ce({height:te.value}),onMousedown:q,onMousemove:G,onMouseup:D,onMouseleave:D,onTouchstartPassive:q,onTouchmovePassive:G,onTouchendPassive:D},[t("div",{class:x(["absolute inset-0 cursor-grab",{"cursor-grabbing":N.value}]),style:ce(Me.value)},[t("div",{ref_key:"infographicContainer",ref:r,class:"w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],36)]))],512),[[Re,!w.value]]),(u(),Ae(Qe,{to:"body"},[t("div",{class:x(["markstream-vue",{dark:l.isDark}])},[qe(Ke,{name:"infographic-dialog",appear:""},{default:Ge(()=>[F.value?(u(),c("div",{key:0,class:"infographic-modal-overlay fixed inset-0 z-50 flex items-center justify-center p-4",onClick:Je(ae,["self"])},[t("div",T1,[t("div",H1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Ce},[...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:ke},[...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:xe},O(Math.round(100*y.value))+"% ",1),t("button",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",onClick:ae},[...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:z,class:x(["w-full h-full flex items-center justify-center p-4 overflow-hidden",{"cursor-grab":!N.value,"cursor-grabbing":N.value}]),onMousedown:q,onMousemove:G,onMouseup:D,onMouseleave:D,onTouchstartPassive:q,onTouchmovePassive:G,onTouchendPassive:D},null,34)])])):$("",!0)]),_:1})],2)]))],10,t1))}}),[["__scopeId","data-v-3321af9c"]]);de.install=Y=>{Y.component(de.__name,de)};export{de as default}; diff --git a/apps/kimi-code/dist-web/assets/index11-CwW_hjK7.js b/apps/kimi-code/dist-web/assets/index11-CwW_hjK7.js new file mode 100644 index 0000000000..d5d40b06be --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index11-CwW_hjK7.js @@ -0,0 +1,8 @@ +import{cm as St,bQ as Tn,M as Cn,c0 as Bn,bT as Sn,bl as Pn,af as $n,bZ as On,aU as m,bE as N,az as Dn,c2 as tn,aD as En,as as R,aI as Fn,cn as nn,aL as b,u as M,aY as xt,v as i,bk as w,bb as Ne,au as re,t as ce,aw as bt,bL as zn,bB as jn,ar as ln,bd as rn,s as Ln,I as Hn,bJ as An,bO as Nn,g as Rn,T as _n,q as E,c8 as on,ce as Mt,co as Xn,cp as Yn,cq as qn,cr as Vn,b$ as In,cs as Zn,ct as Un}from"./index-DtRfJ0vw.js";import{i as Tt}from"./safeRaf-DGuzXxDK.js";function Wn(c,h){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(c.slice(Math.max(0,h-12),h))}function cn(c){return c.includes("->")||c.includes("-->")||c.includes("->>")||c.includes("-->>")||c.includes("-x")||c.includes("--x")||c.includes("-)")||c.includes("--)")||c.includes("-+")||c.includes("--+")}function Gn(c){const h=c.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(h)||(function(y){const F=y.split(";",1)[0],a=F.indexOf(":");return a>0&&cn(F.slice(0,a))})(h)}function Jn(c){if(!c.includes(";"))return c;const h=c.indexOf(":");if(h===-1||!(function($,K){const k=$.slice(0,K);return/^\s*Note\b/i.test(k)||cn(k)})(c,h))return c;const y=c.slice(0,h+1),F=c.slice(h+1),a=(function($){let K="",k=!1;for(let O=0;O<$.length;O++){const Y=$[O];Y!==";"||Wn($,O)||Gn($.slice(O+1))?K+=Y:(K+="#59;",k=!0)}return k?K:$})(F);return a===F?c:`${y}${a}`}function Ct(c){if(St(c)!=="sequencediagram")return c;const h=c.split(/(\r\n|\n|\r)/);let y=!1;for(let F=0;Fh in c?Kn(c,h,{enumerable:!0,configurable:!0,writable:!0,value:y}):c[h]=y,sn=(c,h)=>{for(var y in h||(h={}))tl.call(h,y)&&un(c,y,h[y]);if(an)for(var y of an(h))nl.call(h,y)&&un(c,y,h[y]);return c},C=(c,h,y)=>new Promise((F,a)=>{var $=O=>{try{k(y.next(O))}catch(Y){a(Y)}},K=O=>{try{k(y.throw(O))}catch(Y){a(Y)}},k=O=>O.done?F(O.value):Promise.resolve(O.value).then($,K);k((y=y.apply(c,h)).next())});const ll=["data-markstream-mode","data-markstream-pending"],rl={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)]"},ol={key:0},al={key:1,class:"flex items-center gap-x-2 overflow-hidden"},il=["innerHTML"],ul={key:2},sl={key:3,class:"mermaid-mode-toggle-group flex items-center gap-0.5"},cl={class:"flex items-center gap-x-1"},dl={class:"flex items-center gap-x-1"},vl={key:4},ml={key:5,class:"mermaid-header-actions flex items-center"},fl=["aria-pressed"],hl={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"},pl={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"},gl=["aria-label","disabled"],wl=["aria-label","disabled"],yl={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"},kl={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"},xl={key:0,class:"mermaid-source-panel"},bl={class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap"},Ml={key:1,class:"relative"},Tl={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Cl={class:"flex items-center gap-2 backdrop-blur rounded-lg"},Bl={class:"dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},Sl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},at="mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded",Bt=Tn(Cn({__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(c,{emit:h}){var y,F;const a=c,$=h,K={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},k=m(!1),O=m(typeof window>"u"),Y=E(()=>a.isStrict?"strict":"loose"),dn=E(()=>({startOnLoad:!1,securityLevel:Y.value,dompurifyConfig:Y.value==="strict"?K:void 0,flowchart:Y.value==="strict"?{htmlLabels:!1}:void 0}));function de(t){if(t)try{t.replaceChildren()}catch{t.innerHTML=""}}function we(t,e,n={}){if(!t)return null;const l=(function(r,o){if(!r)return null;const d=Vn(o);if(!d)return null;const s=(function(g,u){const f=Array.from(g.childNodes),S=document.createElement("div");return S.dataset.mermaidSvgLayer="1",S.style.zIndex="1",S.appendChild(u),g.insertBefore(S,g.firstChild),f.length>0&&(function(G){const J=()=>{var X;for(const ge of G)(X=ge.parentNode)==null||X.removeChild(ge)};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{requestAnimationFrame(J)}):setTimeout(J,32)})(f),S})(r,d);return{svg:d.outerHTML,bindTarget:s}})(t,e);return l||n.keepPreviousOnFailure||de(t),l}let oe=null;function ve(t){if(a.enableMermaidInteractions&&t?.querySelector("svg"))try{oe?.(t)}catch{}}const{t:p}=Bn();function Re(){return C(this,null,function*(){try{const t=yield Un();return k.value=!!t,t}catch(t){throw k.value=!1,t}finally{O.value=!0}})}const _e=m(!1),q=m(!1),it=m(),V=m(),v=m(),ae=m(),Xe=m(null),vn=Sn(),Be=m(null),Se=m(typeof window>"u"),mn=Pn(),Q=$n(On,null);let ie="",me=0,Ye=0;const Pt=E(()=>In(a,mn));function ut(){const t=Pt.value;t&&(ie&&ie!==t&&(Q?.markSettled(ie),me=0),ie=t,me+=1,Ye+=1,me===1&&Q?.markPending(t))}function st(){return C(this,null,function*(){const t=ie;if(!t||(me=Math.max(0,me-1),me>0))return;ie="";const e=++Ye;yield R(),e===Ye&&((function(n=Pt.value){n&&it.value&&Q?.reportHeight(n,it.value.offsetHeight)})(t),Q?.markSettled(t))})}function $t(){const t=ie;t&&(ie="",me=0,Ye+=1,Q?.markSettled(t))}const Ot=m(),z=E(()=>a.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function Dt(){var t;return(function(e){const n=(function(){var r;const o=V.value?getComputedStyle(V.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";return(r=Mt(o))!=null?r:360})(),l=It();return Xn(e,n,l)})((t=Mt(a.estimatedPreviewHeightPx))!=null?t:Yn(z.value))}function Et(){return`${Dt()}px`}const ye=m(null);function ct(){var t;return!!((t=v.value)!=null&&t.querySelector("svg"))}function Ft(){return a.loading!==!1&&(ct()||!!ye.value)}const T=m(1),L=m(0),H=m(0),qe=m(!1),Ve=m({x:0,y:0}),x=m(!0),Ie=m(!1),ne=m(!1),Pe=m(null),Ze=m(0),dt=m(!1),fn=E(()=>{var t;return Math.max(0,(t=a.renderDebounceMs)!=null?t:300)}),hn=E(()=>{var t;return Math.max(0,(t=a.contentStableDelayMs)!=null?t:500)}),$e=E(()=>{var t;return Math.max(120,(t=a.previewPollDelayMs)!=null?t:800)}),pn=E(()=>{var t;return Math.max($e.value,(t=a.previewPollMaxDelayMs)!=null?t:4e3)}),zt=E(()=>{var t;return Math.max(1,Math.trunc((t=a.previewPollMaxAttempts)!=null?t:12))}),ue=E(()=>a.loading!==!1);let Oe=null,De=null,Ee=null,Fe=0;const jt=(y=globalThis.requestIdleCallback)!=null?y:(t,e)=>setTimeout(()=>t({didTimeout:!0}),16);function I(){return Se.value&&!q.value}function Ue(){Ee!=null&&(globalThis.clearTimeout(Ee),Ee=null)}function ze(){Ue(),Ee=globalThis.setTimeout(()=>{Ee=null,I()&&jt(()=>{I()&&en()},{timeout:500})},fn.value)}function je(){De!=null&&(globalThis.clearTimeout(De),De=null)}function Lt(t=600){if(typeof globalThis>"u")return;const e=Math.max(0,t);je(),De=globalThis.setTimeout(()=>{De=null,a.loading||ne.value||!I()?Lt(Math.min(1200,Math.max(300,1.2*e))):ze()},e)}const _=m(Et()),We=m(_.value);let ke=null;const B=m(!1),fe=m(!1),se=m({}),le=m(""),vt=m(0);let Z=null;const A=m(!1),gn=E(()=>{var t,e;return!(q.value||O.value&&(x.value||!ne.value&&!Pe.value&&(B.value||A.value&&((e=(t=v.value)==null?void 0:t.textContent)!=null&&e.trim()))))}),he=m({zoom:1,translateX:0,translateY:0,containerHeight:_.value}),Ht=E(()=>a.enableWheelZoom?{wheel:yn}:{}),W=E(()=>{var t,e,n,l;return{worker:(t=a.workerTimeoutMs)!=null?t:1400,parse:(e=a.parseTimeoutMs)!=null?e:1800,render:(n=a.renderTimeoutMs)!=null?n:2500,fullRender:(l=a.fullRenderTimeoutMs)!=null?l:4e3}}),wn=(F=globalThis.cancelIdleCallback)!=null?F:t=>clearTimeout(t);let xe=null,Ge=null,be=!1,pe=$e.value,ee=null,Je=0,mt=!0,Ke=0;function Me(t,e){const n=e?.timeoutMs,l=e?.signal;if(l?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let r=null,o=!1,d=null;return new Promise((s,g)=>{const u=()=>{r!=null&&clearTimeout(r),d&&l&&l.removeEventListener("abort",d)};n&&n>0&&(r=globalThis.setTimeout(()=>{o||(o=!0,u(),g(new Error("Operation timed out")))},n)),l&&(d=()=>{o||(o=!0,u(),g(new DOMException("Aborted","AbortError")))},l.addEventListener("abort",d)),t().then(f=>{o||(o=!0,u(),s(f))}).catch(f=>{o||(o=!0,u(),g(f))})})}function At(t){if(typeof document>"u"||!v.value)return;if(typeof a.onRenderError=="function"&&a.onRenderError(t,z.value,v.value)===!0)return A.value=!0,void j();const e=document.createElement("div");e.style.padding="var(--ms-inset-panel-body)",e.style.color="hsl(var(--ms-destructive))",e.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=t instanceof Error?t.message:"Unknown error",e.appendChild(n),de(v.value),v.value.appendChild(e);const l=v.value?getComputedStyle(v.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";_.value=l||"360px",We.value=_.value,A.value=!0,j()}function Nt(t){const e=typeof t=="string"?t:typeof t?.message=="string"?t.message:"";return typeof e=="string"&&/timed out/i.test(e)}function ft(t){return!Nt(t)&&!(function(e){return e?.name==="AbortError"})(t)}typeof window<"u"&&N(()=>V.value,t=>{var e;if((e=Be.value)==null||e.destroy(),Be.value=null,!t)return void(Se.value=!1);const n=vn(t,{rootMargin:"400px"});Be.value=n,Se.value=n.isVisible.value,n.whenVisible.then(()=>{Se.value=!0})},{immediate:!0}),Dn(()=>{var t;(t=Be.value)==null||t.destroy(),Be.value=null,$t(),Ue()});const Qe=E(()=>a.showTooltips!==!1);function Rt(t){return!t||t.disabled}function D(t,e,n="top"){if(!Qe.value||Rt(t.currentTarget))return;const l=t,r=l?.clientX!=null&&l?.clientY!=null?{x:l.clientX,y:l.clientY}:void 0;on(t.currentTarget,e,n,!1,r,a.isDark)}function P(){Qe.value&&tn()}function _t(t){if(!Qe.value||Rt(t.currentTarget))return;const e=_e.value?p("common.copied")||"Copied":p("common.copy")||"Copy",n=t,l=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;on(t.currentTarget,e,"top",!1,l,a.isDark)}function Xt(t,e){const n={theme:e==="dark"?"dark":"default"};Y.value==="strict"&&(n.flowchart={htmlLabels:!1});const l=`%%{init: ${JSON.stringify(n)}}%% +`;return t.trimStart().startsWith("%%{")?t:l+t}function ht(){return mt&&!x.value&&!B.value&&!A.value}function Yt(t){const e=t.trim();return!(!e||e.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(e)&&e.includes(":")}function pt(t){if(St(t)==="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(Yt(o))break;r.pop()}else r.pop()}return r.some(Yt)?r.join(` +`):""})(t);const e=t.split(/\r?\n/);for(;e.length>0;){const n=e[e.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;e.pop()}else e.pop()}return e.join(` +`)}function qt(t,e,n,l){return C(this,null,function*(){try{return yield Me(()=>t.render(e,n),{timeoutMs:l})}catch(r){if(!ft(r))throw r;const o=Ct(n);if(o===n)throw r;try{return yield Me(()=>t.render(`${e}-retry`,o),{timeoutMs:l})}catch{throw r}}})}function et(t,e,n){return C(this,null,function*(){var l;try{return yield Zn(t,e,(l=n?.timeoutMs)!=null?l:W.value.worker)}catch{return yield(function(o,d,s){return C(this,null,function*(){var g,u,f,S;const G=yield Re();if(!G)return;const J=G,X=Xt(o,d);if(typeof J.parse=="function"){try{yield Me(()=>J.parse(X),{timeoutMs:(g=s?.timeoutMs)!=null?g:W.value.parse,signal:s?.signal})}catch(U){if(!ft(U))throw U;const Ae=Ct(X);if(Ae===X)throw U;try{yield Me(()=>J.parse(Ae),{timeoutMs:(u=s?.timeoutMs)!=null?u:W.value.parse,signal:s?.signal})}catch{throw U}}return!0}const ge=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;try{yield Me(()=>G.render(ge,X),{timeoutMs:(f=s?.timeoutMs)!=null?f:W.value.render,signal:s?.signal})}catch(U){if(!ft(U))throw U;const Ae=Ct(X);if(Ae===X)throw U;try{yield Me(()=>G.render(`${ge}-retry`,Ae),{timeoutMs:(S=s?.timeoutMs)!=null?S:W.value.render,signal:s?.signal})}catch{throw U}}return!0})})(t,e,n)}})}function Vt(t,e,n){return C(this,null,function*(){var l;if(St(t)==="gantt"){const o=pt(t);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield et(o,e,n))return o===t?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(d){if(d?.name==="AbortError")throw d}return{fullOk:!1,prefixOk:!1}}try{if(yield et(t,e,n))return{fullOk:!0,prefixOk:!1}}catch(o){if(o?.name==="AbortError")throw o}let r=pt(t);if(r&&r.trim()&&r!==t)try{try{const o=yield qn(t,e,(l=n?.timeoutMs)!=null?l:W.value.worker);o&&o.trim()&&(r=o)}catch{}if(yield et(r,e,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(o){if(o?.name==="AbortError")throw o}return{fullOk:!1,prefixOk:!1}})}const tt=E(()=>x.value||ne.value||q.value);function It(){if(a.maxHeight==="none")return null;if(a.maxHeight!=null){const e=Number.parseFloat(String(a.maxHeight));if(Number.isFinite(e))return e}const t=V.value;if(t){const e=getComputedStyle(t).getPropertyValue("--ms-size-code-max-height").trim(),n=Number.parseFloat(e);if(Number.isFinite(n))return n}return 500}function Le(t,e){if(!V.value||!v.value)return;const n=!e?.force&&a.loading!==!1&&ct(),l=v.value.querySelector("svg");if(!l)return;let r=0,o=0;const d=l.getAttribute("viewBox"),s=l.getAttribute("width"),g=l.getAttribute("height");if(d){const u=d.split(" ");u.length===4&&(r=Number.parseFloat(u[2]),o=Number.parseFloat(u[3]))}if(r&&o||s&&g&&(r=Number.parseFloat(s),o=Number.parseFloat(g)),Number.isNaN(r)||Number.isNaN(o)||r<=0||o<=0)try{const u=l.getBBox();u&&u.width>0&&u.height>0&&(r=u.width,o=u.height)}catch(u){return void console.error("Failed to get SVG BBox:",u)}if(r>0&&o>0){const u=o/r,f=t??V.value.clientWidth,S=l.getBoundingClientRect().width,G=S>0?S:f,J=It(),X=G*u,ge=J==null?X:Math.min(X,J),U=Math.max(ge,Dt());We.value=`${Math.max(X,U)}px`,n||Mt(a.estimatedPreviewHeightPx)!=null||(_.value=`${U}px`)}}const te=m(!1),gt=E(()=>({transform:`translate(${L.value}px, ${H.value}px) scale(${T.value})`}));function Zt(t){t.key==="Escape"&&te.value&&yt()}function wt(){var t;if(!V.value||!ae.value)return!1;if(((t=ae.value.firstElementChild)==null?void 0:t.getAttribute("data-mermaid-modal-clone"))==="1")return!0;const e=V.value.cloneNode(!0);e.dataset.mermaidModalClone="1",e.classList.add("fullscreen"),e.style.height="100%",e.style.maxHeight="100%";const n=e.querySelector("[data-mermaid-wrapper]");return n&&(Xe.value=n,n.style.transform=gt.value.transform),de(ae.value),ae.value.appendChild(e),ve(e),!0}function yt(){if(te.value=!1,ae.value&&de(ae.value),Xe.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",Zt)}catch{}}function Ut(){T.value<3&&(T.value+=.1)}function Wt(){T.value>.5&&(T.value-=.1)}function Gt(){T.value=1,L.value=0,H.value=0}function nt(t){qe.value=!0,t instanceof MouseEvent?Ve.value={x:t.clientX-L.value,y:t.clientY-H.value}:Ve.value={x:t.touches[0].clientX-L.value,y:t.touches[0].clientY-H.value}}function lt(t){if(!qe.value)return;let e,n;t instanceof MouseEvent?(e=t.clientX,n=t.clientY):(e=t.touches[0].clientX,n=t.touches[0].clientY),L.value=e-Ve.value.x,H.value=n-Ve.value.y}function Te(){qe.value=!1}function yn(t){if(a.enableWheelZoom&&(t.ctrlKey||t.metaKey)){if(t.preventDefault(),!V.value)return;const e=V.value.getBoundingClientRect(),n=t.clientX-e.left,l=t.clientY-e.top,r=n-e.width/2,o=l-e.height/2,d=(r-L.value)/T.value,s=(o-H.value)/T.value,g=.01,u=-t.deltaY*g,f=Math.min(Math.max(T.value+u,.5),3);f!==T.value&&(L.value=r-d*f,H.value=o-s*f,T.value=f)}}function kn(){return C(this,null,function*(){try{const t=z.value,e={payload:{type:"copy",text:t},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};if($("copy",e),e.defaultPrevented)return;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),_e.value=!0,setTimeout(()=>{_e.value=!1},1e3)}catch(t){console.error("Failed to copy:",t)}})}function xn(){var t;const e=(t=v.value)==null?void 0:t.querySelector("svg");if(!e)return void console.error("SVG element not found");const n=new XMLSerializer().serializeToString(e),l={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:e,svgString:n};$("export",l),l.defaultPrevented||(function(r,o=null){C(this,null,function*(){try{const d=o??new XMLSerializer().serializeToString(r),s=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),g=URL.createObjectURL(s);if(typeof document<"u"){const u=document.createElement("a");u.href=g,u.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(u),u.click(),document.body.removeChild(u)}catch{}URL.revokeObjectURL(g)}}catch(d){console.error("Failed to export SVG:",d)}})})(e,n)}function bn(){var t,e;const n=(e=(t=v.value)==null?void 0:t.querySelector("svg"))!=null?e:null,l=n?new XMLSerializer().serializeToString(n):null,r={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:l};$("openModal",r),r.defaultPrevented||(function(){if(te.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",Zt)}catch{}R(()=>{wt()||R(wt)})})()}function Jt(t){const e={payload:{type:"toggle-mode",target:t},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};$("toggleMode",t,e),e.defaultPrevented||Kt(t)}function Kt(t){return C(this,null,function*(){const e=Ot.value;if(!e)return Ie.value=!0,void(x.value=t==="source");const n=e.getBoundingClientRect().height;e.style.height=`${n}px`,e.style.overflow="hidden",Ie.value=!0,x.value=t==="source",yield R();const l=e.scrollHeight;e.style.transition="height var(--ms-duration-standard) var(--ms-ease-standard)",e.offsetHeight,e.style.height=`${l}px`;const r=()=>{e.style.transition="",e.style.height="",e.style.overflow="",e.removeEventListener("transitionend",o)};function o(){r()}e.addEventListener("transitionend",o),setTimeout(()=>r(),220)})}function He(){return C(this,null,function*(){return ne.value?Pe.value:v.value||(yield R(),v.value)?(ne.value=!0,ut(),Pe.value=C(null,null,function*(){var t,e,n,l;try{const r=yield Re();if(!r)return;const o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;B.value||fe.value||(t=r.initialize)==null||t.call(r,(n=sn({},dn.value),l={dompurifyConfig:sn({},K)},Qn(n,el(l))));const d=(function(u,f=z.value){const S=f,G={theme:u==="dark"?"dark":"default"};Y.value==="strict"&&(G.flowchart={htmlLabels:!1});const J=`%%{init: ${JSON.stringify(G)}}%% +`;return S.trim().startsWith("%%{")?S:J+S})(a.isDark?"dark":"light"),s=yield qt(r,o,d,W.value.fullRender),g=s?.svg;if(v.value){const u=we(v.value,g,{keepPreviousOnFailure:a.loading!==!1});if(!u)return fe.value&&(fe.value=!1),!1;const f=(e=s?.bindFunctions)!=null?e:null;oe=f,ve(u.bindTarget),B.value||fe.value||(Tt(()=>Le()),B.value=!0,he.value={zoom:T.value,translateX:L.value,translateY:H.value,containerHeight:_.value});const S=a.isDark?"dark":"light";u&&(se.value[S]={svg:u.svg,bindFunctions:f}),fe.value&&(fe.value=!1),A.value=!1,Fe=0,je()}return!0}catch(r){const o=Nt(r),d=Fe+1;return o&&d<=3?(Fe=d,Lt(Math.min(1200,600*d))):(Fe=0,je(),a.loading===!1&&console.error("Failed to render mermaid diagram:",r),a.loading===!1&&At(r)),!1}finally{ne.value=!1,Pe.value=null,st()}}),Pe.value):void console.warn("Mermaid container not ready")})}function Ce(){return C(this,null,function*(){var t,e,n;const l=z.value;if(!l.trim())return Ft()?void 0:(v.value&&de(v.value),ye.value=null,le.value="",void(A.value=!1));if(!k.value||!I())return;const r=l.replace(/\s+/g,"");B.value&&r===le.value&&((t=v.value)!=null&&t.querySelector("svg"))||(yield He())&&(le.value=r,ye.value=(n=(e=v.value)==null?void 0:e.innerHTML)!=null?n:null,A.value=!1)})}function Qt(t){return C(this,null,function*(){var e;if(ht()&&(v.value||(yield R(),v.value))&&!ne.value){ne.value=!0,ut();try{const n=yield Re();if(!n)return;const l=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,r=a.isDark?"dark":"light",o=pt(t),d=Xt(o&&o.trim()?o:t,r),s=yield qt(n,l,d,W.value.render),g=s?.svg;if(v.value&&g){const u=we(v.value,g,{keepPreviousOnFailure:!0});u&&(oe=(e=s?.bindFunctions)!=null?e:null,ve(u.bindTarget),Tt(()=>Le()))}}catch{}finally{ne.value=!1,st()}}})}function en(){return C(this,null,function*(){var t,e,n;const l=Date.now(),r=++vt.value;ut();try{Z&&Z.abort(),Z=new AbortController;const o=Z.signal,d=a.isDark?"dark":"light",s=z.value,g=s.replace(/\s+/g,"");if(!s.trim())return Ft()?void 0:(v.value&&de(v.value),ye.value=null,le.value="",void(A.value=!1));if(g===le.value)return;try{const f=yield Vt(s,d,{signal:o,timeoutMs:W.value.worker});if(f.fullOk)return(yield He())?void(vt.value===r&&(ye.value=(e=(t=v.value)==null?void 0:t.innerHTML)!=null?e:null,le.value=g,A.value=!1)):void 0;const S=Je&&l<=Je;if(f.prefixOk&&f.prefix&&ht()&&!S)return void(yield Qt(f.prefix))}catch(f){if(f?.name==="AbortError")return}if(vt.value!==r||A.value)return;const u=se.value[d];if(u&&v.value){const f=we(v.value,u.svg);f&&(oe=(n=u.bindFunctions)!=null?n:null,ve(f.bindTarget))}}finally{st()}})}function j(){be&&(be=!1,pe=$e.value,mt=!1,ee&&(ee.abort(),ee=null),xe&&(globalThis.clearTimeout(xe),xe=null),Ge&&(wn(Ge),Ge=null),Je=Date.now())}function rt(){if(j(),Ue(),Z){try{Z.abort()}catch{}Z=null}if(ee){try{ee.abort()}catch{}ee=null}nn(),je(),Fe=0}function kt(t=$e.value){be&&(Ke>=zt.value?j():(xe&&globalThis.clearTimeout(xe),xe=globalThis.setTimeout(()=>{Ge=jt(()=>C(null,null,function*(){if(!be)return;if(!I()||x.value||B.value)return void j();const e=a.isDark?"dark":"light",n=z.value;if(!n.trim())return a.loading===!1?void j():void kt(pe);if(Ke++,Ke>zt.value)j();else{ee&&ee.abort(),ee=new AbortController;try{const l=yield Vt(n,e,{signal:ee.signal,timeoutMs:W.value.worker});if(l.fullOk){if((yield He())&&B.value)return void j()}else l.prefixOk&&l.prefix&&ht()&&(yield Qt(l.prefix))}catch{}pe=Math.min(Math.floor(1.5*pe),pn.value),kt(pe)}}),{timeout:500})},t)))}function ot(){be||ue.value&&k.value&&I()&&(x.value||B.value||(be=!0,Je=0,mt=!0,Ke=0,pe=$e.value,kt(pe)))}return N(ae,t=>{te.value&&t&&wt()}),N(gt,t=>{te.value&&Xe.value&&(Xe.value.style.transform=t.transform)},{immediate:!0}),N(Qe,t=>{t||tn()}),N(()=>z.value,t=>{if((t.trim()||a.loading===!1)&&(B.value=!1,se.value={}),!ue.value)return j(),void(I()&&!x.value&&Ce());I()&&ze(),!x.value&&k.value&&I()?ot():j(),(function(){if(!ue.value||!x.value||!k.value)return;const e=z.value.length;e!==Ze.value&&(dt.value=!0,Ze.value=e,Oe&&clearTimeout(Oe),Oe=setTimeout(()=>{dt.value&&x.value&&z.value.trim()&&(dt.value=!1,Kt("preview"))},hn.value))})()}),N(()=>a.isDark,()=>C(null,null,function*(){var t;if(!B.value||A.value)return;const e=a.isDark?"dark":"light",n=se.value[e];if(n){if(v.value){const o=we(v.value,n.svg);o&&(oe=(t=n.bindFunctions)!=null?t:null,ve(o.bindTarget))}return}const l={zoom:T.value,translateX:L.value,translateY:H.value,containerHeight:_.value},r=T.value!==1||L.value!==0||H.value!==0;fe.value=!0,r&&(T.value=1,L.value=0,H.value=0,yield R()),yield He(),r&&(yield R(),T.value=l.zoom,L.value=l.translateX,H.value=l.translateY,_.value=l.containerHeight,he.value=l)})),N(()=>x.value,t=>C(null,null,function*(){var e;if(t)j(),B.value&&(he.value={zoom:T.value,translateX:L.value,translateY:H.value,containerHeight:_.value});else{if(A.value)return;const n=a.isDark?"dark":"light";if(B.value&&se.value[n]){if(yield R(),v.value){const l=se.value[n],r=we(v.value,l.svg);r&&(oe=(e=l.bindFunctions)!=null?e:null,ve(r.bindTarget))}return T.value=he.value.zoom,L.value=he.value.translateX,H.value=he.value.translateY,void(_.value=he.value.containerHeight)}if(yield R(),!k.value||!I())return;if(!ue.value)return j(),void(yield Ce());ot(),yield en()}})),N(()=>a.loading,(t,e)=>C(null,null,function*(){var n;if(e===!0&&t===!1){const l=z.value.trim();if(!l)return v.value&&de(v.value),ye.value=null,le.value="",A.value=!1,rt();const r=a.isDark?"dark":"light",o=l.replace(/\s+/g,"");if(B.value&&o===le.value){if(yield R(),v.value&&!v.value.querySelector("svg")&&se.value[r]){const d=se.value[r],s=we(v.value,d.svg);s&&(oe=(n=d.bindFunctions)!=null?n:null,ve(s.bindTarget))}return Le(void 0,{force:!0}),void rt()}try{if(yield et(l,r,{timeoutMs:W.value.worker}),!(yield He()))return;le.value=o,A.value=!1,rt()}catch(d){rt(),At(d)}}})),N(V,t=>{ke&&ke.disconnect(),t&&(ke=new ResizeObserver(e=>{e&&e.length>0&&!x.value&&!q.value&&Tt(()=>{Le(e[0].contentRect.width)})}),ke.observe(t))},{immediate:!0}),En(()=>C(null,null,function*(){Re().catch(t=>{k.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}),yield R(),Ie.value||(x.value=!k.value),I()&&(ue.value?(ze(),Ze.value=z.value.length):x.value||Ce())})),N(()=>k.value,t=>{Ie.value||(x.value=!t)}),N(()=>a.maxHeight,()=>{R(()=>{Le()})}),N([()=>a.estimatedPreviewHeightPx,()=>z.value],()=>{B.value||ct()||x.value||(_.value=Et(),We.value=_.value)}),N(()=>Se.value,t=>{t&&(B.value||(ue.value?(ze(),Ze.value=z.value.length):Ce()),a.loading||B.value||Ce(),!x.value&&k.value&&ue.value&&ot())},{immediate:!1}),Fn(()=>{Oe&&clearTimeout(Oe),Ue(),ke&&ke.disconnect(),Z&&(Z.abort(),Z=null),nn(),j(),je(),$t()}),N(()=>q.value,t=>C(null,null,function*(){t?(j(),Z&&Z.abort()):I()&&!B.value&&(yield R(),ue.value?(ze(),ot()):x.value||Ce())}),{immediate:!1}),(t,e)=>(b(),M("div",{ref_key:"blockContainer",ref:it,class:re(["mermaid-block-container rounded-lg border overflow-hidden",[{"is-rendering":a.loading,dark:a.isDark}]]),"data-markstream-mermaid":"1","data-markstream-mode":x.value?"fallback":B.value?"preview":"pending","data-markstream-pending":gn.value?"true":void 0},[a.showHeader?(b(),M("div",rl,[t.$slots["header-left"]?(b(),M("div",ol,[xt(t.$slots,"header-left",{},void 0,!0)])):(b(),M("div",al,[i("span",{class:"icon-slot action-icon shrink-0",innerHTML:w(` + + +`)},null,8,il),e[21]||(e[21]=i("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate"},"Mermaid",-1))])),t.$slots["header-center"]?(b(),M("div",ul,[xt(t.$slots,"header-center",{},void 0,!0)])):a.showModeToggle&&k.value?(b(),M("div",sl,[i("button",{class:re(["mermaid-mode-btn px-2 py-0.5 rounded transition-colors",[x.value?"":"is-active"]]),onClick:e[0]||(e[0]=()=>Jt("preview")),onMouseenter:e[1]||(e[1]=n=>D(n,w(p)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=n=>D(n,w(p)("common.preview")||"Preview")),onMouseleave:P,onBlur:P},[i("div",cl,[e[22]||(e[22]=i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("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"}),i("circle",{cx:"12",cy:"12",r:"3"})])],-1)),i("span",null,Ne(w(p)("common.preview")||"Preview"),1)])],34),i("button",{class:re(["mermaid-mode-btn px-2 py-0.5 rounded transition-colors",[x.value?"is-active":""]]),onClick:e[3]||(e[3]=()=>Jt("source")),onMouseenter:e[4]||(e[4]=n=>D(n,w(p)("common.source")||"Source")),onFocus:e[5]||(e[5]=n=>D(n,w(p)("common.source")||"Source")),onMouseleave:P,onBlur:P},[i("div",dl,[e[23]||(e[23]=i("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"},[i("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)),i("span",null,Ne(w(p)("common.source")||"Source"),1)])],34)])):ce("",!0),t.$slots["header-right"]?(b(),M("div",vl,[xt(t.$slots,"header-right",{},void 0,!0)])):(b(),M("div",ml,[a.showCollapseButton?(b(),M("button",{key:0,class:re(at),"aria-pressed":q.value,onClick:e[6]||(e[6]=n=>q.value=!q.value),onMouseenter:e[7]||(e[7]=n=>D(n,q.value?w(p)("common.expand")||"Expand":w(p)("common.collapse")||"Collapse")),onFocus:e[8]||(e[8]=n=>D(n,q.value?w(p)("common.expand")||"Expand":w(p)("common.collapse")||"Collapse")),onMouseleave:P,onBlur:P},[(b(),M("svg",{style:bt({rotate:q.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]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,fl)):ce("",!0),a.showCopyButton?(b(),M("button",{key:1,class:re(at),onClick:kn,onMouseenter:e[9]||(e[9]=n=>_t(n)),onFocus:e[10]||(e[10]=n=>_t(n)),onMouseleave:P,onBlur:P},[_e.value?(b(),M("svg",pl,[...e[26]||(e[26]=[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(b(),M("svg",hl,[...e[25]||(e[25]=[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),i("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)):ce("",!0),a.showExportButton&&k.value?(b(),M("button",{key:2,class:re(`${at} ${tt.value?"opacity-50 cursor-not-allowed":""}`),"aria-label":w(p)("common.export")||"Export",disabled:tt.value,onClick:xn,onMouseenter:e[11]||(e[11]=n=>D(n,w(p)("common.export")||"Export")),onFocus:e[12]||(e[12]=n=>D(n,w(p)("common.export")||"Export")),onMouseleave:P,onBlur:P},[...e[27]||(e[27]=[i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,gl)):ce("",!0),a.showFullscreenButton&&k.value?(b(),M("button",{key:3,class:re(`${at} ${tt.value?"opacity-50 cursor-not-allowed":""}`),"aria-label":te.value?w(p)("common.minimize")||"Minimize":w(p)("common.open")||"Open",disabled:tt.value,onClick:bn,onMouseenter:e[13]||(e[13]=n=>D(n,te.value?w(p)("common.minimize")||"Minimize":w(p)("common.open")||"Open")),onFocus:e[14]||(e[14]=n=>D(n,te.value?w(p)("common.minimize")||"Minimize":w(p)("common.open")||"Open")),onMouseleave:P,onBlur:P},[te.value?(b(),M("svg",kl,[...e[29]||(e[29]=[i("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)])])):(b(),M("svg",yl,[...e[28]||(e[28]=[i("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,wl)):ce("",!0)]))])):ce("",!0),zn(i("div",{ref_key:"modeContainerRef",ref:Ot},[x.value?(b(),M("div",xl,[i("pre",bl,Ne(z.value),1)])):(b(),M("div",Ml,[a.showZoomControls?(b(),M("div",Tl,[i("div",Cl,[i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors",onClick:Ut,onMouseenter:e[15]||(e[15]=n=>D(n,w(p)("common.zoomIn")||"Zoom in")),onFocus:e[16]||(e[16]=n=>D(n,w(p)("common.zoomIn")||"Zoom in")),onMouseleave:P,onBlur:P},[...e[30]||(e[30]=[i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],32),i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors",onClick:Wt,onMouseenter:e[17]||(e[17]=n=>D(n,w(p)("common.zoomOut")||"Zoom out")),onFocus:e[18]||(e[18]=n=>D(n,w(p)("common.zoomOut")||"Zoom out")),onMouseleave:P,onBlur:P},[...e[31]||(e[31]=[i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],32),i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] text-[length:var(--ms-text-label)] rounded transition-colors",onClick:Gt,onMouseenter:e[19]||(e[19]=n=>D(n,w(p)("common.resetZoom")||"Reset zoom")),onFocus:e[20]||(e[20]=n=>D(n,w(p)("common.resetZoom")||"Reset zoom")),onMouseleave:P,onBlur:P},Ne(Math.round(100*T.value))+"% ",33)])])):ce("",!0),i("div",ln({ref_key:"mermaidContainer",ref:V,class:"mermaid-preview-area relative overflow-hidden block transition-[height] ease-out",style:{height:_.value}},rn(Ht.value,!0),{onMousedown:nt,onMousemove:lt,onMouseup:Te,onMouseleave:Te,onTouchstartPassive:nt,onTouchmovePassive:lt,onTouchendPassive:Te}),[i("div",{"data-mermaid-wrapper":"",class:re(["absolute inset-0 cursor-grab",{"cursor-grabbing":qe.value}]),style:bt(gt.value)},[i("div",{ref_key:"mermaidContent",ref:v,class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:bt({height:We.value})},null,4)],6)],16),(b(),Ln(_n,{to:"body"},[i("div",{class:re(["markstream-vue",{dark:a.isDark}])},[Hn(Rn,{name:"mermaid-dialog",appear:""},{default:An(()=>[te.value?(b(),M("div",{key:0,class:"mermaid-modal-overlay fixed inset-0 z-50 flex items-center justify-center p-4",onClick:Nn(yt,["self"])},[i("div",Bl,[i("div",Sl,[i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors",onClick:Ut},[...e[32]||(e[32]=[i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])]),i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors",onClick:Wt},[...e[33]||(e[33]=[i("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"},[i("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])]),i("button",{class:"mermaid-action-btn p-[var(--ms-action-btn-padding)] text-[length:var(--ms-text-label)] rounded transition-colors",onClick:Gt},Ne(Math.round(100*T.value))+"% ",1),i("button",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded transition-colors",onClick:yt},[...e[34]||(e[34]=[i("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"},[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])])]),i("div",ln({ref_key:"modalContent",ref:ae,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},rn(Ht.value,!0),{onMousedown:nt,onMousemove:lt,onMouseup:Te,onMouseleave:Te,onTouchstartPassive:nt,onTouchmovePassive:lt,onTouchendPassive:Te}),null,16)])])):ce("",!0)]),_:1})],2)]))]))],512),[[jn,!q.value]])],10,ll))}}),[["__scopeId","data-v-07b7ab60"]]);Bt.install=c=>{c.component(Bt.__name,Bt)};export{Bt as default}; diff --git a/apps/kimi-code/dist-web/assets/index5-D6hAiKdZ.js b/apps/kimi-code/dist-web/assets/index5-D6hAiKdZ.js new file mode 100644 index 0000000000..ef03784f5b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index5-D6hAiKdZ.js @@ -0,0 +1 @@ +import{bQ as P,M as j,af as q,bZ as X,bS as F,aU as x,b_ as J,bT as Q,bE as D,aD as Y,az as Z,aL as T,u as E,I as G,bJ as ee,t as ne,v as ae,g as te,au as V,bb as le,aw as oe,q as L,bU as re,as as U,bV as ue,bW as ie,bX as se,bY as de,b$ as ce}from"./index-DtRfJ0vw.js";var W=(_,n,o)=>new Promise((u,f)=>{var $=l=>{try{r(o.next(l))}catch(i){f(i)}},m=l=>{try{r(o.throw(l))}catch(i){f(i)}},r=l=>l.done?u(l.value):Promise.resolve(l.value).then($,m);r((o=o.apply(_,n)).next())});const ve=["data-markstream-mode","data-markstream-pending"],fe={key:0,class:"math-loading-overlay"},me=["innerHTML"],he={key:1,class:"math-block__fallback text-left"},O=P(j({__name:"MathBlockNode",props:{node:{},indexKey:{},cacheScope:{}},setup(_){const n=_,o=x(null),u=q(X,null),f=L(()=>re(n.node.content)),$=L(()=>ce(n,{})),m=(function(){if(!n.node.content)return{html:"",text:n.node.raw,loading:!1};const e=F();if(!e)return{html:"",text:n.node.loading?"":n.node.raw,loading:n.node.loading};try{return{html:e.renderToString(f.value,{throwOnError:n.node.loading,displayMode:!0}),text:"",loading:!1}}catch{return{html:"",text:n.node.loading?"":n.node.raw,loading:n.node.loading}}})(),r=x(m.html),l=x(m.text);let i=!1,h=0,s=!1,g=null;const k=J(),A=Q();let d=null,w=null,c="";const v=x(m.loading),H=x(!1),p=x(B());function R(e){e!=null&&e!==h||(H.value=!1)}function z(){var e;if(n.indexKey==null)return"";const a=(e=n.cacheScope)!=null?e:k?.scope;return`${a!=null&&String(a).length>0?`${String(a)}:`:""}math-block:${String(n.indexKey)}`}function B(){var e;const a=z();return a&&(e=k?.cache.get(a))!=null?e:0}function I(e){if(!Number.isFinite(e)||e<=0)return;const a=Math.max(p.value,e);if(a===p.value)return;p.value=a;const t=z();t&&k?.cache.set(t,a)}function y(){U(()=>{var e,a;I((a=(e=o.value)==null?void 0:e.offsetHeight)!=null?a:0)})}function K(){const e=c;u&&e&&(c="",u.markSettled(e))}function C(){return W(this,null,function*(){if(s)return K(),void R();g&&(g.abort(),g=null);const e=++h;if(!n.node.content)return K(),R(),v.value=!1,r.value="",l.value=n.node.raw,i=!0,void y();const a=new AbortController;if(g=a,H.value=!0,!i)try{!d&&o.value&&(d=A(o.value)),yield d?.whenVisible}catch{}s||e!==h||a.signal.aborted?s||R(e):((function(){const t=$.value;u&&t&&c!==t&&(c&&u.markSettled(c),c=t,u.markPending(t))})(),ue(f.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:a.signal}).then(t=>{s||e!==h||(r.value=t,l.value="",i=!0,v.value=!1,y())}).catch(t=>W(null,null,function*(){if(s||e!==h)return;const b=t?.code||t?.name,M=b==="KATEX_DISABLED";if(b==="WORKER_INIT_ERROR"||t?.fallbackToRenderer||b===ie||b==="WORKER_TIMEOUT"){const S=yield se();if(s||e!==h)return;if(S){try{const N=S.renderToString(f.value,{throwOnError:n.node.loading,displayMode:!0});r.value=N,l.value="",i=!0,v.value=!1,y(),de(f.value,!0,N)}catch{}return}}if(M||!n.node.loading)return v.value=!1,r.value="",l.value=n.node.raw,void y();i||(v.value=!0)})).finally(()=>{s||e!==h||(R(e),(function(){const t=c;u&&t&&(c="",U(()=>{var b,M;if(!s){const S=(M=(b=o.value)==null?void 0:b.offsetHeight)!=null?M:0;S>0&&u.reportHeight(t,S)}u.markSettled(t)}))})())}))})}return(m.html||m.text)&&(i=!0),D(()=>n.node.content,()=>{C()},{flush:"post"}),D([()=>n.indexKey,()=>n.cacheScope],()=>{p.value=B(),y()}),Y(()=>{typeof ResizeObserver<"u"&&o.value&&(w=new ResizeObserver(()=>{var e,a;I((a=(e=o.value)==null?void 0:e.offsetHeight)!=null?a:0)}),w.observe(o.value)),y(),r.value||C()}),Z(()=>{var e;s=!0,K(),g&&(g.abort(),g=null),w?.disconnect(),w=null,(e=d?.destroy)==null||e.call(d),d=null}),(e,a)=>(T(),E("div",{ref_key:"containerEl",ref:o,class:"math-block text-center overflow-x-auto relative","data-markstream-math":"block","data-markstream-mode":r.value?"katex":l.value?"fallback":"loading","data-markstream-pending":H.value?"true":void 0,style:oe(p.value?{minHeight:`${p.value}px`}:void 0)},[G(te,{name:"math-fade"},{default:ee(()=>[!v.value||r.value||l.value?ne("",!0):(T(),E("div",fe,[...a[0]||(a[0]=[ae("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),r.value?(T(),E("div",{key:0,class:V(["math-block__content",{"math-rendering":v.value}]),innerHTML:r.value},null,10,me)):l.value?(T(),E("pre",he,le(l.value),1)):(T(),E("div",{key:2,class:V(["math-block__content",{"math-rendering":v.value}])},null,2))],12,ve))}}),[["__scopeId","data-v-38e7acf6"]]);O.install=_=>{_.component(O.__name,O)};export{O as default}; diff --git a/apps/kimi-code/dist-web/assets/index6-BXVNgB_e.js b/apps/kimi-code/dist-web/assets/index6-BXVNgB_e.js new file mode 100644 index 0000000000..d6293885a2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index6-BXVNgB_e.js @@ -0,0 +1 @@ +import{bQ as S,M as $,bS as D,aU as g,bT as C,bE as N,aD as U,az as A,aL as y,u as T,bb as K,s as V,bJ as W,v as x,aY as H,g as P,t as j,q as B,bU as z,bV as X,bW as Y,bX as q,bY as J}from"./index-DtRfJ0vw.js";var I=(p,a,i)=>new Promise((h,d)=>{var c=n=>{try{l(i.next(n))}catch(o){d(o)}},t=n=>{try{l(i.throw(n))}catch(o){d(o)}},l=n=>n.done?h(n.value):Promise.resolve(n.value).then(c,t);l((i=i.apply(p,a)).next())});const Q=["data-markstream-mode","data-markstream-pending"],F=["innerHTML"],G={key:1,class:"math-inline math-inline--fallback"},Z={class:"math-inline__loading",role:"status","aria-live":"polite"},E=S($({__name:"MathInlineNode",props:{node:{}},setup(p){const a=p,i=g(null),h=B(()=>a.node.markup==="$$"),d=B(()=>z(a.node.content)),c=(function(){if(!a.node.content)return{html:"",text:a.node.raw,loading:!1};const e=D();if(!e)return{html:"",text:a.node.raw,loading:!1};try{return{html:e.renderToString(d.value,{throwOnError:a.node.loading,displayMode:h.value}),text:"",loading:!1}}catch{return{html:"",text:a.node.raw,loading:!1}}})(),t=g(c.html),l=g(c.text);let n=!1,o=0,v=!1,m=null;const f=g(c.loading),k=g(!1),L=C();let u=null;function w(e){e!=null&&e!==o||(k.value=!1)}function M(){return I(this,null,function*(){if(v)return;m&&(m.abort(),m=null);const e=++o;if(!a.node.content)return w(),f.value=!1,t.value="",l.value=a.node.raw,void(n=!0);const r=new AbortController;if(m=r,k.value=!0,!n)try{!u&&i.value&&(u=L(i.value)),yield u?.whenVisible}catch{}v||e!==o||r.signal.aborted?w(e):X(d.value,h.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:r.signal}).then(s=>{v||e!==o||(t.value=s,l.value="",f.value=!1,n=!0)}).catch(s=>I(null,null,function*(){if(v||e!==o)return;const b=s?.code||s?.name,O=b==="KATEX_DISABLED";if(b==="WORKER_INIT_ERROR"||s?.fallbackToRenderer||b===Y||b==="WORKER_TIMEOUT"){const R=yield q();if(v||e!==o)return;if(R){try{const _=R.renderToString(d.value,{throwOnError:a.node.loading,displayMode:h.value});t.value=_,l.value="",f.value=!1,n=!0,J(d.value,h.value,_)}catch{}return}}if(O||!a.node.loading)return f.value=!1,t.value="",void(l.value=a.node.raw);n||(f.value=!0)})).finally(()=>{v||w(e)})})}return(c.html||c.text)&&(n=!0),N(()=>a.node.content,()=>{M()}),U(()=>{t.value||M()}),A(()=>{var e;v=!0,m&&(m.abort(),m=null),(e=u?.destroy)==null||e.call(u),u=null}),(e,r)=>(y(),T("span",{ref_key:"containerEl",ref:i,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":l.value?"fallback":"loading","data-markstream-pending":k.value?"true":void 0},[t.value?(y(),T("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,F)):l.value?(y(),T("span",G,K(l.value),1)):f.value?(y(),V(P,{key:2,name:"table-node-fade"},{default:W(()=>[x("span",Z,[H(e.$slots,"loading",{isLoading:f.value},()=>[r[0]||(r[0]=x("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),r[1]||(r[1]=x("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Q))}}),[["__scopeId","data-v-7b64afc7"]]);E.install=p=>{p.component(E.__name,E)};export{E as default}; diff --git a/apps/kimi-code/dist-web/assets/index7-XmRlMUpI.js b/apps/kimi-code/dist-web/assets/index7-XmRlMUpI.js new file mode 100644 index 0000000000..20d5214950 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index7-XmRlMUpI.js @@ -0,0 +1 @@ +import{bQ as et,M as tt,bl as nt,af as ot,bZ as at,c0 as lt,bT as rt,bE as G,as as ce,aD as ut,az as it,aL as c,u as v,v as u,bk as m,au as ve,bb as H,t as E,aw as me,bL as st,bB as dt,aU as d,q as D,c8 as Fe,c2 as ct,ch as vt,b$ as mt}from"./index-DtRfJ0vw.js";var ft=Object.defineProperty,He=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,Se=(p,n,i)=>n in p?ft(p,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[n]=i,fe=(p,n)=>{for(var i in n||(n={}))pt.call(n,i)&&Se(p,i,n[i]);if(He)for(var i of He(n))gt.call(n,i)&&Se(p,i,n[i]);return p},pe=(p,n,i)=>new Promise((w,l)=>{var A=h=>{try{g(i.next(h))}catch(s){l(s)}},k=h=>{try{g(i.throw(h))}catch(s){l(s)}},g=h=>h.done?w(h.value):Promise.resolve(h.value).then(A,k);g((i=i.apply(p,n)).next())});const ht=["data-markstream-mode","data-markstream-pending"],yt={key:0,class:"d2-block-header flex justify-between items-center border-b"},wt={class:"d2-header-actions flex items-center"},bt={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},kt=["aria-label"],xt={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"},Bt={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"},Dt=["aria-label"],Ct=["aria-pressed"],Mt={key:0,class:"d2-source"},Tt={class:"d2-code"},Et={key:0,class:"d2-error mt-2 text-xs"},At={key:1},jt={key:0,class:"d2-source"},Ot={class:"d2-code"},Ft={key:0,class:"d2-error mt-2 text-xs"},Ht=["innerHTML"],St={key:0,class:"d2-error px-4 pb-3 text-xs"},ge=et(tt({__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=nt(),w=ot(at,null),{t:l}=lt(),A=d(!1),k=d(!1),g=d(!1),h=d(!1),s=d(null),K=d(!1),j=d(""),oe=d(""),R=d(0),S=d(""),I=d(""),Q=d(null),ae=d(null),le=d(null),Ie=rt(),_=d(null),he=typeof window<"u",ye=d(!1),V=d(typeof window>"u"),O=D(()=>{var t;return(t=n.node.code)!=null?t:""}),Le=D(()=>mt(n,i)),re=D(()=>{var t,e;return[n.isDark?"dark":"light",(t=n.themeId)!=null?t:"auto",(e=n.darkThemeId)!=null?e:"auto",O.value].join(":")}),W=D(()=>!!j.value&&oe.value===re.value),we=D(()=>{if(!ye.value||!O.value||g.value)return!1;const t=re.value;return!!K.value||S.value!==t&&(!s.value||I.value!==t)}),be=D(()=>W.value||!!j.value&&we.value),Z=D(()=>g.value||!h.value||!be.value),Ne=D(()=>{if(Z.value&&ae.value)return{minHeight:`${ae.value}px`}}),Pe=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,ue=!1,J=!1,ke=0,L=null,N=!1,U=null,C="";typeof window<"u"&&G(()=>le.value,t=>{var e;if((e=_.value)==null||e.destroy(),_.value=null,!t)return void(V.value=!1);const o=Ie(t,{rootMargin:"160px"});_.value=o,V.value=o.isVisible.value,o.whenVisible.then(()=>{V.value=!0})},{immediate:!0});const Re={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 xe(t){return!t||t.disabled}function M(t,e,o="top"){if(xe(t.currentTarget))return;const f=t,ee=f?.clientX!=null&&f?.clientY!=null?{x:f.clientX,y:f.clientY}:void 0;Fe(t.currentTarget,e,o,!1,ee,n.isDark)}function b(){ct()}function Be(t){if(xe(t.currentTarget))return;const e=A.value?l("common.copied")||"Copied":l("common.copy")||"Copy",o=t,f=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;Fe(t.currentTarget,e,"top",!1,f,n.isDark)}function _e(){return pe(this,null,function*(){try{const t=O.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 Ve(){k.value=!k.value}function De(t){g.value=t==="source"}const Ue=[/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 ze(t){if(!t)return"";const e=t.trim();return qe.test(e)?e:""}function Ce(){j.value="",oe.value=""}function $e(){return pe(this,null,function*(){var t,e,o,f,ee;if(!he||J||!V.value||n.loading&&!n.progressiveRender)return;const z=re.value;if(z===S.value&&!s.value&&W.value)return h.value=!0,void(n.loading&&(g.value=!1));const Me=O.value;if(!Me)return Ce(),s.value=null,S.value="",void(I.value="");const te=++R.value;K.value=!0,s.value=null,I.value="",(function(){const r=Le.value;w&&r&&C!==r&&(C&&w.markSettled(C),C=r,w.markPending(r))})();try{const r=yield(function(){return pe(this,null,function*(){if(x)return x;const a=yield vt();if(!a)return null;if(typeof a=="function"){const X=new a;return X&&typeof X.compile=="function"?x=X:typeof a.compile=="function"&&(x=a),x}return a?.D2&&typeof a.D2=="function"?(x=new a.D2,x):(typeof a.compile=="function"&&(x=a),x)})})();if(!r)return h.value=!1,g.value=!0,Ce(),s.value="D2 is not available.",void(I.value=z);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(Me);if(te!==R.value)return;const ne=(t=y?.diagram)!=null?t:y,B=(o=(e=y?.renderOptions)!=null?e:y?.options)!=null?o:{},Ye=(f=n.themeId)!=null?f:B.themeID,Te=(ee=n.darkThemeId)!=null?ee:B.darkThemeID,$=fe({},B);if($.themeID=n.isDark&&Te!=null?Te:Ye,$.darkThemeID=null,$.darkThemeOverrides=null,n.isDark){const a=B.themeOverrides&&typeof B.themeOverrides=="object"?B.themeOverrides:null;$.themeOverrides=fe(fe({},Re),a||{})}const Ge=yield r.render(ne,$);if(te!==R.value)return;const Ee=(function(a){return a?typeof a=="string"?a:typeof a.svg=="string"?a.svg:typeof a.data=="string"?a.data:"":""})(Ge);if(!Ee)throw new Error("D2 render returned empty output.");(function(a,X){const Ae=(function(je){if(typeof window>"u"||typeof DOMParser>"u"||!je)return"";const Ke=je.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),se=new DOMParser().parseFromString(Ke,"image/svg+xml").documentElement;if(!se||se.nodeName.toLowerCase()!=="svg")return"";const de=se;return(function(Oe){const Qe=new Set(["script"]),We=[Oe,...Array.from(Oe.querySelectorAll("*"))];for(const F of We){if(Qe.has(F.tagName.toLowerCase())){F.remove();continue}const Ze=Array.from(F.attributes);for(const P of Ze){const T=P.name;if(/^on/i.test(T))F.removeAttribute(T);else{if(T==="style"&&P.value){const Y=P.value;if(Ue.some(Je=>Je.test(Y))){F.removeAttribute(T);continue}}if((T==="href"||T==="xlink:href")&&P.value){const Y=ze(P.value);if(!Y){F.removeAttribute(T);continue}Y!==P.value&&F.setAttribute(T,Y)}}}}})(de),de.classList.add("markstream-d2-root-svg"),de.outerHTML})(a);j.value=Ae||"",oe.value=Ae?X:""})(Ee,z),S.value=z,I.value="",n.loading&&(g.value=!1),s.value=null}catch(r){if(te!==R.value)return;const y=r?.message?String(r.message):"D2 render failed.";n.loading||(s.value=y,I.value=z),S.value="",y.includes("@terrastruct/d2")&&(h.value=!1,g.value=!0)}finally{te===R.value&&(K.value=!1,N?(N=!1,q()):(function(){const r=C;w&&r&&(C="",ce(()=>{var y,ne;if(!J){const B=(ne=(y=le.value)==null?void 0:y.offsetHeight)!=null?ne:0;B>0&&w.reportHeight(r,B)}w.markSettled(r)}))})())}})}function q(t=!1){if(ue||!he||J)return;if(K.value)return void(N=!0);const e=Math.max(120,Number(n.progressiveIntervalMs)||0),o=Date.now()-ke;if(!t&&o{L=null,N&&(N=!1,q(!0))},Math.max(0,e-o))));ue=!0;const f=()=>{ue=!1,ke=Date.now(),$e()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(f):setTimeout(f,0)}function Xe(){if(W.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 ie(){const t=Q.value;if(!t)return;const e=t.getBoundingClientRect().height;e>0&&(ae.value=e)}return G(()=>[n.node.code,n.loading,n.isDark,n.themeId,n.darkThemeId],()=>{q()},{immediate:!0}),G(()=>n.loading,(t,e)=>{e&&!t&&q(!0)}),G(()=>V.value,t=>{t&&q(!0)}),G(()=>[Z.value,j.value,O.value],()=>{ce(()=>{ie()})}),ut(()=>{ye.value=!0,ce(()=>{ie()}),typeof ResizeObserver<"u"&&(U=new ResizeObserver(()=>{ie()}),Q.value&&U.observe(Q.value))}),it(()=>{var t;J=!0,(function(){const e=C;w&&e&&(C="",w.markSettled(e))})(),S.value="",(t=_.value)==null||t.destroy(),_.value=null,L!=null&&(clearTimeout(L),L=null),U?.disconnect(),U=null}),(t,e)=>(c(),v("div",{ref_key:"viewportTarget",ref:le,class:ve(["d2-block-container rounded-lg border overflow-hidden",{dark:n.isDark}]),"data-markstream-d2":"1","data-markstream-mode":Z.value?"fallback":"preview","data-markstream-pending":we.value?"true":void 0},[n.showHeader?(c(),v("div",yt,[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",wt,[n.showModeToggle?(c(),v("div",bt,[u("button",{type:"button",class:ve(["mode-btn px-2 py-0.5 rounded",g.value?"":"is-active"]),onClick:e[0]||(e[0]=o=>De("preview")),onMouseenter:e[1]||(e[1]=o=>M(o,m(l)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>M(o,m(l)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},H(m(l)("common.preview")||"Preview"),35),u("button",{type:"button",class:ve(["mode-btn px-2 py-0.5 rounded",g.value?"is-active":""]),onClick:e[3]||(e[3]=o=>De("source")),onMouseenter:e[4]||(e[4]=o=>M(o,m(l)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>M(o,m(l)("common.source")||"Source")),onMouseleave:b,onBlur:b},H(m(l)("common.source")||"Source"),35)])):E("",!0),n.showCopyButton?(c(),v("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":A.value?m(l)("common.copied")||"Copied":m(l)("common.copy")||"Copy",onClick:_e,onMouseenter:e[6]||(e[6]=o=>Be(o)),onFocus:e[7]||(e[7]=o=>Be(o)),onMouseleave:b,onBlur:b},[A.value?(c(),v("svg",Bt,[...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)])])):(c(),v("svg",xt,[...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,kt)):E("",!0),n.showExportButton&&W.value?(c(),v("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":m(l)("common.export")||"Export",onClick:Xe,onMouseenter:e[8]||(e[8]=o=>M(o,m(l)("common.export")||"Export")),onFocus:e[9]||(e[9]=o=>M(o,m(l)("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,Dt)):E("",!0),n.showCollapseButton?(c(),v("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":k.value,onClick:Ve,onMouseenter:e[10]||(e[10]=o=>M(o,k.value?m(l)("common.expand")||"Expand":m(l)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=o=>M(o,k.value?m(l)("common.expand")||"Expand":m(l)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(c(),v("svg",{style:me({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,Ct)):E("",!0)])])):E("",!0),st(u("div",{ref_key:"bodyRef",ref:Q,class:"d2-block-body",style:me(Ne.value)},[n.loading&&!be.value?(c(),v("div",Mt,[u("pre",Tt,[u("code",null,H(O.value),1)]),s.value?(c(),v("p",Et,H(s.value),1)):E("",!0)])):(c(),v("div",At,[Z.value?(c(),v("div",jt,[u("pre",Ot,[u("code",null,H(O.value),1)]),s.value?(c(),v("p",Ft,H(s.value),1)):E("",!0)])):(c(),v("div",{key:1,class:"d2-render",style:me(Pe.value)},[u("div",{class:"d2-svg",innerHTML:j.value},null,8,Ht),s.value?(c(),v("p",St,H(s.value),1)):E("",!0)],4))]))],4),[[dt,!k.value]])],10,ht))}}),[["__scopeId","data-v-f7ae4ae1"]]);ge.install=p=>{p.component(ge.__name,ge)};export{ge as default}; diff --git a/apps/kimi-code/dist-web/assets/index8-BSZNwbg_.js b/apps/kimi-code/dist-web/assets/index8-BSZNwbg_.js new file mode 100644 index 0000000000..0493eafbd9 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index8-BSZNwbg_.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BsKKzRv6.js","assets/index-DtRfJ0vw.js","assets/index-ByWw02oy.css"])))=>i.map(i=>d[i]); +import{bQ as yn,M as wn,c0 as bn,aU as h,bT as kn,bE as T,c1 as Ke,aD as xn,az as Bn,c2 as Cn,aL as Je,u as Qe,I as Sn,A as Tn,bJ as ae,aY as fe,v as C,aw as Ye,t as Hn,bb as Mn,au as On,b7 as zn,q as p,c3 as Ln,c4 as Pn,c5 as _n,c6 as $n,c7 as he,c8 as Fn,as as pe,c9 as Rn,bR as Dn,ca as Nn,cb as Vn}from"./index-DtRfJ0vw.js";import{V as En}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js";var In=Object.defineProperty,Xe=Object.getOwnPropertySymbols,Wn=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable,Ze=(c,v,t)=>v in c?In(c,v,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[v]=t,en=(c,v)=>{for(var t in v||(v={}))Wn.call(v,t)&&Ze(c,t,v[t]);if(Xe)for(var t of Xe(v))Un.call(v,t)&&Ze(c,t,v[t]);return c},g=(c,v,t)=>new Promise((Y,W)=>{var H=b=>{try{w(t.next(b))}catch(F){W(F)}},U=b=>{try{w(t.throw(b))}catch(F){W(F)}},w=b=>b.done?Y(b.value):Promise.resolve(b.value).then(H,U);w((t=t.apply(c,v)).next())});const jn=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-pending"],qn={class:"code-header-main"},An=["innerHTML"],Gn={class:"code-header-copy"},Kn={class:"code-header-title"},Jn=["innerHTML"],ge=yn(wn({__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,default:!0},autoScrollInitial:{type:Boolean,default:!0},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(c,{emit:v}){const t=c,Y=v,{t:W}=bn(),H=h(Ie(t.node.language,t.node.code,le())),U=h(!1),w=h(!1),b=h(!1),F=h(null),L=h(null),m=h(null),R=h(""),M=h(!1),j=h(!1);let D,x="",q=0,k=null;const nn=kn(),O=zn(null),B=h(typeof window>"u");typeof window<"u"&&T(()=>F.value,(e,n,l)=>{var o;if((o=O.value)==null||o.destroy(),O.value=null,!e)return void(B.value=!1);let a=!0;const r=nn(e,{rootMargin:"400px"});O.value=r,B.value=r.isVisible.value,r.whenVisible.then(()=>{a&&O.value===r&&(B.value=!0)}).catch(()=>{}),l(()=>{a=!1,r.destroy(),O.value===r&&(O.value=null)})},{immediate:!0});const A=h(t.autoScrollInitial!==!1),me=h(0),oe=p(()=>t.autoScrollOnUpdate!==!1),X=h(14),z=h(X.value),tn=p(()=>{const e=X.value,n=z.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof n=="number"&&Number.isFinite(n)&&n>0}),ln=p(()=>{const e=H.value.trim().toLowerCase();return Ln[e]||e.charAt(0).toUpperCase()+e.slice(1)}),an=p(()=>{Pn.value;const e=H.value.trim().toLowerCase();return _n(e.split(":")[0])}),ye=p(()=>{const e=H.value.trim().toLowerCase();return t.isShowPreview&&(e==="html"||e==="svg")}),on=p(()=>{const e={},n=a=>{if(a!=null)return typeof a=="number"?`${a}px`:String(a)},l=n(t.minWidth),o=n(t.maxWidth);return l&&(e.minWidth=l),o&&(e.maxWidth=o),e}),we=p(()=>{const e=t.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}),rn=p(()=>we.value!=null&&!M.value),un=p(()=>en({fontSize:`${z.value}px`},rn.value?{minHeight:`${we.value}px`}:{})),be=p(()=>t.showTooltips!==!1);function ke(e,n){const l=String(e??"");return n?l:l.replace(/\r\n$|\n$|\r$/,"")}const S=p(()=>ke(t.node.code,t.node.loading===!0));function xe(){return t.isDark?t.darkTheme:t.lightTheme}function u(e,n={}){if(k=null,P(),j.value=n.terminal===!0,!e)return Ce(),x="",R.value="",M.value=!1,void(j.value=!1);var l;R.value=`
      ${l=e,l.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}
      `,M.value=!1}function Be(){R.value="",M.value=!0,j.value=!1}function Ce(){m.value&&(m.value.innerHTML="")}function re(){var e;const n=m.value;return!!n&&(n.childNodes.length>0||!!((e=n.textContent)!=null&&e.trim().length))}function ie(e,n,l){return`${e??""}\0${n}\0${l}`}function Se(e){x=e,Be()}function P(e){e?.disconnect(),e&&D!==e||(D=void 0)}function Te(e,n){P();const l=m.value;if(!l||typeof MutationObserver>"u")return;k=null;const o=new MutationObserver(()=>{q+=1;const a=k;if(a)return f(e)?void(q!==n&&re()&&(k=null,P(o),Se(a))):(k=null,void P(o))});D=o,o.observe(l,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}function He(e,n,l,o){return g(this,null,function*(){var a;if(k=l,yield pe(),!f(e))return;const r=re(),d=q!==n,i=o!==void 0&&((a=m.value)==null?void 0:a.innerHTML)!==o;r&&(!x||d||i||x===l)&&(k=null,P(),Se(l))})}let s,G,Z,_=null,Me=null,N="",ue=0,V=0,Oe=!1;const ee=new Set,ze=new Set,ne=Nn();let Le=!1,te=null,K=!1,se=!1;function Pe(e,n,l){const o=Ee(We(e,n,l));return o!=="plaintext"&&ee.has(o)?"plaintext":o}function _e(e,n){return x===(function(l,o){return ie(l,Pe(t.node.language,o,le()),o)})(e,n)}function $e(e){const n=x.indexOf("\0"),l=n>=0?x.indexOf("\0",n+1):-1;return!(l<0)&&x.slice(n+1,l)===Pe(t.node.language,e,le())&&x.slice(l+1)===e}function Fe(e){var n,l;return!!((l=(n=m.value)==null?void 0:n.textContent)!=null&&l.includes(e))}const de=p(()=>{if(!S.value)return"ready";const e=ce(t.themes,t.langs);return M.value&&!R.value&&(_e(e.key,S.value)||$e(S.value)||Fe(S.value))?"ready":j.value||K?"fallback":"pending"}),sn=p(()=>de.value==="pending");function Re(){return V+=1,V}function f(e=V){return!Oe&&e===V}function De(){const e=s;s=void 0,_=null,x="",k=null,ee.clear();try{e?.dispose()}catch{}finally{Ce(),M.value=!1,j.value=!1}}const Ne=p(()=>$n(t.themes,t.langs));function Ve(){return{hasRegisterHighlight:!!Z,hasCreateRenderer:!!G}}function ce(e,n){var l;const o=Ve(),a=he(e,n,o);return(l=a.rendererOptions.langs)!=null&&l.length&&ze.has(a.key)?he(e,void 0,o):a}function Ee(e){return Rn(e)||"plaintext"}function Ie(e,n,l){return l&&!String(n??"")?"plain":Ke(String(e??""))}function le(){return typeof t.node.loading=="boolean"?t.node.loading:t.loading===!0}function We(e,n,l){return l&&!String(n??"")?"plaintext":String(e??"")}function Ue(e,n){return g(this,arguments,function*(l,o,a=V){if(!s||!f(a))return;const r=Ee(We(o,l,le())),d=i=>g(null,null,function*(){if(s&&f(a)){r!=="plaintext"&&(i&&ee.add(r));try{return yield s.updateCode(l,"plaintext"),f(a)?"plaintext":void 0}catch{return f(a),void 0}}});if(r!=="plaintext"&&ee.has(r))return d();try{return yield s.updateCode(l,r),f(a)?r:void 0}catch(i){return f(a)&&r!=="plaintext"?d(i):void 0}})}function je(e,n){return g(this,null,function*(){if(!Z)return"ready";if(N!==n)return"stale";if(Me===n)return"ready";const l=++ue;try{yield Vn(Z,e,n)}catch{return l!==ue||N!==n?"stale":"failed"}return l!==ue||N!==n?"stale":(Me=n,"ready")})}function qe(e,n){return g(this,null,function*(){const l=yield je(e,n);return l!=="failed"?l:N!==n?"stale":je(e,n)})}function E(){return g(this,arguments,function*(e=Re()){try{yield(function(n){return g(this,null,function*(){var l,o;if(!f(n))return;const a=S.value;if(!B.value)return void u(a);if(yield(function(){return g(this,null,function*(){if(!G&&!K)return te||(te=g(null,null,function*(){try{const I=yield Dn(()=>import("./index-BsKKzRv6.js"),__vite__mapDeps([0,1,2])),Ae=I.createShikiStreamRenderer;if(typeof Ae!="function")throw new TypeError("stream-markdown.createShikiStreamRenderer is not available");G=Ae;const Ge=I.registerHighlight;Z=typeof Ge=="function"?Ge:void 0,K=!1,se=!1}catch(I){K=!0,ne&&!se&&(se=!0,console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",I))}finally{te=null}}),te)})})(),!f(n))return;if(K)return void u(a,{terminal:!0});if(!L.value||!m.value)return void u(a);let r=ce(t.themes,t.langs);r.ignoredLangs&&ne&&!Le&&(Le=!0,console.warn("[MarkdownCodeBlockNode] `langs` requires stream-markdown >=0.0.15 with registerHighlight(); ignoring `langs` and using stream-markdown default language preload."));let d=r.rendererOptions,i=r.key;N=i;let y=!!(s&&_!==i);y&&u(a);let $=yield qe(r.registerOptions,i);if($==="failed"&&((l=d.langs)!=null&&l.length)&&(ze.add(i),ne&&console.warn("[MarkdownCodeBlockNode] Failed to register configured Shiki languages; retrying without `langs`.",{langs:d.langs}),r=he(t.themes,void 0,Ve()),d=r.rendererOptions,i=r.key,N=i,$=yield qe(r.registerOptions,i)),!f(n)||$==="stale")return;if(y=!!(s&&_!==i),$==="failed")return void(y&&s&&re()&&(_e(i,a)||$e(a)||Fe(a))?Be():u(a,{terminal:!0}));if(y&&De(),!s&&G&&(s=G(m.value,en({theme:xe()},d)),_=i,M.value=!0),!s)return void u(a,{terminal:!0});if(t.stream===!1&&t.loading)return void u(a);u(a);const J=q,ve=(o=m.value)==null?void 0:o.innerHTML;Te(n,J);const Q=yield Ue(a,t.node.language,n);f(n)&&(Q?yield He(n,J,ie(i,Q,a),ve):(k=null,P(),u(a,{terminal:!0})))})})(e)}catch{if(!f(e))return;u(S.value,{terminal:!0})}})}function dn(){const e=L.value;if(!e||w.value||!oe.value)return;const n=e.scrollTop;n{U.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})}function vn(e){if(w.value=!w.value,e&&be.value){const l=(function(o){const a=o.currentTarget||o.target;return!a||a.disabled?null:a})(e);if(l){const o=w.value?W("common.collapse")||"Collapse":W("common.expand")||"Expand";Fn(l,o,"top",!1,void 0,t.isDark)}}const n=L.value;n&&(w.value?(n.style.maxHeight="none",n.style["overflow-y"]="visible",n.style["overflow-x"]="auto"):(n.style.maxHeight="",n.style.overflow="auto",oe.value&&(A.value=!0,pe(()=>{n.scrollHeight>n.clientHeight&&(n.scrollTop=n.scrollHeight)}))))}function fn(){b.value=!b.value}function hn(){const e=Math.min(36,z.value+1);z.value=e}function pn(){const e=Math.max(10,z.value-1);z.value=e}function gn(){z.value=X.value}function mn(){if(!ye.value)return;const e=Ke(H.value||t.node.language).toLowerCase(),n=e==="html"?"HTML Preview":"SVG Preview";Y("previewCode",{type:e==="html"?"text/html":"image/svg+xml",content:t.node.code,title:n})}return u(S.value),xn(()=>{B.value?E():u(S.value)}),Bn(()=>{var e;Oe=!0,V+=1,(e=O.value)==null||e.destroy(),O.value=null,D?.disconnect(),D=void 0,k=null,De()}),T(Ne,()=>g(null,null,function*(){B.value&&(yield E())})),T(()=>t.loading,e=>{e||(B.value?E():u(S.value))}),T(()=>B.value,e=>{e&&E()}),T(be,e=>{e||Cn()}),T(()=>t.autoScrollInitial,e=>{A.value=e!==!1}),T(()=>[t.node.code,t.node.language,t.node.loading,t.loading],e=>g(null,[e],function*([n,l,o,a]){var r;const d=Re(),i=typeof o=="boolean"?o:a===!0,y=ke(n,i),$=Ie(l,n,i);if($!==H.value&&(H.value=$),!B.value||!L.value||!m.value)return void u(y);if(!n)return void u("");if(!s||(function(){const I=ce(t.themes,t.langs);return!!(s&&_!==I.key)})())return u(y),void(yield E(d));if(!f(d)||!s||t.stream===!1&&t.loading)return;u(y);const J=q,ve=(r=m.value)==null?void 0:r.innerHTML;Te(d,J);const Q=yield Ue(y,l,d);f(d)&&(Q?yield He(d,J,ie(_??Ne.value,Q,y),ve):(k=null,P(),u(y,{terminal:!0})))})),T(()=>[t.darkTheme,t.lightTheme,t.isDark],()=>g(null,null,function*(){B.value&&L.value&&m.value&&(s||(yield E()),s?.setTheme(xe()))})),T(()=>t.node.code,()=>g(null,null,function*(){if(w.value||!oe.value||!A.value)return;yield pe();const e=L.value;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)})),(e,n)=>(Je(),Qe("div",{ref_key:"container",ref:F,style:Ye(on.value),class:On(["code-block-container rounded-lg border overflow-hidden",{dark:t.isDark}]),"data-markstream-code-block":"1","data-markstream-enhanced":de.value==="ready"?"true":"false","data-markstream-enhancement-state":de.value,"data-markstream-pending":sn.value?"true":void 0},[Sn(En,{"show-header":t.showHeader,"show-collapse-button":t.showCollapseButton,"show-font-size-buttons":t.showFontSizeButtons,"enable-font-size-control":t.enableFontSizeControl,"show-copy-button":t.showCopyButton,"show-expand-button":t.showExpandButton,"show-preview-button":t.showPreviewButton,"show-tooltips":t.showTooltips,"is-dark":t.isDark,loading:t.loading,stream:t.stream,"is-collapsed":b.value,"is-expanded":w.value,"copy-text":U.value,"is-previewable":ye.value,"code-font-size":z.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":X.value,"font-baseline-ready":tn.value,onToggleCollapse:fn,onDecreaseFont:pn,onResetFont:gn,onIncreaseFont:hn,onCopy:cn,onToggleExpand:vn,onPreview:mn},Tn({"header-left":ae(()=>[fe(e.$slots,"header-left",{},()=>[C("div",qn,[C("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:an.value},null,8,An),C("div",Gn,[C("div",Kn,Mn(ln.value),1)])])],!0)]),loading:ae(()=>[fe(e.$slots,"loading",{loading:c.loading,stream:c.stream},()=>[n[0]||(n[0]=C("div",{class:"loading-skeleton"},[C("div",{class:"skeleton-line"}),C("div",{class:"skeleton-line"}),C("div",{class:"skeleton-line short"})],-1))],!0)]),default:ae(()=>[C("div",{ref_key:"codeBlockContent",ref:L,class:"code-block-content",style:Ye(un.value),onScroll:dn},[C("div",{ref_key:"rendererTarget",ref:m,class:"code-block-render"},null,512),!M.value&&R.value?(Je(),Qe("div",{key:0,class:"code-fallback-plain",innerHTML:R.value},null,8,Jn)):Hn("",!0)],36)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:ae(()=>[fe(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready"])],14,jn))}}),[["__scopeId","data-v-e45dd78e"]]);ge.install=c=>{c.component(ge.__name,ge)};export{ge as default}; diff --git a/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js b/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js new file mode 100644 index 0000000000..88e25be070 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js @@ -0,0 +1,2 @@ +import{_ as a,l as s,I as o,e as i}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as g}from"./wardley-L42UT6IY-BJFn8eDD.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram +`+r);const t=o(e);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${n}`)},"draw"),l={draw:c},_={parser:p,db:m,renderer:l};export{_ as diagram}; diff --git a/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-B1S64SqR.js b/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-B1S64SqR.js new file mode 100644 index 0000000000..b4c1aa731b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/infoDiagram-5YYISTIA-B1S64SqR.js @@ -0,0 +1,2 @@ +import{_ as a,l as s,I as o,e as i}from"./mermaid.core-zKrc8Ye9.js";import{p as g}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram +`+r);const t=o(e);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${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram}; diff --git a/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 b/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 new file mode 100644 index 0000000000..37bdb1d313 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-italic-fe11NjBs.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 b/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 new file mode 100644 index 0000000000..cc9d563ba0 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 b/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 new file mode 100644 index 0000000000..440a947cb6 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-italic-Ck9oD2H0.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 b/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 new file mode 100644 index 0000000000..fff3b01c9f Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 b/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 new file mode 100644 index 0000000000..6ade35a1c8 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-italic-BIcRYUEt.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 b/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 new file mode 100644 index 0000000000..d5d43afcf3 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 b/apps/kimi-code/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 new file mode 100644 index 0000000000..513307d378 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-greek-opsz-italic-mtaF_0H_.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 b/apps/kimi-code/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 new file mode 100644 index 0000000000..12f574ae21 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 b/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 new file mode 100644 index 0000000000..fb8e67ed71 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-italic-BLMf5All.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 b/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 new file mode 100644 index 0000000000..a0125fa05c Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 b/apps/kimi-code/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 new file mode 100644 index 0000000000..39eb636735 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-latin-opsz-italic-BbqH_2Ar.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 b/apps/kimi-code/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 new file mode 100644 index 0000000000..b0d0e2e5c6 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 b/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 new file mode 100644 index 0000000000..db25457510 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-italic-C7TReJrb.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 b/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 new file mode 100644 index 0000000000..79ac1ef3d2 Binary files /dev/null and b/apps/kimi-code/dist-web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 differ diff --git a/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js b/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js new file mode 100644 index 0000000000..04fbd1680b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js @@ -0,0 +1,70 @@ +import{_ as l,c as lt,N as ct,I as ut,al as dt,z as yt,k as ft,p as et,a as pt,b as gt,g as kt,s as mt,q as wt,e as _t}from"./mermaidParser.worker-Dx4jPi9z.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 N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(S.yy[N]=this.yy[N]);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(P){i.length=i.length-2*P,f.length=f.length-P,r.length=r.length-P}l(X,"popStack");function J(){var P;return P=h.pop()||b.lex()||A,typeof P!="number"&&(P instanceof Array&&(h=P,P=h.pop()),P=s.symbols_[P]||P),P}l(J,"lex");for(var M,W,B,Y,z={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),B=v[W]&&v[W][M]),typeof B>"u"||!B.length||!B[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(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(B[0]){case 1:i.push(M),f.push(b.yytext),r.push(b.yylloc),i.push(B[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],z.$=f[f.length-V],z._$={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&&(z._$.range=[r[r.length-(V||1)].range[0],r[r.length-1].range[1]]),Y=this.performAction.apply(z,[w,$,I,S.yy,B[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_[B[1]][0]),f.push(z.$),r.push(z._$),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()+` +`+s+"^"},"showPosition"),test_match:l(function(e,s){var i,h,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),h=e[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in f)this[r]=f[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,s,i,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),r=0;rs[0].length)){if(s=i,h=r,this.options.backtrack_lexer){if(e=this.test_match(i,f[r]),e!==!1)return e;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(e=this.test_match(s,f[h]),e!==!1?e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,i,h,f){switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T})();D.lexer=O;function E(){this.yy={}}return l(E,"Parser"),E.prototype=D,D.Parser=E,new E})();Q.parser=Q;var bt=Q,xt=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{l(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,yt()}getRoot(){return this.root}addNode(t,d){const n=ft.sanitizeText(d,lt());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],et(n);return}this.baseLevel??=t;let a=t-this.baseLevel+1;for(a<=0&&(a=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=a;)this.stack.pop();const o=this.stack[this.stack.length-1].node,y={text:n,children:[]};o.children.push(y),this.stack.push({level:a,node:y})}getAccTitle(){return pt()}setAccTitle(t){gt(t)}getAccDescription(){return kt()}setAccDescription(t){mt(t)}getDiagramTitle(){return wt()}setDiagramTitle(t){et(t)}},vt=14,F=250,St=30,$t=60,Et=5,ot=82*Math.PI/180,it=Math.cos(ot),st=Math.sin(ot),nt=l((t,d,n)=>{const a=t.node().getBBox(),o=a.width+d*2,y=a.height+d*2;_t(t,y,o,n),t.attr("viewBox",`${a.x-d} ${a.y-d} ${o} ${y}`)},"applyPaddedViewBox"),At=l((t,d,n,a)=>{const y=a.db.getRoot();if(!y)return;const p=lt(),{look:u,handDrawnSeed:m,themeVariables:c}=p,k=ct(p.fontSize)[0]??vt,g=u==="handDrawn",_=y.children??[],x=p.ishikawa?.diagramPadding??20,D=p.ishikawa?.useMaxWidth??!1,O=ut(d),E=O.append("g").attr("class","ishikawa"),T=g?dt.svg(O.node()):void 0,e=T?{roughSvg:T,seed:m??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${d}`;g||E.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,h=F;const f=g?void 0:j(E,i,h,i,h,"ishikawa-spine");if(It(E,i,h,y.text,k,e),!_.length){g&&j(E,i,h,i,h,"ishikawa-spine",e),nt(O,x,D);return}i-=20;const r=_.filter((S,N)=>N%2===0),v=_.filter((S,N)=>N%2===1),w=at(r),I=at(v),$=w.total+I.total;let L=F,A=F;if($>0){const S=F*2,N=F*.3;L=Math.max(N,S*(w.total/$)),A=Math.max(N,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),h=Math.max(L,F),f&&f.attr("y1",h).attr("y2",h),E.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);const b=Math.ceil(_.length/2);for(let S=0;SMath.min(R,H.getBBox().x),1/0)}if(g)j(E,i,h,0,h,"ishikawa-spine",e);else{f.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}nt(O,x,D)},"draw"),at=l(t=>{const d=l(n=>n.children.reduce((a,o)=>a+1+d(o),0),"countDescendants");return t.reduce((n,a)=>{const o=d(a);return n.total+=o,n.max=Math.max(n.max,o),n},{total:0,max:0})},"sideStats"),It=l((t,d,n,a,o,y)=>{const p=Math.max(6,Math.floor(110/(o*.6))),u=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${d},${n})`),m=Z(u,ht(a,p),0,0,"ishikawa-head-label","start",o),c=m.node().getBBox(),k=Math.max(60,c.width+6),g=Math.max(40,c.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});u.insert(()=>x,":first-child").attr("class","ishikawa-head")}else u.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Lt=l((t,d)=>{const n=[],a=[],o=l((y,p,u)=>{const m=d===-1?[...y].reverse():y;for(const c of m){const k=n.length,g=c.children??[];n.push({depth:u,text:ht(c.text,15),parentIndex:p,childCount:g.length}),u%2===0?(a.push(k),g.length&&o(g,k,u+1)):(g.length&&o(g,k,u+1),a.push(k))}},"walk");return o(t,-1,2),{entries:n,yOrder:a}},"flattenTree"),Tt=l((t,d,n,a,o,y,p)=>{const u=t.append("g").attr("class","ishikawa-label-group"),c=Z(u,d,n,a+11*o,"ishikawa-label cause","middle",y).node().getBBox();if(p){const k=p.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});u.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else u.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),K=l((t,d,n,a,o,y)=>{const p=Math.sqrt(a*a+o*o);if(p===0)return;const u=a/p,m=o/p,c=6,k=-m*c,g=u*c,_=d,x=n,D=`M ${_} ${x} L ${_-u*c*2+k} ${x-m*c*2+g} L ${_-u*c*2-k} ${x-m*c*2-g} Z`,O=y.roughSvg.path(D,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});t.append(()=>O)},"drawArrowMarker"),Mt=l((t,d,n,a,o,y,p,u)=>{const m=d.children??[],c=y*(m.length?1:.2),k=-it*c,g=st*c*o,_=n+k,x=a+g;if(j(t,n,a,_,x,"ishikawa-branch",u),u&&K(t,n,a,n-_,a-x,u),Tt(t,d.text,_,x,o,p,u),!m.length)return;const{entries:D,yOrder:O}=Lt(m,o),E=D.length,T=new Array(E);for(const[f,r]of O.entries())T[r]=a+g*((f+1)/(E+1));const e=new Map;e.set(-1,{x0:n,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-it,i=st*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(const[f,r]of D.entries()){const v=T[f],w=e.get(r.parentIndex),I=t.append("g").attr("class","ishikawa-sub-group");let $=0,L=0,A=0;if(r.depth%2===0){const C=w.y1-w.y0;$=rt(w.x0,w.x1,C?(v-w.y0)/C:.5),L=v,A=$-(r.childCount>0?$t+r.childCount*Et:St),j(I,$,v,A,v,"ishikawa-sub-branch",u),u&&K(I,$,v,1,0,u),Z(I,r.text,A,v,"ishikawa-label align","end",p)}else{const C=w.childrenDrawn++;$=rt(w.x0,w.x1,(w.childCount-C)/(w.childCount+1)),L=w.y0,A=$+s*((v-L)/i),j(I,$,L,A,v,"ishikawa-sub-branch",u),u&&K(I,$,L,$-A,L-v,u),Z(I,r.text,A,v,h,"end",p)}r.childCount>0&&e.set(f,{x0:$,y0:L,x1:A,y1:v,childCount:r.childCount,childrenDrawn:0})}},"drawBranch"),Nt=l(t=>t.split(/|\n/),"splitLines"),ht=l((t,d)=>{if(t.length<=d)return t;const n=[];for(const a of t.split(/\s+/)){const o=n.length-1;o>=0&&n[o].length+1+a.length<=d?n[o]+=" "+a:n.push(a)}return n.join(` +`)},"wrapText"),Z=l((t,d,n,a,o,y,p)=>{const u=Nt(d),m=p*1.05,c=t.append("text").attr("class",o).attr("text-anchor",y).attr("x",n).attr("y",a-(u.length-1)*m/2);for(const[k,g]of u.entries())c.append("tspan").attr("x",n).attr("dy",k===0?0:m).text(g);return c},"drawMultilineText"),rt=l((t,d,n)=>t+(d-t)*n,"lerp"),j=l((t,d,n,a,o,y,p)=>{if(p){const u=p.roughSvg.line(d,n,a,o,{roughness:1.5,seed:p.seed,stroke:p.lineColor,strokeWidth:2});t.append(()=>u).attr("class",y);return}return t.append("line").attr("class",y).attr("x1",d).attr("y1",n).attr("x2",a).attr("y2",o)},"drawLine"),Pt={draw:At},Bt=l(t=>` +.ishikawa .ishikawa-spine, +.ishikawa .ishikawa-branch, +.ishikawa .ishikawa-sub-branch { + stroke: ${t.lineColor}; + stroke-width: 2; + fill: none; +} + +.ishikawa .ishikawa-sub-branch { + stroke-width: 1; +} + +.ishikawa .ishikawa-arrow { + fill: ${t.lineColor}; +} + +.ishikawa .ishikawa-head { + fill: ${t.mainBkg}; + stroke: ${t.lineColor}; + stroke-width: 2; +} + +.ishikawa .ishikawa-label-box { + fill: ${t.mainBkg}; + stroke: ${t.lineColor}; + stroke-width: 2; +} + +.ishikawa text { + font-family: ${t.fontFamily}; + font-size: ${t.fontSize}; + fill: ${t.textColor}; +} + +.ishikawa .ishikawa-head-label { + font-weight: 600; + text-anchor: middle; + dominant-baseline: middle; + font-size: 14px; +} + +.ishikawa .ishikawa-label { + text-anchor: end; +} + +.ishikawa .ishikawa-label.cause { + text-anchor: middle; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.align { + text-anchor: end; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.up { + dominant-baseline: baseline; +} + +.ishikawa .ishikawa-label.down { + dominant-baseline: hanging; +} +`,"getStyles"),Dt=Bt,Ct={parser:bt,get db(){return new xt},renderer:Pt,styles:Dt};export{Ct as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-O5IEMrWO.js b/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-O5IEMrWO.js new file mode 100644 index 0000000000..5e197ba157 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ishikawaDiagram-YF4QCWOH-O5IEMrWO.js @@ -0,0 +1,70 @@ +import{_ as l,c as lt,N as ct,I as ut,al as dt,z as yt,k as ft,p as et,a as pt,b as gt,g as kt,s as mt,q as wt,e as _t}from"./mermaid.core-zKrc8Ye9.js";import"./index-DtRfJ0vw.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 N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(S.yy[N]=this.yy[N]);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(P){i.length=i.length-2*P,f.length=f.length-P,r.length=r.length-P}l(X,"popStack");function J(){var P;return P=h.pop()||b.lex()||A,typeof P!="number"&&(P instanceof Array&&(h=P,P=h.pop()),P=s.symbols_[P]||P),P}l(J,"lex");for(var M,W,B,Y,z={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),B=v[W]&&v[W][M]),typeof B>"u"||!B.length||!B[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(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(B[0]){case 1:i.push(M),f.push(b.yytext),r.push(b.yylloc),i.push(B[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],z.$=f[f.length-V],z._$={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&&(z._$.range=[r[r.length-(V||1)].range[0],r[r.length-1].range[1]]),Y=this.performAction.apply(z,[w,$,I,S.yy,B[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_[B[1]][0]),f.push(z.$),r.push(z._$),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()+` +`+s+"^"},"showPosition"),test_match:l(function(e,s){var i,h,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),h=e[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in f)this[r]=f[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,s,i,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),r=0;rs[0].length)){if(s=i,h=r,this.options.backtrack_lexer){if(e=this.test_match(i,f[r]),e!==!1)return e;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(e=this.test_match(s,f[h]),e!==!1?e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,i,h,f){switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T})();D.lexer=O;function E(){this.yy={}}return l(E,"Parser"),E.prototype=D,D.Parser=E,new E})();Q.parser=Q;var bt=Q,xt=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{l(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,yt()}getRoot(){return this.root}addNode(t,d){const n=ft.sanitizeText(d,lt());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],et(n);return}this.baseLevel??=t;let a=t-this.baseLevel+1;for(a<=0&&(a=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=a;)this.stack.pop();const o=this.stack[this.stack.length-1].node,y={text:n,children:[]};o.children.push(y),this.stack.push({level:a,node:y})}getAccTitle(){return pt()}setAccTitle(t){gt(t)}getAccDescription(){return kt()}setAccDescription(t){mt(t)}getDiagramTitle(){return wt()}setDiagramTitle(t){et(t)}},vt=14,F=250,St=30,$t=60,Et=5,ot=82*Math.PI/180,it=Math.cos(ot),st=Math.sin(ot),nt=l((t,d,n)=>{const a=t.node().getBBox(),o=a.width+d*2,y=a.height+d*2;_t(t,y,o,n),t.attr("viewBox",`${a.x-d} ${a.y-d} ${o} ${y}`)},"applyPaddedViewBox"),At=l((t,d,n,a)=>{const y=a.db.getRoot();if(!y)return;const p=lt(),{look:u,handDrawnSeed:m,themeVariables:c}=p,k=ct(p.fontSize)[0]??vt,g=u==="handDrawn",_=y.children??[],x=p.ishikawa?.diagramPadding??20,D=p.ishikawa?.useMaxWidth??!1,O=ut(d),E=O.append("g").attr("class","ishikawa"),T=g?dt.svg(O.node()):void 0,e=T?{roughSvg:T,seed:m??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${d}`;g||E.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,h=F;const f=g?void 0:j(E,i,h,i,h,"ishikawa-spine");if(It(E,i,h,y.text,k,e),!_.length){g&&j(E,i,h,i,h,"ishikawa-spine",e),nt(O,x,D);return}i-=20;const r=_.filter((S,N)=>N%2===0),v=_.filter((S,N)=>N%2===1),w=at(r),I=at(v),$=w.total+I.total;let L=F,A=F;if($>0){const S=F*2,N=F*.3;L=Math.max(N,S*(w.total/$)),A=Math.max(N,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),h=Math.max(L,F),f&&f.attr("y1",h).attr("y2",h),E.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);const b=Math.ceil(_.length/2);for(let S=0;SMath.min(R,H.getBBox().x),1/0)}if(g)j(E,i,h,0,h,"ishikawa-spine",e);else{f.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}nt(O,x,D)},"draw"),at=l(t=>{const d=l(n=>n.children.reduce((a,o)=>a+1+d(o),0),"countDescendants");return t.reduce((n,a)=>{const o=d(a);return n.total+=o,n.max=Math.max(n.max,o),n},{total:0,max:0})},"sideStats"),It=l((t,d,n,a,o,y)=>{const p=Math.max(6,Math.floor(110/(o*.6))),u=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${d},${n})`),m=Z(u,ht(a,p),0,0,"ishikawa-head-label","start",o),c=m.node().getBBox(),k=Math.max(60,c.width+6),g=Math.max(40,c.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});u.insert(()=>x,":first-child").attr("class","ishikawa-head")}else u.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Lt=l((t,d)=>{const n=[],a=[],o=l((y,p,u)=>{const m=d===-1?[...y].reverse():y;for(const c of m){const k=n.length,g=c.children??[];n.push({depth:u,text:ht(c.text,15),parentIndex:p,childCount:g.length}),u%2===0?(a.push(k),g.length&&o(g,k,u+1)):(g.length&&o(g,k,u+1),a.push(k))}},"walk");return o(t,-1,2),{entries:n,yOrder:a}},"flattenTree"),Tt=l((t,d,n,a,o,y,p)=>{const u=t.append("g").attr("class","ishikawa-label-group"),c=Z(u,d,n,a+11*o,"ishikawa-label cause","middle",y).node().getBBox();if(p){const k=p.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});u.insert(()=>k,":first-child").attr("class","ishikawa-label-box")}else u.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),K=l((t,d,n,a,o,y)=>{const p=Math.sqrt(a*a+o*o);if(p===0)return;const u=a/p,m=o/p,c=6,k=-m*c,g=u*c,_=d,x=n,D=`M ${_} ${x} L ${_-u*c*2+k} ${x-m*c*2+g} L ${_-u*c*2-k} ${x-m*c*2-g} Z`,O=y.roughSvg.path(D,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});t.append(()=>O)},"drawArrowMarker"),Mt=l((t,d,n,a,o,y,p,u)=>{const m=d.children??[],c=y*(m.length?1:.2),k=-it*c,g=st*c*o,_=n+k,x=a+g;if(j(t,n,a,_,x,"ishikawa-branch",u),u&&K(t,n,a,n-_,a-x,u),Tt(t,d.text,_,x,o,p,u),!m.length)return;const{entries:D,yOrder:O}=Lt(m,o),E=D.length,T=new Array(E);for(const[f,r]of O.entries())T[r]=a+g*((f+1)/(E+1));const e=new Map;e.set(-1,{x0:n,y0:a,x1:_,y1:x,childCount:m.length,childrenDrawn:0});const s=-it,i=st*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(const[f,r]of D.entries()){const v=T[f],w=e.get(r.parentIndex),I=t.append("g").attr("class","ishikawa-sub-group");let $=0,L=0,A=0;if(r.depth%2===0){const C=w.y1-w.y0;$=rt(w.x0,w.x1,C?(v-w.y0)/C:.5),L=v,A=$-(r.childCount>0?$t+r.childCount*Et:St),j(I,$,v,A,v,"ishikawa-sub-branch",u),u&&K(I,$,v,1,0,u),Z(I,r.text,A,v,"ishikawa-label align","end",p)}else{const C=w.childrenDrawn++;$=rt(w.x0,w.x1,(w.childCount-C)/(w.childCount+1)),L=w.y0,A=$+s*((v-L)/i),j(I,$,L,A,v,"ishikawa-sub-branch",u),u&&K(I,$,L,$-A,L-v,u),Z(I,r.text,A,v,h,"end",p)}r.childCount>0&&e.set(f,{x0:$,y0:L,x1:A,y1:v,childCount:r.childCount,childrenDrawn:0})}},"drawBranch"),Nt=l(t=>t.split(/|\n/),"splitLines"),ht=l((t,d)=>{if(t.length<=d)return t;const n=[];for(const a of t.split(/\s+/)){const o=n.length-1;o>=0&&n[o].length+1+a.length<=d?n[o]+=" "+a:n.push(a)}return n.join(` +`)},"wrapText"),Z=l((t,d,n,a,o,y,p)=>{const u=Nt(d),m=p*1.05,c=t.append("text").attr("class",o).attr("text-anchor",y).attr("x",n).attr("y",a-(u.length-1)*m/2);for(const[k,g]of u.entries())c.append("tspan").attr("x",n).attr("dy",k===0?0:m).text(g);return c},"drawMultilineText"),rt=l((t,d,n)=>t+(d-t)*n,"lerp"),j=l((t,d,n,a,o,y,p)=>{if(p){const u=p.roughSvg.line(d,n,a,o,{roughness:1.5,seed:p.seed,stroke:p.lineColor,strokeWidth:2});t.append(()=>u).attr("class",y);return}return t.append("line").attr("class",y).attr("x1",d).attr("y1",n).attr("x2",a).attr("y2",o)},"drawLine"),Pt={draw:At},Bt=l(t=>` +.ishikawa .ishikawa-spine, +.ishikawa .ishikawa-branch, +.ishikawa .ishikawa-sub-branch { + stroke: ${t.lineColor}; + stroke-width: 2; + fill: none; +} + +.ishikawa .ishikawa-sub-branch { + stroke-width: 1; +} + +.ishikawa .ishikawa-arrow { + fill: ${t.lineColor}; +} + +.ishikawa .ishikawa-head { + fill: ${t.mainBkg}; + stroke: ${t.lineColor}; + stroke-width: 2; +} + +.ishikawa .ishikawa-label-box { + fill: ${t.mainBkg}; + stroke: ${t.lineColor}; + stroke-width: 2; +} + +.ishikawa text { + font-family: ${t.fontFamily}; + font-size: ${t.fontSize}; + fill: ${t.textColor}; +} + +.ishikawa .ishikawa-head-label { + font-weight: 600; + text-anchor: middle; + dominant-baseline: middle; + font-size: 14px; +} + +.ishikawa .ishikawa-label { + text-anchor: end; +} + +.ishikawa .ishikawa-label.cause { + text-anchor: middle; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.align { + text-anchor: end; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.up { + dominant-baseline: baseline; +} + +.ishikawa .ishikawa-label.down { + dominant-baseline: hanging; +} +`,"getStyles"),Dt=Bt,Vt={parser:bt,get db(){return new xt},renderer:Pt,styles:Dt};export{Vt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-BhwFOFOc.js b/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-BhwFOFOc.js new file mode 100644 index 0000000000..863e66ea71 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-BhwFOFOc.js @@ -0,0 +1,139 @@ +import{g as gt}from"./chunk-FMBD7UC4-_3v8zWlF.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-D-Pih1kA.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,d as X,e as $t,z as Mt}from"./mermaid.core-zKrc8Ye9.js";import{d as it}from"./arc-DtCnpCZe.js";import"./index-DtRfJ0vw.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()+` +`+n+"^"},"showPosition"),test_match:s(function(r,n){var l,y,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),y=r[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,y;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;cn[0].length)){if(n=l,y=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[y]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,y,d){switch(y){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const u=i.map(o=>o.trim()),p={section:V,type:V,people:u,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(t=>`.label { + font-family: ${t.fontFamily}; + color: ${t.textColor}; + } + .mouth { + stroke: #666; + } + + line { + stroke: ${t.textColor} + } + + .legend { + fill: ${t.textColor}; + font-family: ${t.fontFamily}; + } + + .label text { + fill: #333; + } + .label { + color: ${t.textColor} + } + + .face { + ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; + stroke: #999; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${t.arrowheadColor}; + } + + .edgePath .path { + stroke: ${t.lineColor}; + stroke-width: 1.5px; + } + + .flowchart-link { + stroke: ${t.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${t.edgeLabelBackground}; + rect { + opacity: 0.5; + } + text-align: center; + } + + .cluster rect { + } + + .cluster text { + fill: ${t.titleColor}; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${t.fontFamily}; + font-size: 12px; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .task-type-0, .section-type-0 { + ${t.fillType0?`fill: ${t.fillType0}`:""}; + } + .task-type-1, .section-type-1 { + ${t.fillType0?`fill: ${t.fillType1}`:""}; + } + .task-type-2, .section-type-2 { + ${t.fillType0?`fill: ${t.fillType2}`:""}; + } + .task-type-3, .section-type-3 { + ${t.fillType0?`fill: ${t.fillType3}`:""}; + } + .task-type-4, .section-type-4 { + ${t.fillType0?`fill: ${t.fillType4}`:""}; + } + .task-type-5, .section-type-5 { + ${t.fillType0?`fill: ${t.fillType5}`:""}; + } + .task-type-6, .section-type-6 { + ${t.fillType0?`fill: ${t.fillType6}`:""}; + } + .task-type-7, .section-type-7 { + ${t.fillType0?`fill: ${t.fillType7}`:""}; + } + + .actor-0 { + ${t.actor0?`fill: ${t.actor0}`:""}; + } + .actor-1 { + ${t.actor1?`fill: ${t.actor1}`:""}; + } + .actor-2 { + ${t.actor2?`fill: ${t.actor2}`:""}; + } + .actor-3 { + ${t.actor3?`fill: ${t.actor3}`:""}; + } + .actor-4 { + ${t.actor4?`fill: ${t.actor4}`:""}; + } + .actor-5 { + ${t.actor5?`fill: ${t.actor5}`:""}; + } + ${gt()} +`,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(u,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(o,"ambivalent"),e.score>3?u(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,u=t.append("g");Z++,u.append("line").attr("id",f+"-task"+Z).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(u,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(u,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(u,h),g+=10}),ht(a)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(i,u,p,o,g,m,x,h){const r=u.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,u,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,y=i.split(//gi);for(let d=0;d{const u=E[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remove();let m=[];if(g<=a)m=[i];else{const x=i.split(" ");let h="";o=t.append("text").attr("visibility","hidden"),x.forEach(r=>{const n=h?`${h} ${r}`:r;if(o.text(n),o.node().getBoundingClientRect().width>a){if(h&&m.push(h),h=r,o.text(r),o.node().getBoundingClientRect().width>a){let y="";for(const d of r)y+=d,o.text(y+"-"),o.node().getBoundingClientRect().width>a&&(m.push(y.slice(0,-1)+"-"),y=d);h=y}}else h=n}),h&&m.push(h),o.remove()}m.forEach((x,h)=>{const r={x:40,y:f+7+h*20,fill:"#666",text:x,textMargin:e.boxTextMargin??5},l=j.drawText(t,r).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),f+=Math.max(20,m.length*20)})}s(ut,"drawActorLegend");var $=R().journey,P=0,Xt=s(function(t,e,a,f){const i=R(),u=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel;let m;g==="sandbox"&&(m=X("#i"+e));const x=g==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body");S.init();const h=x.select("#"+e);j.initGraphics(h,e);const r=f.db.getTasks(),n=f.db.getDiagramTitle(),l=f.db.getActors();for(const C in E)delete E[C];let y=0;l.forEach(C=>{E[C]={color:$.actorColours[y%$.actorColours.length],position:y},y++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Gt(h,r,0,e);const d=S.getBounds();n&&h.append("text").text(n).attr("x",P).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",u).attr("font-family",o);const c=d.stopy-d.starty+2*$.diagramMarginY,v=P+d.stopx+2*$.diagramMarginX;$t(h,c,v,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",v-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const k=n?70:0;h.attr("viewBox",`${d.startx} -25 ${v} ${c+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:s(function(t,e,a,f){t[e]===void 0?t[e]=a:t[e]=f(a,t[e])},"updateVal"),updateBounds:s(function(t,e,a,f){const i=R().journey,u=this;let p=0;function o(g){return s(function(x){p++;const h=u.sequenceItems.length-p+1;u.updateVal(x,"starty",e-h*i.boxMargin,Math.min),u.updateVal(x,"stopy",f+h*i.boxMargin,Math.max),u.updateVal(S.data,"startx",t-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopx",a+h*i.boxMargin,Math.max),g!=="activation"&&(u.updateVal(x,"startx",t-h*i.boxMargin,Math.min),u.updateVal(x,"stopx",a+h*i.boxMargin,Math.max),u.updateVal(S.data,"starty",e-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopy",f+h*i.boxMargin,Math.max))},"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:s(function(t,e,a,f){const i=Math.min(t,a),u=Math.max(t,a),p=Math.min(e,f),o=Math.max(e,f);this.updateVal(S.data,"startx",i,Math.min),this.updateVal(S.data,"starty",p,Math.min),this.updateVal(S.data,"stopx",u,Math.max),this.updateVal(S.data,"stopy",o,Math.max),this.updateBounds(i,p,u,o)},"insert"),bumpVerticalPos:s(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:s(function(){return this.verticalPos},"getVerticalPos"),getBounds:s(function(){return this.data},"getBounds")},G=$.sectionFills,st=$.sectionColours,Gt=s(function(t,e,a,f){const i=R().journey;let u="";const p=i.height*2+i.diagramMarginY,o=a+p;let g=0,m="#CCC",x="black",h=0;for(const[r,n]of e.entries()){if(u!==n.section){m=G[g%G.length],h=g%G.length,x=st[g%st.length];let y=0;const d=n.section;for(let v=r;v(E[d]&&(y[d]=E[d]),y),{});n.x=r*i.taskMargin+r*i.width+P,n.y=o,n.width=i.diagramMarginX,n.height=i.diagramMarginY,n.colour=x,n.fill=m,n.num=h,n.actors=l,j.drawTask(t,n,i,f),S.insert(n.x,n.y,n.x+n.width+i.taskMargin,450)}},"drawTasks"),at={setConf:Ht,draw:Xt},Dt={parser:Et,db:nt,renderer:at,styles:jt,init:s(t=>{at.setConf(t.journey),nt.clear()},"init")};export{Dt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js b/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js new file mode 100644 index 0000000000..8e1cdb973d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js @@ -0,0 +1,139 @@ +import{g as gt}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-C4-rwdcv.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,d as X,e as $t,z as Mt}from"./mermaidParser.worker-Dx4jPi9z.js";import{d as it}from"./arc-Doj0wRZ0.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()+` +`+n+"^"},"showPosition"),test_match:s(function(r,n){var l,y,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),y=r[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,y;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;cn[0].length)){if(n=l,y=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[y]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,y,d){switch(y){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const u=i.map(o=>o.trim()),p={section:V,type:V,people:u,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(t=>`.label { + font-family: ${t.fontFamily}; + color: ${t.textColor}; + } + .mouth { + stroke: #666; + } + + line { + stroke: ${t.textColor} + } + + .legend { + fill: ${t.textColor}; + font-family: ${t.fontFamily}; + } + + .label text { + fill: #333; + } + .label { + color: ${t.textColor} + } + + .face { + ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; + stroke: #999; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${t.arrowheadColor}; + } + + .edgePath .path { + stroke: ${t.lineColor}; + stroke-width: 1.5px; + } + + .flowchart-link { + stroke: ${t.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${t.edgeLabelBackground}; + rect { + opacity: 0.5; + } + text-align: center; + } + + .cluster rect { + } + + .cluster text { + fill: ${t.titleColor}; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${t.fontFamily}; + font-size: 12px; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .task-type-0, .section-type-0 { + ${t.fillType0?`fill: ${t.fillType0}`:""}; + } + .task-type-1, .section-type-1 { + ${t.fillType0?`fill: ${t.fillType1}`:""}; + } + .task-type-2, .section-type-2 { + ${t.fillType0?`fill: ${t.fillType2}`:""}; + } + .task-type-3, .section-type-3 { + ${t.fillType0?`fill: ${t.fillType3}`:""}; + } + .task-type-4, .section-type-4 { + ${t.fillType0?`fill: ${t.fillType4}`:""}; + } + .task-type-5, .section-type-5 { + ${t.fillType0?`fill: ${t.fillType5}`:""}; + } + .task-type-6, .section-type-6 { + ${t.fillType0?`fill: ${t.fillType6}`:""}; + } + .task-type-7, .section-type-7 { + ${t.fillType0?`fill: ${t.fillType7}`:""}; + } + + .actor-0 { + ${t.actor0?`fill: ${t.actor0}`:""}; + } + .actor-1 { + ${t.actor1?`fill: ${t.actor1}`:""}; + } + .actor-2 { + ${t.actor2?`fill: ${t.actor2}`:""}; + } + .actor-3 { + ${t.actor3?`fill: ${t.actor3}`:""}; + } + .actor-4 { + ${t.actor4?`fill: ${t.actor4}`:""}; + } + .actor-5 { + ${t.actor5?`fill: ${t.actor5}`:""}; + } + ${gt()} +`,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(u,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(o,"ambivalent"),e.score>3?u(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,u=t.append("g");Z++,u.append("line").attr("id",f+"-task"+Z).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(u,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(u,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(u,h),g+=10}),ht(a)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(i,u,p,o,g,m,x,h){const r=u.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,u,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,y=i.split(//gi);for(let d=0;d{const u=E[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remove();let m=[];if(g<=a)m=[i];else{const x=i.split(" ");let h="";o=t.append("text").attr("visibility","hidden"),x.forEach(r=>{const n=h?`${h} ${r}`:r;if(o.text(n),o.node().getBoundingClientRect().width>a){if(h&&m.push(h),h=r,o.text(r),o.node().getBoundingClientRect().width>a){let y="";for(const d of r)y+=d,o.text(y+"-"),o.node().getBoundingClientRect().width>a&&(m.push(y.slice(0,-1)+"-"),y=d);h=y}}else h=n}),h&&m.push(h),o.remove()}m.forEach((x,h)=>{const r={x:40,y:f+7+h*20,fill:"#666",text:x,textMargin:e.boxTextMargin??5},l=j.drawText(t,r).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),f+=Math.max(20,m.length*20)})}s(ut,"drawActorLegend");var $=R().journey,P=0,Xt=s(function(t,e,a,f){const i=R(),u=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel;let m;g==="sandbox"&&(m=X("#i"+e));const x=g==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body");S.init();const h=x.select("#"+e);j.initGraphics(h,e);const r=f.db.getTasks(),n=f.db.getDiagramTitle(),l=f.db.getActors();for(const C in E)delete E[C];let y=0;l.forEach(C=>{E[C]={color:$.actorColours[y%$.actorColours.length],position:y},y++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Gt(h,r,0,e);const d=S.getBounds();n&&h.append("text").text(n).attr("x",P).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",u).attr("font-family",o);const c=d.stopy-d.starty+2*$.diagramMarginY,v=P+d.stopx+2*$.diagramMarginX;$t(h,c,v,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",v-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const k=n?70:0;h.attr("viewBox",`${d.startx} -25 ${v} ${c+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:s(function(t,e,a,f){t[e]===void 0?t[e]=a:t[e]=f(a,t[e])},"updateVal"),updateBounds:s(function(t,e,a,f){const i=R().journey,u=this;let p=0;function o(g){return s(function(x){p++;const h=u.sequenceItems.length-p+1;u.updateVal(x,"starty",e-h*i.boxMargin,Math.min),u.updateVal(x,"stopy",f+h*i.boxMargin,Math.max),u.updateVal(S.data,"startx",t-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopx",a+h*i.boxMargin,Math.max),g!=="activation"&&(u.updateVal(x,"startx",t-h*i.boxMargin,Math.min),u.updateVal(x,"stopx",a+h*i.boxMargin,Math.max),u.updateVal(S.data,"starty",e-h*i.boxMargin,Math.min),u.updateVal(S.data,"stopy",f+h*i.boxMargin,Math.max))},"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:s(function(t,e,a,f){const i=Math.min(t,a),u=Math.max(t,a),p=Math.min(e,f),o=Math.max(e,f);this.updateVal(S.data,"startx",i,Math.min),this.updateVal(S.data,"starty",p,Math.min),this.updateVal(S.data,"stopx",u,Math.max),this.updateVal(S.data,"stopy",o,Math.max),this.updateBounds(i,p,u,o)},"insert"),bumpVerticalPos:s(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:s(function(){return this.verticalPos},"getVerticalPos"),getBounds:s(function(){return this.data},"getBounds")},G=$.sectionFills,st=$.sectionColours,Gt=s(function(t,e,a,f){const i=R().journey;let u="";const p=i.height*2+i.diagramMarginY,o=a+p;let g=0,m="#CCC",x="black",h=0;for(const[r,n]of e.entries()){if(u!==n.section){m=G[g%G.length],h=g%G.length,x=st[g%st.length];let y=0;const d=n.section;for(let v=r;v(E[d]&&(y[d]=E[d]),y),{});n.x=r*i.taskMargin+r*i.width+P,n.y=o,n.width=i.diagramMarginX,n.height=i.diagramMarginY,n.colour=x,n.fill=m,n.num=h,n.actors=l,j.drawTask(t,n,i,f),S.insert(n.x,n.y,n.x+n.width+i.taskMargin,450)}},"drawTasks"),at={setConf:Ht,draw:Xt},Qt={parser:Et,db:nt,renderer:at,styles:jt,init:s(t=>{at.setConf(t.journey),nt.clear()},"init")};export{Qt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js b/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js new file mode 100644 index 0000000000..f51ae72aae --- /dev/null +++ b/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js @@ -0,0 +1,89 @@ +import{_ as o,l as te,c as H,I as fe,af as ye,ag as be,ah as me,Y as _e,G as Y,i as j,t as ke,J as Ee,V as Se,W as ce,X as le}from"./mermaidParser.worker-Dx4jPi9z.js";import{g as Ne}from"./chunk-FMBD7UC4-B2zs_Y-d.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],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[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:_,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:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:F}),e(k,[2,22]),e(k,[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:_,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(k,[2,16],{15:37,24:F}),e(k,[2,17]),e(k,[2,18]),e(k,[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(k,[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 q=b.yylloc;t.push(q);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 E,P,x,Q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`: +`+b.showPosition()+` +Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,q=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")},K=(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()+` +`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;tn[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,u[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,u[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,u){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"
      "),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=K;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const h=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===h&&!p&&(p=v[s]),v[s].levell.parentId===d.id);for(const l of m){const D={id:l.id,parentId:d.id,label:j(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};h.push(D)}}return{nodes:h,edges:e,other:{},config:H()}},"getData"),Oe=o((e,h,p,s,d)=>{const _=H();let m=_.mindmap?.padding??Y.mindmap.padding;switch(s){case y.ROUNDED_RECT:case y.RECT:case y.HEXAGON:m*=2}const l={id:j(h,_)||"kbn"+ee++,level:e,label:j(p,_),width:_.mindmap?.maxNodeWidth??Y.mindmap.maxNodeWidth,padding:m,isGroup:!1};if(d!==void 0){let I;d.includes(` +`)?I=d+` +`:I=`{ +`+d+` +}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,h)=>{switch(te.debug("In get type",e,h),e){case"[":return y.RECT;case"(":return h===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),Ce=o((e,h)=>{ie[e]=h},"setElementForId"),we=o(e=>{if(!e)return;const h=H(),p=v[v.length-1];e.icon&&(p.icon=j(e.icon,h)),e.class&&(p.cssClasses=j(e.class,h))},"decorateNode"),Ae=o(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:y,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,h,p,s)=>{te.debug(`Rendering kanban diagram +`+e);const _=s.db.getData(),m=H();m.htmlLabels=!1;const l=fe(h);for(const f of _.nodes)f.domId=`${h}-${f.id}`;const D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=_.nodes.filter(f=>f.isGroup);let w=0;const k=10,F=[];let N=25;for(const f of g){const A=m?.kanban?.sectionWidth||200;w=w+1,f.x=A*w+(w-1)*k/2,f.width=A,f.y=0,f.height=A*3,f.rx=5,f.ry=5,f.cssClasses=f.cssClasses+" section-"+w;const L=await ye(D,f);N=Math.max(N,L?.labelBBox?.height),F.push(L)}let V=0;for(const f of g){const A=F[V];V=V+1;const L=m?.kanban?.sectionWidth||200,M=-L*3/2+N;let T=M;const K=_.nodes.filter(i=>i.parentId===f.id);for(const i of K){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=f.x,i.width=L-1.5*k;const r=(await be(I,i,{config:m})).node().getBBox();i.y=T+r.height/2,await me(i),T=i.y+r.height/2+k/2}const B=A.cluster.select("rect"),O=Math.max(T-M+3*k,50)+(N-25);B.attr("height",O)}_e(void 0,l,m.mindmap?.padding??Y.kanban.padding,m.mindmap?.useMaxWidth??Y.kanban.useMaxWidth)},"draw"),Ge={draw:Be},je=o(e=>{let h="";for(let s=0;se.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s` + .edge { + stroke-width: 3; + } + ${je(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .cluster-label, .label { + color: ${e.textColor}; + fill: ${e.textColor}; + } + .kanban-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + ${Ne()} +`,"getStyles"),Me=Fe,We={db:Ve,renderer:Ge,parser:xe,styles:Me};export{We as diagram}; diff --git a/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-Dh0udSeO.js b/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-Dh0udSeO.js new file mode 100644 index 0000000000..6d9e5d1943 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/kanban-definition-UN3LZRKU-Dh0udSeO.js @@ -0,0 +1,89 @@ +import{_ as o,l as te,c as H,I as fe,ah as ye,ai as be,aj as me,af as _e,G as K,i as G,t as ke,J as Ee,ac as Se,ad as ce,ae as le}from"./mermaid.core-zKrc8Ye9.js";import{g as Ne}from"./chunk-FMBD7UC4-_3v8zWlF.js";import"./index-DtRfJ0vw.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],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[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:_,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:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:F}),e(k,[2,22]),e(k,[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:_,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(k,[2,16],{15:37,24:F}),e(k,[2,17]),e(k,[2,18]),e(k,[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(k,[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 q=b.yylloc;t.push(q);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 E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`: +`+b.showPosition()+` +Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={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&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[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(j.$),t.push(j._$),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()+` +`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;tn[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,u[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,u[a]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,u){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"
      "),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return O})();T.lexer=Y;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const h=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===h&&!p&&(p=v[s]),v[s].levell.parentId===d.id);for(const l of m){const D={id:l.id,parentId:d.id,label:G(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};h.push(D)}}return{nodes:h,edges:e,other:{},config:H()}},"getData"),Oe=o((e,h,p,s,d)=>{const _=H();let m=_.mindmap?.padding??K.mindmap.padding;switch(s){case y.ROUNDED_RECT:case y.RECT:case y.HEXAGON:m*=2}const l={id:G(h,_)||"kbn"+ee++,level:e,label:G(p,_),width:_.mindmap?.maxNodeWidth??K.mindmap.maxNodeWidth,padding:m,isGroup:!1};if(d!==void 0){let I;d.includes(` +`)?I=d+` +`:I=`{ +`+d+` +}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,h)=>{switch(te.debug("In get type",e,h),e){case"[":return y.RECT;case"(":return h===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),Ce=o((e,h)=>{ie[e]=h},"setElementForId"),we=o(e=>{if(!e)return;const h=H(),p=v[v.length-1];e.icon&&(p.icon=G(e.icon,h)),e.class&&(p.cssClasses=G(e.class,h))},"decorateNode"),Ae=o(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:y,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,h,p,s)=>{te.debug(`Rendering kanban diagram +`+e);const _=s.db.getData(),m=H();m.htmlLabels=!1;const l=fe(h);for(const f of _.nodes)f.domId=`${h}-${f.id}`;const D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=_.nodes.filter(f=>f.isGroup);let w=0;const k=10,F=[];let N=25;for(const f of g){const A=m?.kanban?.sectionWidth||200;w=w+1,f.x=A*w+(w-1)*k/2,f.width=A,f.y=0,f.height=A*3,f.rx=5,f.ry=5,f.cssClasses=f.cssClasses+" section-"+w;const L=await ye(D,f);N=Math.max(N,L?.labelBBox?.height),F.push(L)}let V=0;for(const f of g){const A=F[V];V=V+1;const L=m?.kanban?.sectionWidth||200,M=-L*3/2+N;let T=M;const Y=_.nodes.filter(i=>i.parentId===f.id);for(const i of Y){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=f.x,i.width=L-1.5*k;const r=(await be(I,i,{config:m})).node().getBBox();i.y=T+r.height/2,await me(i),T=i.y+r.height/2+k/2}const B=A.cluster.select("rect"),O=Math.max(T-M+3*k,50)+(N-25);B.attr("height",O)}_e(void 0,l,m.mindmap?.padding??K.kanban.padding,m.mindmap?.useMaxWidth??K.kanban.useMaxWidth)},"draw"),je={draw:Be},Ge=o(e=>{let h="";for(let s=0;se.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s` + .edge { + stroke-width: 3; + } + ${Ge(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .cluster-label, .label { + color: ${e.textColor}; + fill: ${e.textColor}; + } + .kanban-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + ${Ne()} +`,"getStyles"),Me=Fe,ze={db:Ve,renderer:je,parser:xe,styles:Me};export{ze as diagram}; diff --git a/apps/kimi-code/dist-web/assets/layout-C1ojF0zw.js b/apps/kimi-code/dist-web/assets/layout-C1ojF0zw.js new file mode 100644 index 0000000000..e8d8787813 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/layout-C1ojF0zw.js @@ -0,0 +1 @@ +import{a as Y,b as O,d as Ee,e as q,c as K,f as Ke,g as fe,h as Xe,j as jn,k as He,s as Mn,o as Rn,l as $n,m as de,n as Fn,p as se,r as Bn,q as ze,t as Gn,u as Dn,v as Yn,U as Te,S as Pe,w as ce,x as le,y as U,z as Je,A as Ze,B as Un,C as N,D as Vn,E as Wn,F as qn,H as Le,I as Kn,J as Qe,K as C,L as Xn,M as Hn,N as B,O as en,P as nn,Q as zn,R as he,T as rn,V as Jn,W as tn,X as Zn,Y as Qn,G as E,Z as c,_ as er,i as x,$ as R,a0 as I,a1 as X}from"./graph-BwjfAU3j.js";var nr=/\s/;function rr(e){for(var n=e.length;n--&&nr.test(e.charAt(n)););return n}var tr=/^\s+/;function ir(e){return e&&e.slice(0,rr(e)+1).replace(tr,"")}var Ne=NaN,ar=/^[-+]0x[0-9a-f]+$/i,or=/^0b[01]+$/i,ur=/^0o[0-7]+$/i,fr=parseInt;function dr(e){if(typeof e=="number")return e;if(Y(e))return Ne;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ir(e);var r=or.test(e);return r||ur.test(e)?fr(e.slice(2),r?2:8):ar.test(e)?Ne:+e}var Ie=1/0,sr=17976931348623157e292;function G(e){if(!e)return e===0?e:0;if(e=dr(e),e===Ie||e===-Ie){var n=e<0?-1:1;return n*sr}return e===e?e:0}function cr(e){var n=G(e),r=n%1;return n===n?r?n-r:n:0}var _e=Object.create,lr=(function(){function e(){}return function(n){if(!O(n))return{};if(_e)return _e(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function an(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&&S(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var Kt=Math.max;function Xt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:cr(r);return i<0&&(i=Kt(t+i,0)),Xn(e,C(n),i)}var be=qt(Xt);function wn(e,n){var r=-1,t=K(e)?Array(e.length):[];return Hn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=N(e)?B:wn;return r(e,C(n))}function Ht(e,n){return e==null?e:Qe(e,en(n),P)}function zt(e,n){return e&&nn(e,en(n))}function Jt(e,n){return e>n}var Zt=Object.prototype,Qt=Zt.hasOwnProperty;function ei(e,n){return e!=null&&Qt.call(e,n)}function gn(e,n){return e!=null&&zn(e,n,ei)}function mn(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 oi(e,n,r){n.length?n=B(n,function(o){return N(o)?function(a){return tn(a,o.length===1?o[0]:o)}:o}):n=[he];var t=-1;n=B(n,le(C));var i=wn(e,function(o,a,u){var f=B(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return ti(i,function(o,a){return ai(o,a,r)})}function ui(e,n){return ri(e,n,function(r,t){return Zn(e,t)})}var W=yr(function(e,n){return e==null?{}:ui(e,n)}),fi=Math.ceil,di=Math.max;function si(e,n,r,t){for(var i=-1,o=di(fi((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function ci(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=G(n),r===void 0?(r=n,n=0):r=G(r),t=t===void 0?n1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),oi(e,He(n),[])}),li=0;function me(e){var n=++li;return Qn(e)+n}function hi(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(Q(e,n,r,a,!0));break}}}return t}function Q(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,ue(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,ue(n,r,d)}),e.removeNode(t.v),o}function yi(e,n){var r=new E,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=_(i+t+3).map(function(){return new pi}),a=t+1;return c(r.nodes(),function(u){ue(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ue(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 xi(e){var n=e.graph().acyclicer==="greedy"?gi(e,r(e)):Oi(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,me("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Oi(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 Ei(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 k(e,n,r,t){var i;do i=me(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function Ti(e){var n=new E().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 yn(e){var n=new E({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 Fe(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(_(xn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;x(i)||(n[i][t.order]=r)}),n}function Pi(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);gn(t,"rank")&&(t.rank-=n)})}function Li(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){x(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Be(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),k(e,"border",i,n)}function xn(e){return T(g(e.nodes(),function(n){var r=e.node(n).rank;if(!x(r))return r}))}function Ni(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ii(e,n){return n()}function _i(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=R(n.edges(),function(s){return f===Ye(e,e.node(s.v),u)&&f!==Ye(e,e.node(s.w),u)});return ge(d,function(s){return M(n,s)})}function Cn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),Oe(e),xe(e,n),Vi(e,n)}function Vi(e,n){var r=be(e.nodes(),function(i){return!n.node(i).parent}),t=Yi(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 Wi(e,n,r){return e.hasEdge(n,r)}function Ye(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function qi(e){switch(e.graph().ranker){case"network-simplex":Ue(e);break;case"tight-tree":Xi(e);break;case"longest-path":Ki(e);break;default:Ue(e)}}var Ki=ye;function Xi(e){ye(e),En(e)}function Ue(e){L(e)}function Hi(e){var n=k(e,"root",{},"_root"),r=zi(e),t=T(I(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Ji(e)+1;c(e.children(),function(a){An(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function An(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=Be(e,"_bt"),d=Be(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){An(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,m=v!==p?1:i-o[a]+1;e.setEdge(f,v,{weight:w,minlen:m,nestingEdge:!0}),e.setEdge(p,d,{weight:w,minlen:m,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function zi(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 Ji(e){return X(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Zi(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 Qi(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 ea(e,n,r){var t=na(e),i=new E({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=x(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 na(e){for(var n;e.hasNode(n=me("_root")););return n}function ra(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 ia(e){var n={},r=R(e.nodes(),function(u){return!e.children(u).length}),t=T(g(r,function(u){return e.node(u).rank})),i=g(_(t+1),function(){return[]});function o(u){if(!gn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=F(r,function(u){return e.node(u).rank});return c(a,o),i}function aa(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=X(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 oa(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};x(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!x(o)&&!x(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=R(r,function(i){return!i.indegree});return ua(t)}function ua(e){var n=[];function r(o){return function(a){a.merged||(x(a.barycenter)||x(o.barycenter)||a.barycenter>=o.barycenter)&&fa(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(R(n,function(o){return!o.merged}),function(o){return W(o,["vs","i","barycenter","weight"])})}function fa(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 da(e,n){var r=Ni(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=F(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(sa(!!n)),f=Ve(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=Ve(o,i,f)});var d={vs:A(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function Ve(e,n,r){for(var t;n.length&&(t=V(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function sa(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function kn(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=R(i,function(p){return p!==a&&p!==u}));var d=aa(e,i);c(d,function(p){if(e.children(p.v).length){var w=kn(e,p.v,r,t);f[p.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&la(p,w)}});var s=oa(d,r);ca(s,f);var l=da(s,t);if(a&&(l.vs=A([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=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+v.order)/(l.weight+2),l.weight+=2}return l}function ca(e,n){c(e,function(r){r.vs=A(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function la(e,n){x(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 ha(e){var n=xn(e),r=We(e,_(1,n+1),"inEdges"),t=We(e,_(n-1,-1,-1),"outEdges"),i=ia(e);qe(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){va(u%2?r:t,u%4>=2),i=Z(e);var d=ra(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 wa(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 ga(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=V(o);return c(o,function(s,l){var h=ya(e,s),v=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(p){c(e.predecessors(p),function(w){var m=e.node(w),y=m.order;(yd)&&Sn(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 X(n,i),r}function ya(e,n){if(e.node(n).dummy)return be(e.predecessors(n),function(r){return e.node(r).dummy})}function Sn(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 xa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Oa(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=F(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=s[h];o[d]===d&&f{var t=r(" buildLayoutGraph",()=>Ua(e));r(" runLayout",()=>Sa(t,r)),r(" updateInputGraph",()=>ja(e,t))})}function Sa(e,n){n(" makeSpaceForEdgeLabels",()=>Va(e)),n(" removeSelfEdges",()=>Qa(e)),n(" acyclic",()=>xi(e)),n(" nestingGraph.run",()=>Hi(e)),n(" rank",()=>qi(yn(e))),n(" injectEdgeLabelProxies",()=>Wa(e)),n(" removeEmptyRanks",()=>Li(e)),n(" nestingGraph.cleanup",()=>Zi(e)),n(" normalizeRanks",()=>Pi(e)),n(" assignRankMinMax",()=>qa(e)),n(" removeEdgeLabelProxies",()=>Ka(e)),n(" normalize.run",()=>ji(e)),n(" parentDummyChains",()=>pa(e)),n(" addBorderSegments",()=>_i(e)),n(" order",()=>ha(e)),n(" insertSelfEdges",()=>eo(e)),n(" adjustCoordinateSystem",()=>Ci(e)),n(" position",()=>Aa(e)),n(" positionSelfEdges",()=>no(e)),n(" removeBorderNodes",()=>Za(e)),n(" normalize.undo",()=>Ri(e)),n(" fixupEdgeLabelCoords",()=>za(e)),n(" undoCoordinateSystem",()=>Ai(e)),n(" translateGraph",()=>Xa(e)),n(" assignNodeIntersects",()=>Ha(e)),n(" reversePoints",()=>Ja(e)),n(" acyclic.undo",()=>Ei(e))}function ja(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 Ma=["nodesep","edgesep","ranksep","marginx","marginy"],Ra={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$a=["acyclicer","ranker","rankdir","align"],Fa=["width","height"],Ba={width:0,height:0},Ga=["minlen","weight","width","height","labeloffset"],Da={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ya=["labelpos"];function Ua(e){var n=new E({multigraph:!0,compound:!0}),r=te(e.graph());return n.setGraph(oe({},Ra,re(r,Ma),W(r,$a))),c(e.nodes(),function(t){var i=te(e.node(t));n.setNode(t,Ut(re(i,Fa),Ba)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=te(e.edge(t));n.setEdge(t,oe({},Da,re(i,Ga),W(i,Ya)))}),n}function Va(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 Wa(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};k(e,"edge-proxy",o,"_ep")}})}function qa(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=T(n,t.maxRank))}),e.graph().maxRank=n}function Ka(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 Xa(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,v=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/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 Ha(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(Fe(t,o)),r.points.push(Fe(i,a))})}function za(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 Ja(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Za(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(V(r.borderLeft)),a=e.node(V(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 Qa(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 eo(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){k(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 no(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 re(e,n){return J(W(e,n),Number)}function te(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{D as b,to as l,g as m}; diff --git a/apps/kimi-code/dist-web/assets/layout-SsrduOYp.js b/apps/kimi-code/dist-web/assets/layout-SsrduOYp.js new file mode 100644 index 0000000000..075c0be737 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/layout-SsrduOYp.js @@ -0,0 +1 @@ +import{a as Y,b as O,d as Ee,e as q,c as K,f as Ke,g as fe,h as Xe,j as jn,k as He,s as Mn,o as Rn,l as $n,m as de,n as Fn,p as se,r as Bn,q as ze,t as Gn,u as Dn,v as Yn,U as Te,S as Pe,w as ce,x as le,y as U,z as Je,A as Ze,B as Un,C as N,D as Vn,E as Wn,F as qn,H as Le,I as Kn,J as Qe,K as C,L as Xn,M as Hn,N as B,O as en,P as nn,Q as zn,R as he,T as rn,V as Jn,W as tn,X as Zn,Y as Qn,G as E,Z as c,_ as er,i as x,$ as R,a0 as I,a1 as X}from"./graph--OzhPTMs.js";var nr=/\s/;function rr(e){for(var n=e.length;n--&&nr.test(e.charAt(n)););return n}var tr=/^\s+/;function ir(e){return e&&e.slice(0,rr(e)+1).replace(tr,"")}var Ne=NaN,ar=/^[-+]0x[0-9a-f]+$/i,or=/^0b[01]+$/i,ur=/^0o[0-7]+$/i,fr=parseInt;function dr(e){if(typeof e=="number")return e;if(Y(e))return Ne;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ir(e);var r=or.test(e);return r||ur.test(e)?fr(e.slice(2),r?2:8):ar.test(e)?Ne:+e}var Ie=1/0,sr=17976931348623157e292;function G(e){if(!e)return e===0?e:0;if(e=dr(e),e===Ie||e===-Ie){var n=e<0?-1:1;return n*sr}return e===e?e:0}function cr(e){var n=G(e),r=n%1;return n===n?r?n-r:n:0}var _e=Object.create,lr=(function(){function e(){}return function(n){if(!O(n))return{};if(_e)return _e(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function an(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&&S(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var Kt=Math.max;function Xt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:cr(r);return i<0&&(i=Kt(t+i,0)),Xn(e,C(n),i)}var be=qt(Xt);function wn(e,n){var r=-1,t=K(e)?Array(e.length):[];return Hn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=N(e)?B:wn;return r(e,C(n))}function Ht(e,n){return e==null?e:Qe(e,en(n),P)}function zt(e,n){return e&&nn(e,en(n))}function Jt(e,n){return e>n}var Zt=Object.prototype,Qt=Zt.hasOwnProperty;function ei(e,n){return e!=null&&Qt.call(e,n)}function gn(e,n){return e!=null&&zn(e,n,ei)}function mn(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 oi(e,n,r){n.length?n=B(n,function(o){return N(o)?function(a){return tn(a,o.length===1?o[0]:o)}:o}):n=[he];var t=-1;n=B(n,le(C));var i=wn(e,function(o,a,u){var f=B(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return ti(i,function(o,a){return ai(o,a,r)})}function ui(e,n){return ri(e,n,function(r,t){return Zn(e,t)})}var W=yr(function(e,n){return e==null?{}:ui(e,n)}),fi=Math.ceil,di=Math.max;function si(e,n,r,t){for(var i=-1,o=di(fi((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function ci(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=G(n),r===void 0?(r=n,n=0):r=G(r),t=t===void 0?n1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),oi(e,He(n),[])}),li=0;function me(e){var n=++li;return Qn(e)+n}function hi(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(Q(e,n,r,a,!0));break}}}return t}function Q(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,ue(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,ue(n,r,d)}),e.removeNode(t.v),o}function yi(e,n){var r=new E,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=_(i+t+3).map(function(){return new pi}),a=t+1;return c(r.nodes(),function(u){ue(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ue(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 xi(e){var n=e.graph().acyclicer==="greedy"?gi(e,r(e)):Oi(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,me("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Oi(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 Ei(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 k(e,n,r,t){var i;do i=me(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function Ti(e){var n=new E().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 yn(e){var n=new E({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 Fe(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(_(xn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;x(i)||(n[i][t.order]=r)}),n}function Pi(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);gn(t,"rank")&&(t.rank-=n)})}function Li(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){x(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Be(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),k(e,"border",i,n)}function xn(e){return T(g(e.nodes(),function(n){var r=e.node(n).rank;if(!x(r))return r}))}function Ni(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ii(e,n){return n()}function _i(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=R(n.edges(),function(s){return f===Ye(e,e.node(s.v),u)&&f!==Ye(e,e.node(s.w),u)});return ge(d,function(s){return M(n,s)})}function Cn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),Oe(e),xe(e,n),Vi(e,n)}function Vi(e,n){var r=be(e.nodes(),function(i){return!n.node(i).parent}),t=Yi(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 Wi(e,n,r){return e.hasEdge(n,r)}function Ye(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function qi(e){switch(e.graph().ranker){case"network-simplex":Ue(e);break;case"tight-tree":Xi(e);break;case"longest-path":Ki(e);break;default:Ue(e)}}var Ki=ye;function Xi(e){ye(e),En(e)}function Ue(e){L(e)}function Hi(e){var n=k(e,"root",{},"_root"),r=zi(e),t=T(I(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Ji(e)+1;c(e.children(),function(a){An(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function An(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=Be(e,"_bt"),d=Be(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){An(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,m=v!==p?1:i-o[a]+1;e.setEdge(f,v,{weight:w,minlen:m,nestingEdge:!0}),e.setEdge(p,d,{weight:w,minlen:m,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function zi(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 Ji(e){return X(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Zi(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 Qi(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 ea(e,n,r){var t=na(e),i=new E({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=x(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 na(e){for(var n;e.hasNode(n=me("_root")););return n}function ra(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 ia(e){var n={},r=R(e.nodes(),function(u){return!e.children(u).length}),t=T(g(r,function(u){return e.node(u).rank})),i=g(_(t+1),function(){return[]});function o(u){if(!gn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=F(r,function(u){return e.node(u).rank});return c(a,o),i}function aa(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=X(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 oa(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};x(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!x(o)&&!x(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=R(r,function(i){return!i.indegree});return ua(t)}function ua(e){var n=[];function r(o){return function(a){a.merged||(x(a.barycenter)||x(o.barycenter)||a.barycenter>=o.barycenter)&&fa(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(R(n,function(o){return!o.merged}),function(o){return W(o,["vs","i","barycenter","weight"])})}function fa(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 da(e,n){var r=Ni(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=F(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(sa(!!n)),f=Ve(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=Ve(o,i,f)});var d={vs:A(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function Ve(e,n,r){for(var t;n.length&&(t=V(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function sa(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function kn(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=R(i,function(p){return p!==a&&p!==u}));var d=aa(e,i);c(d,function(p){if(e.children(p.v).length){var w=kn(e,p.v,r,t);f[p.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&la(p,w)}});var s=oa(d,r);ca(s,f);var l=da(s,t);if(a&&(l.vs=A([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=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+v.order)/(l.weight+2),l.weight+=2}return l}function ca(e,n){c(e,function(r){r.vs=A(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function la(e,n){x(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 ha(e){var n=xn(e),r=We(e,_(1,n+1),"inEdges"),t=We(e,_(n-1,-1,-1),"outEdges"),i=ia(e);qe(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){va(u%2?r:t,u%4>=2),i=Z(e);var d=ra(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 wa(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 ga(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=V(o);return c(o,function(s,l){var h=ya(e,s),v=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(p){c(e.predecessors(p),function(w){var m=e.node(w),y=m.order;(yd)&&Sn(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 X(n,i),r}function ya(e,n){if(e.node(n).dummy)return be(e.predecessors(n),function(r){return e.node(r).dummy})}function Sn(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 xa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Oa(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=F(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=s[h];o[d]===d&&f{var t=r(" buildLayoutGraph",()=>Ua(e));r(" runLayout",()=>Sa(t,r)),r(" updateInputGraph",()=>ja(e,t))})}function Sa(e,n){n(" makeSpaceForEdgeLabels",()=>Va(e)),n(" removeSelfEdges",()=>Qa(e)),n(" acyclic",()=>xi(e)),n(" nestingGraph.run",()=>Hi(e)),n(" rank",()=>qi(yn(e))),n(" injectEdgeLabelProxies",()=>Wa(e)),n(" removeEmptyRanks",()=>Li(e)),n(" nestingGraph.cleanup",()=>Zi(e)),n(" normalizeRanks",()=>Pi(e)),n(" assignRankMinMax",()=>qa(e)),n(" removeEdgeLabelProxies",()=>Ka(e)),n(" normalize.run",()=>ji(e)),n(" parentDummyChains",()=>pa(e)),n(" addBorderSegments",()=>_i(e)),n(" order",()=>ha(e)),n(" insertSelfEdges",()=>eo(e)),n(" adjustCoordinateSystem",()=>Ci(e)),n(" position",()=>Aa(e)),n(" positionSelfEdges",()=>no(e)),n(" removeBorderNodes",()=>Za(e)),n(" normalize.undo",()=>Ri(e)),n(" fixupEdgeLabelCoords",()=>za(e)),n(" undoCoordinateSystem",()=>Ai(e)),n(" translateGraph",()=>Xa(e)),n(" assignNodeIntersects",()=>Ha(e)),n(" reversePoints",()=>Ja(e)),n(" acyclic.undo",()=>Ei(e))}function ja(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 Ma=["nodesep","edgesep","ranksep","marginx","marginy"],Ra={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$a=["acyclicer","ranker","rankdir","align"],Fa=["width","height"],Ba={width:0,height:0},Ga=["minlen","weight","width","height","labeloffset"],Da={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ya=["labelpos"];function Ua(e){var n=new E({multigraph:!0,compound:!0}),r=te(e.graph());return n.setGraph(oe({},Ra,re(r,Ma),W(r,$a))),c(e.nodes(),function(t){var i=te(e.node(t));n.setNode(t,Ut(re(i,Fa),Ba)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=te(e.edge(t));n.setEdge(t,oe({},Da,re(i,Ga),W(i,Ya)))}),n}function Va(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 Wa(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};k(e,"edge-proxy",o,"_ep")}})}function qa(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=T(n,t.maxRank))}),e.graph().maxRank=n}function Ka(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 Xa(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,v=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/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 Ha(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(Fe(t,o)),r.points.push(Fe(i,a))})}function za(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 Ja(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Za(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(V(r.borderLeft)),a=e.node(V(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 Qa(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 eo(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){k(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 no(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 re(e,n){return J(W(e,n),Number)}function te(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{D as b,to as l,g as m}; diff --git a/apps/kimi-code/dist-web/assets/linear-3mB6q2-g.js b/apps/kimi-code/dist-web/assets/linear-3mB6q2-g.js new file mode 100644 index 0000000000..2845e523d8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/linear-3mB6q2-g.js @@ -0,0 +1 @@ +import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaidParser.worker-Dx4jPi9z.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-CCNgq9ws.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/kimi-code/dist-web/assets/linear-JZGc9yht.js b/apps/kimi-code/dist-web/assets/linear-JZGc9yht.js new file mode 100644 index 0000000000..e6153f11db --- /dev/null +++ b/apps/kimi-code/dist-web/assets/linear-JZGc9yht.js @@ -0,0 +1 @@ +import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-zKrc8Ye9.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/kimi-code/dist-web/assets/mermaid.core-zKrc8Ye9.js b/apps/kimi-code/dist-web/assets/mermaid.core-zKrc8Ye9.js new file mode 100644 index 0000000000..f7115acc74 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/mermaid.core-zKrc8Ye9.js @@ -0,0 +1,309 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-BM42HDAG-D1rsVyHJ.js","assets/graph--OzhPTMs.js","assets/layout-SsrduOYp.js","assets/index-DtRfJ0vw.js","assets/index-ByWw02oy.css","assets/cose-bilkent-S5V4N54A-FADnp6Lk.js","assets/cytoscape.esm-nFXppDBa.js","assets/c4Diagram-AAUBKEIU-DjQbQYqy.js","assets/chunk-ND2GUHAM-D-Pih1kA.js","assets/flowDiagram-I6XJVG4X-ChzNYmSi.js","assets/chunk-FMBD7UC4-_3v8zWlF.js","assets/chunk-55IACEB6-mUr9lxTD.js","assets/chunk-2J33WTMH-BlbqWzB_.js","assets/channel-Bt325_7a.js","assets/erDiagram-TEJ5UH35-BiQkmfSz.js","assets/gitGraphDiagram-PVQCEYII-XdaI0ZOj.js","assets/chunk-4BX2VUAB-Bjjry6OZ.js","assets/chunk-QZHKN3VN-Dyzf1Pwd.js","assets/wardley-L42UT6IY-gSV1j6uw.js","assets/ganttDiagram-6RSMTGT7-DQcybq4U.js","assets/linear-JZGc9yht.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-5YYISTIA-B1S64SqR.js","assets/pieDiagram-4H26LBE5-DA34Bt67.js","assets/arc-DtCnpCZe.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-W4KKPZXB-DToe-wqP.js","assets/xychartDiagram-2RQKCTM6-zsCch4aR.js","assets/requirementDiagram-4Y6WPE33-CgOSnyR8.js","assets/sequenceDiagram-3UESZ5HK-BwZabocW.js","assets/classDiagram-4FO5ZUOK-DpkPh8gn.js","assets/chunk-727SXJPM-hp-BfASB.js","assets/classDiagram-v2-Q7XG4LA2-DpkPh8gn.js","assets/stateDiagram-AJRCARHV-BJcdTFrX.js","assets/chunk-AQP2D5EJ-DbRpkGly.js","assets/stateDiagram-v2-BHNVJYJU-DpW8Zeth.js","assets/journeyDiagram-JHISSGLW-BhwFOFOc.js","assets/timeline-definition-PNZ67QCA-DRsCTcc3.js","assets/mindmap-definition-RKZ34NQL-B2x0JCB3.js","assets/kanban-definition-UN3LZRKU-Dh0udSeO.js","assets/sankeyDiagram-5OEKKPKP-DBhf2qeh.js","assets/diagram-LMA3HP47-WWKSVuAU.js","assets/diagram-2AECGRRQ-BSy9xCZO.js","assets/blockDiagram-GPEHLZMM-CilEmNW0.js","assets/diagram-5GNKFQAL-BsckzYNE.js","assets/architectureDiagram-3BPJPVTR-bSps5znF.js","assets/diagram-KO2AKTUF-C4GWXOE2.js","assets/ishikawaDiagram-YF4QCWOH-O5IEMrWO.js","assets/vennDiagram-CIIHVFJN-B95s0NJK.js","assets/diagram-OG6HWLK6-B6TtcB01.js","assets/wardleyDiagram-YWT4CUSO-CnvLrs5Q.js"])))=>i.map(i=>d[i]); +import{bR as pt}from"./index-DtRfJ0vw.js";function qm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bo={exports:{}},Wm=bo.exports,Fl;function zm(){return Fl||(Fl=1,(function(e,t){(function(r,i){e.exports=i()})(Wm,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\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,b={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(F){var A=["th","st","nd","rd"],L=F%100;return"["+F+(A[(L-20)%10]||A[L]||A[0])+"]"}},k=function(F,A,L){var M=String(F);return!M||M.length>=A?F:""+Array(A+1-M.length).join(L)+F},w={s:k,z:function(F){var A=-F.utcOffset(),L=Math.abs(A),M=Math.floor(L/60),D=L%60;return(A<=0?"+":"-")+k(M,2,"0")+":"+k(D,2,"0")},m:function F(A,L){if(A.date()1)return F(Y[0])}else{var lt=A.name;_[lt]=A,D=lt}return!M&&D&&(S=D),D||!M&&S},I=function(F,A){if(B(F))return F.clone();var L=typeof A=="object"?A:{};return L.date=F,L.args=arguments,new H(L)},R=w;R.l=q,R.i=B,R.w=function(F,A){return I(F,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var H=(function(){function F(L){this.$L=q(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[E]=!0}var A=F.prototype;return A.parse=function(L){this.$d=(function(M){var D=M.date,z=M.utc;if(D===null)return new Date(NaN);if(R.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var Y=D.match(y);if(Y){var lt=Y[2]-1||0,gt=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],lt,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,gt)):new Date(Y[1],lt,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,gt)}}return new Date(D)})(L),this.init()},A.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},A.$utils=function(){return R},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(L,M){var D=I(L);return this.startOf(M)<=D&&D<=this.endOf(M)},A.isAfter=function(L,M){return I(L)dc(e,"name",{value:t,configurable:!0}),Um=(e,t)=>{for(var r in t)dc(e,r,{get:t[r],enumerable:!0})},Re={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},N={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},ln=p(function(e="fatal"){let t=Re.fatal;typeof e=="string"?e.toLowerCase()in Re&&(t=Re[e]):typeof e=="number"&&(t=e),N.trace=()=>{},N.debug=()=>{},N.info=()=>{},N.warn=()=>{},N.error=()=>{},N.fatal=()=>{},t<=Re.fatal&&(N.fatal=console.error?console.error.bind(console,se("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",se("FATAL"))),t<=Re.error&&(N.error=console.error?console.error.bind(console,se("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",se("ERROR"))),t<=Re.warn&&(N.warn=console.warn?console.warn.bind(console,se("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",se("WARN"))),t<=Re.info&&(N.info=console.info?console.info.bind(console,se("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",se("INFO"))),t<=Re.debug&&(N.debug=console.debug?console.debug.bind(console,se("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",se("DEBUG"))),t<=Re.trace&&(N.trace=console.debug?console.debug.bind(console,se("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",se("TRACE")))},"setLogLevel"),se=p(e=>`%c${Ym().format("ss.SSS")} : ${e} : `,"format");const ko={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 o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return ko.hue2rgb(s,o,e+1/3)*255;case"g":return ko.hue2rgb(s,o,e)*255;case"b":return ko.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){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},Gm={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},at={channel:ko,lang:jm,unit:Gm},Ze={};for(let e=0;e<=255;e++)Ze[e]=at.unit.dec2hex(e);const zt={ALL:0,RGB:1,HSL:2};class Xm{constructor(){this.type=zt.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=zt.ALL}is(t){return this.type===t}}class Vm{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Xm}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=zt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=at.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=at.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=at.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=at.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=at.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=at.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(zt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(zt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(zt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(zt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(zt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(zt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(zt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(zt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(zt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(zt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(zt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(zt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ds=new Vm({r:0,g:0,b:0,a:0},"transparent"),Yr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Yr.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ds.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}${Ze[Math.round(o*255)]}`:`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}`}},fr={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(fr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return at.channel.clamp.h(parseFloat(r)*.9);case"rad":return at.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return at.channel.clamp.h(parseFloat(r)*360)}}return at.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(fr.re);if(!r)return;const[,i,o,s,a,n]=r;return ds.set({h:fr._hue2deg(i),s:at.channel.clamp.s(parseFloat(o)),l:at.channel.clamp.l(parseFloat(s)),a:a?at.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%, ${o})`:`hsl(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%)`}},Bi={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=Bi.colors[e];if(t)return Yr.parse(t)},stringify:e=>{const t=Yr.stringify(e);for(const r in Bi.colors)if(Bi.colors[r]===t)return r}},Ci={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(Ci.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ds.set({r:at.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:at.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:at.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?at.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)}, ${at.lang.round(o)})`:`rgb(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)})`}},Ae={format:{keyword:Bi,hex:Yr,rgb:Ci,rgba:Ci,hsl:fr,hsla:fr},parse:e=>{if(typeof e!="string")return e;const t=Yr.parse(e)||Ci.parse(e)||fr.parse(e)||Bi.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(zt.HSL)||e.data.r===void 0?fr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Ci.stringify(e):Yr.stringify(e)},uc=(e,t)=>{const r=Ae.parse(e);for(const i in t)r[i]=at.channel.clamp[i](t[i]);return Ae.stringify(r)},tr=(e,t,r=0,i=1)=>{if(typeof e!="number")return uc(e,{a:t});const o=ds.set({r:at.channel.clamp.r(e),g:at.channel.clamp.g(t),b:at.channel.clamp.b(r),a:at.channel.clamp.a(i)});return Ae.stringify(o)},Zm=e=>{const{r:t,g:r,b:i}=Ae.parse(e),o=.2126*at.channel.toLinear(t)+.7152*at.channel.toLinear(r)+.0722*at.channel.toLinear(i);return at.lang.round(o)},Km=e=>Zm(e)>=.5,xe=e=>!Km(e),fc=(e,t,r)=>{const i=Ae.parse(e),o=i[t],s=at.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Ae.stringify(i)},$=(e,t)=>fc(e,"l",t),O=(e,t)=>fc(e,"l",-t),x=(e,t)=>{const r=Ae.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return uc(e,i)},Qm=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Ae.parse(e),{r:n,g:l,b:c,a:h}=Ae.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,C=i*m+n*y,b=o*m+l*y,k=s*m+c*y,w=a*d+h*(1-d);return tr(C,b,k,w)},v=(e,t=100)=>{const r=Ae.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Qm(r,e,t)};/*! @license DOMPurify 3.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.7/LICENSE */function Al(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r2?i-2:0),s=2;s1?r-1:0),o=1;o"u"?null:Mt(BigInt.prototype.toString),Dl=typeof Symbol>"u"?null:Mt(Symbol.prototype.toString),Lt=Mt(Object.prototype.hasOwnProperty),hi=Mt(Object.prototype.toString),Pt=Mt(RegExp.prototype.test),ci=uy(TypeError);function Mt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:xi;if(El&&El(e,null),!Gt(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){const s=r(o);s!==o&&(oy(t)||(t[i]=s),o=s)}e[o]=!0}return e}function fy(e){for(let t=0;t/g),by=ae(/\${[\w\W]*/g),ky=ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ty=ae(/^aria-[\-\w]+$/),Wl=ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wy=ae(/^(?:\w+script|data):/i),Sy=ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_y=ae(/^html$/i),vy=ae(/^[a-z][.\w]*(-[.\w]+)+$/i),Se={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},By=function(){return typeof window>"u"?null:window},Ly=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(i=r.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},zl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function mc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:By();const t=Q=>mc(Q);if(t.version="3.4.7",t.removed=[],!e||!e.document||e.document.nodeType!==Se.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const i=r,o=i.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,n=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,d=e.trustedTypes,f=n.prototype,u=_e(f,"cloneNode"),g=_e(f,"remove"),m=_e(f,"nextSibling"),y=_e(f,"childNodes"),C=_e(f,"parentNode"),b=_e(f,"shadowRoot"),k=_e(f,"attributes"),w=a&&a.prototype?_e(a.prototype,"nodeType"):null,S=a&&a.prototype?_e(a.prototype,"nodeName"):null;if(typeof s=="function"){const Q=r.createElement("template");Q.content&&Q.content.ownerDocument&&(r=Q.content.ownerDocument)}let _,E="";const B=r,q=B.implementation,I=B.createNodeIterator,R=B.createDocumentFragment,H=B.getElementsByTagName,W=i.importNode;let F=zl();t.isSupported=typeof pc=="function"&&typeof C=="function"&&q&&q.createHTMLDocument!==void 0;const A=Cy,L=xy,M=by,D=ky,z=Ty,Y=wy,lt=Sy,gt=vy;let dt=Wl,tt=null;const mt=nt({},[...Rl,...zs,...Hs,...Ys,...Pl]);let G=null;const ct=nt({},[...Nl,...Us,...ql,...no]);let st=Object.seal(Pr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),kt=null,Tt=null;const wt=Object.seal(Pr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let le=!0,Ie=!0,vr=!1,cl=!0,Ve=!1,si=!0,nr=!1,As=!1,Es=!1,Br=!1,to=!1,eo=!1,dl=!0,ul=!1;const fl="user-content-";let Ms=!0,ai=!1,Lr={},ke=null;const $s=nt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let pl=null;const gl=nt({},["audio","video","img","source","image","track"]);let Os=null;const ml=nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ro="http://www.w3.org/1998/Math/MathML",io="http://www.w3.org/2000/svg",Te="http://www.w3.org/1999/xhtml";let Fr=Te,Is=!1,Ds=null;const $m=nt({},[ro,io,Te],Ws);let Rs=nt({},["mi","mo","mn","ms","mtext"]),Ps=nt({},["annotation-xml"]);const Om=nt({},["title","style","font","a","script"]);let ni=null;const Im=["application/xhtml+xml","text/html"],Dm="text/html";let Ft=null,Ar=null;const Rm=r.createElement("form"),yl=function(T){return T instanceof RegExp||T instanceof Function},Ns=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ar&&Ar===T)return;(!T||typeof T!="object")&&(T={}),T=Wt(T),ni=Im.indexOf(T.PARSER_MEDIA_TYPE)===-1?Dm:T.PARSER_MEDIA_TYPE,Ft=ni==="application/xhtml+xml"?Ws:xi,tt=Lt(T,"ALLOWED_TAGS")&&Gt(T.ALLOWED_TAGS)?nt({},T.ALLOWED_TAGS,Ft):mt,G=Lt(T,"ALLOWED_ATTR")&&Gt(T.ALLOWED_ATTR)?nt({},T.ALLOWED_ATTR,Ft):ct,Ds=Lt(T,"ALLOWED_NAMESPACES")&&Gt(T.ALLOWED_NAMESPACES)?nt({},T.ALLOWED_NAMESPACES,Ws):$m,Os=Lt(T,"ADD_URI_SAFE_ATTR")&&Gt(T.ADD_URI_SAFE_ATTR)?nt(Wt(ml),T.ADD_URI_SAFE_ATTR,Ft):ml,pl=Lt(T,"ADD_DATA_URI_TAGS")&&Gt(T.ADD_DATA_URI_TAGS)?nt(Wt(gl),T.ADD_DATA_URI_TAGS,Ft):gl,ke=Lt(T,"FORBID_CONTENTS")&&Gt(T.FORBID_CONTENTS)?nt({},T.FORBID_CONTENTS,Ft):$s,kt=Lt(T,"FORBID_TAGS")&&Gt(T.FORBID_TAGS)?nt({},T.FORBID_TAGS,Ft):Wt({}),Tt=Lt(T,"FORBID_ATTR")&&Gt(T.FORBID_ATTR)?nt({},T.FORBID_ATTR,Ft):Wt({}),Lr=Lt(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Wt(T.USE_PROFILES):T.USE_PROFILES:!1,le=T.ALLOW_ARIA_ATTR!==!1,Ie=T.ALLOW_DATA_ATTR!==!1,vr=T.ALLOW_UNKNOWN_PROTOCOLS||!1,cl=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=T.SAFE_FOR_TEMPLATES||!1,si=T.SAFE_FOR_XML!==!1,nr=T.WHOLE_DOCUMENT||!1,Br=T.RETURN_DOM||!1,to=T.RETURN_DOM_FRAGMENT||!1,eo=T.RETURN_TRUSTED_TYPE||!1,Es=T.FORCE_BODY||!1,dl=T.SANITIZE_DOM!==!1,ul=T.SANITIZE_NAMED_PROPS||!1,Ms=T.KEEP_CONTENT!==!1,ai=T.IN_PLACE||!1,dt=gy(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Wl,Fr=typeof T.NAMESPACE=="string"?T.NAMESPACE:Te,Rs=Lt(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?Wt(T.MATHML_TEXT_INTEGRATION_POINTS):nt({},["mi","mo","mn","ms","mtext"]),Ps=Lt(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?Wt(T.HTML_INTEGRATION_POINTS):nt({},["annotation-xml"]);const P=Lt(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?Wt(T.CUSTOM_ELEMENT_HANDLING):Pr(null);if(st=Pr(null),Lt(P,"tagNameCheck")&&yl(P.tagNameCheck)&&(st.tagNameCheck=P.tagNameCheck),Lt(P,"attributeNameCheck")&&yl(P.attributeNameCheck)&&(st.attributeNameCheck=P.attributeNameCheck),Lt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),Ve&&(Ie=!1),to&&(Br=!0),Lr&&(tt=nt({},Pl),G=Pr(null),Lr.html===!0&&(nt(tt,Rl),nt(G,Nl)),Lr.svg===!0&&(nt(tt,zs),nt(G,Us),nt(G,no)),Lr.svgFilters===!0&&(nt(tt,Hs),nt(G,Us),nt(G,no)),Lr.mathMl===!0&&(nt(tt,Ys),nt(G,ql),nt(G,no))),wt.tagCheck=null,wt.attributeCheck=null,Lt(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?wt.tagCheck=T.ADD_TAGS:Gt(T.ADD_TAGS)&&(tt===mt&&(tt=Wt(tt)),nt(tt,T.ADD_TAGS,Ft))),Lt(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?wt.attributeCheck=T.ADD_ATTR:Gt(T.ADD_ATTR)&&(G===ct&&(G=Wt(G)),nt(G,T.ADD_ATTR,Ft))),Lt(T,"ADD_URI_SAFE_ATTR")&&Gt(T.ADD_URI_SAFE_ATTR)&&nt(Os,T.ADD_URI_SAFE_ATTR,Ft),Lt(T,"FORBID_CONTENTS")&&Gt(T.FORBID_CONTENTS)&&(ke===$s&&(ke=Wt(ke)),nt(ke,T.FORBID_CONTENTS,Ft)),Lt(T,"ADD_FORBID_CONTENTS")&&Gt(T.ADD_FORBID_CONTENTS)&&(ke===$s&&(ke=Wt(ke)),nt(ke,T.ADD_FORBID_CONTENTS,Ft)),Ms&&(tt["#text"]=!0),nr&&nt(tt,["html","head","body"]),tt.table&&(nt(tt,["tbody"]),delete kt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw ci('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ci('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=T.TRUSTED_TYPES_POLICY,E=_.createHTML("")}else _===void 0&&(_=Ly(d,o)),_!==null&&typeof E=="string"&&(E=_.createHTML(""));(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&tt===mt&&(tt=Wt(tt)),F.uponSanitizeAttribute.length>0&&G===ct&&(G=Wt(G)),Zt&&Zt(T),Ar=T},Cl=nt({},[...zs,...Hs,...my]),xl=nt({},[...Ys,...yy]),Pm=function(T){let P=C(T);(!P||!P.tagName)&&(P={namespaceURI:Fr,tagName:"template"});const U=xi(T.tagName),xt=xi(P.tagName);return Ds[T.namespaceURI]?T.namespaceURI===io?P.namespaceURI===Te?U==="svg":P.namespaceURI===ro?U==="svg"&&(xt==="annotation-xml"||Rs[xt]):!!Cl[U]:T.namespaceURI===ro?P.namespaceURI===Te?U==="math":P.namespaceURI===io?U==="math"&&Ps[xt]:!!xl[U]:T.namespaceURI===Te?P.namespaceURI===io&&!Ps[xt]||P.namespaceURI===ro&&!Rs[xt]?!1:!xl[U]&&(Om[U]||!Cl[U]):!!(ni==="application/xhtml+xml"&&Ds[T.namespaceURI]):!1},he=function(T){$r(t.removed,{element:T});try{C(T).removeChild(T)}catch{g(T)}},lr=function(T,P){try{$r(t.removed,{attribute:P.getAttributeNode(T),from:P})}catch{$r(t.removed,{attribute:null,from:P})}if(P.removeAttribute(T),T==="is")if(Br||to)try{he(P)}catch{}else try{P.setAttribute(T,"")}catch{}},bl=function(T){let P=null,U=null;if(Es)T=""+T;else{const St=$l(T,/^[\r\n\t ]+/);U=St&&St[0]}ni==="application/xhtml+xml"&&Fr===Te&&(T=''+T+"");const xt=_?_.createHTML(T):T;if(Fr===Te)try{P=new h().parseFromString(xt,ni)}catch{}if(!P||!P.documentElement){P=q.createDocument(Fr,"template",null);try{P.documentElement.innerHTML=Is?E:xt}catch{}}const ut=P.body||P.documentElement;return T&&U&&ut.insertBefore(r.createTextNode(U),ut.childNodes[0]||null),Fr===Te?H.call(P,nr?"html":"body")[0]:nr?P.documentElement:ut},kl=function(T){return I.call(T.ownerDocument||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Tl=function(T){T.normalize();const P=I.call(T.ownerDocument||T,T,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let U=P.nextNode();for(;U;){let xt=U.data;Mr([A,L,M],ut=>{xt=Or(xt,ut," ")}),U.data=xt,U=P.nextNode()}},oo=function(T){const P=S?S(T):null;return typeof P!="string"||Ft(P)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==k(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==w(T)||T.childNodes!==y(T)},li=function(T){if(!w||typeof T!="object"||T===null)return!1;try{return w(T)===Se.documentFragment}catch{return!1}},so=function(T){if(!w||typeof T!="object"||T===null)return!1;try{return typeof w(T)=="number"}catch{return!1}};function De(Q,T,P){Mr(Q,U=>{U.call(t,T,P,Ar)})}const wl=function(T){let P=null;if(De(F.beforeSanitizeElements,T,null),oo(T))return he(T),!0;const U=Ft(T.nodeName);if(De(F.uponSanitizeElement,T,{tagName:U,allowedTags:tt}),si&&T.hasChildNodes()&&!so(T.firstElementChild)&&Pt(/<[/\w!]/g,T.innerHTML)&&Pt(/<[/\w!]/g,T.textContent)||si&&T.namespaceURI===Te&&U==="style"&&so(T.firstElementChild)||T.nodeType===Se.progressingInstruction||si&&T.nodeType===Se.comment&&Pt(/<[/\w]/g,T.data))return he(T),!0;if(kt[U]||!(wt.tagCheck instanceof Function&&wt.tagCheck(U))&&!tt[U]){if(!kt[U]&&_l(U)&&(st.tagNameCheck instanceof RegExp&&Pt(st.tagNameCheck,U)||st.tagNameCheck instanceof Function&&st.tagNameCheck(U)))return!1;if(Ms&&!ke[U]){const ut=C(T),St=y(T);if(St&&ut){const oe=St.length;for(let we=oe-1;we>=0;--we){const ce=u(St[we],!0);ut.insertBefore(ce,m(T))}}}return he(T),!0}return(w?w(T):T.nodeType)===Se.element&&!Pm(T)||(U==="noscript"||U==="noembed"||U==="noframes")&&Pt(/<\/no(script|embed|frames)/i,T.innerHTML)?(he(T),!0):(Ve&&T.nodeType===Se.text&&(P=T.textContent,Mr([A,L,M],ut=>{P=Or(P,ut," ")}),T.textContent!==P&&($r(t.removed,{element:T.cloneNode()}),T.textContent=P)),De(F.afterSanitizeElements,T,null),!1)},Sl=function(T,P,U){if(Tt[P]||dl&&(P==="id"||P==="name")&&(U in r||U in Rm))return!1;const xt=G[P]||wt.attributeCheck instanceof Function&&wt.attributeCheck(P,T);if(!(Ie&&!Tt[P]&&Pt(D,P))){if(!(le&&Pt(z,P))){if(!xt||Tt[P]){if(!(_l(T)&&(st.tagNameCheck instanceof RegExp&&Pt(st.tagNameCheck,T)||st.tagNameCheck instanceof Function&&st.tagNameCheck(T))&&(st.attributeNameCheck instanceof RegExp&&Pt(st.attributeNameCheck,P)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(P,T))||P==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&Pt(st.tagNameCheck,U)||st.tagNameCheck instanceof Function&&st.tagNameCheck(U))))return!1}else if(!Os[P]){if(!Pt(dt,Or(U,lt,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&T!=="script"&&Ol(U,"data:")===0&&pl[T])){if(!(vr&&!Pt(Y,Or(U,lt,"")))){if(U)return!1}}}}}}return!0},Nm=nt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_l=function(T){return!Nm[xi(T)]&&Pt(gt,T)},vl=function(T){De(F.beforeSanitizeAttributes,T,null);const P=T.attributes;if(!P||oo(T))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let xt=P.length;for(;xt--;){const ut=P[xt],St=ut.name,oe=ut.namespaceURI,we=ut.value,ce=Ft(St),qs=we;let Dt=St==="value"?qs:hy(qs);if(U.attrName=ce,U.attrValue=Dt,U.keepAttr=!0,U.forceKeepAttr=void 0,De(F.uponSanitizeAttribute,T,U),Dt=U.attrValue,ul&&(ce==="id"||ce==="name")&&Ol(Dt,fl)!==0&&(lr(St,T),Dt=fl+Dt),si&&Pt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Dt)){lr(St,T);continue}if(ce==="attributename"&&$l(Dt,"href")){lr(St,T);continue}if(U.forceKeepAttr)continue;if(!U.keepAttr){lr(St,T);continue}if(!cl&&Pt(/\/>/i,Dt)){lr(St,T);continue}Ve&&Mr([A,L,M],Ll=>{Dt=Or(Dt,Ll," ")});const Bl=Ft(T.nodeName);if(!Sl(Bl,ce,Dt)){lr(St,T);continue}if(_&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!oe)switch(d.getAttributeType(Bl,ce)){case"TrustedHTML":{Dt=_.createHTML(Dt);break}case"TrustedScriptURL":{Dt=_.createScriptURL(Dt);break}}if(Dt!==qs)try{oe?T.setAttributeNS(oe,St,Dt):T.setAttribute(St,Dt),oo(T)?he(T):Ml(t.removed)}catch{lr(St,T)}}De(F.afterSanitizeAttributes,T,null)},ao=function(T){let P=null;const U=kl(T);for(De(F.beforeSanitizeShadowDOM,T,null);P=U.nextNode();)if(De(F.uponSanitizeShadowNode,P,null),wl(P),vl(P),li(P.content)&&ao(P.content),(w?w(P):P.nodeType)===Se.element){const ut=b?b(P):P.shadowRoot;li(ut)&&(Er(ut),ao(ut))}De(F.afterSanitizeShadowDOM,T,null)},Er=function(T){const P=w?w(T):T.nodeType;if(P===Se.element){const ut=b?b(T):T.shadowRoot;li(ut)&&(Er(ut),ao(ut))}const U=y?y(T):T.childNodes;if(!U)return;const xt=[];Mr(U,ut=>{$r(xt,ut)});for(const ut of xt)Er(ut);if(P===Se.element){const ut=S?S(T):null;if(typeof ut=="string"&&Ft(ut)==="template"){const St=T.content;li(St)&&Er(St)}}};return t.sanitize=function(Q){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,U=null,xt=null,ut=null;if(Is=!Q,Is&&(Q=""),typeof Q!="string"&&!so(Q)&&(Q=py(Q),typeof Q!="string"))throw ci("dirty is not a string, aborting");if(!t.isSupported)return Q;if(As||Ns(T),t.removed=[],typeof Q=="string"&&(ai=!1),ai){const we=S?S(Q):Q.nodeName;if(typeof we=="string"){const ce=Ft(we);if(!tt[ce]||kt[ce])throw ci("root node is forbidden and cannot be sanitized in-place")}if(oo(Q))throw ci("root node is clobbered and cannot be sanitized in-place");Er(Q)}else if(so(Q))P=bl(""),U=P.ownerDocument.importNode(Q,!0),U.nodeType===Se.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?P=U:P.appendChild(U),Er(U);else{if(!Br&&!Ve&&!nr&&Q.indexOf("<")===-1)return _&&eo?_.createHTML(Q):Q;if(P=bl(Q),!P)return Br?null:eo?E:""}P&&Es&&he(P.firstChild);const St=kl(ai?Q:P);for(;xt=St.nextNode();)wl(xt),vl(xt),li(xt.content)&&ao(xt.content);if(ai)return Ve&&Tl(Q),Q;if(Br){if(Ve&&Tl(P),to)for(ut=R.call(P.ownerDocument);P.firstChild;)ut.appendChild(P.firstChild);else ut=P;return(G.shadowroot||G.shadowrootmode)&&(ut=W.call(i,ut,!0)),ut}let oe=nr?P.outerHTML:P.innerHTML;return nr&&tt["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Pt(_y,P.ownerDocument.doctype.name)&&(oe=" +`+oe),Ve&&Mr([A,L,M],we=>{oe=Or(oe,we," ")}),_&&eo?_.createHTML(oe):oe},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ns(Q),As=!0},t.clearConfig=function(){Ar=null,As=!1},t.isValidAttribute=function(Q,T,P){Ar||Ns({});const U=Ft(Q),xt=Ft(T);return Sl(U,xt,P)},t.addHook=function(Q,T){typeof T=="function"&&$r(F[Q],T)},t.removeHook=function(Q,T){if(T!==void 0){const P=ny(F[Q],T);return P===-1?void 0:ly(F[Q],P,1)[0]}return Ml(F[Q])},t.removeHooks=function(Q){F[Q]=[]},t.removeAllHooks=function(){F=zl()},t}var Gr=mc(),yc=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Li=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Fy=/\s*%%.*\n/gm,Cc=class extends Error{static{p(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},Cr={},hn=p(function(e,t){e=e.replace(yc,"").replace(Li,"").replace(Fy,` +`);for(const[r,{detector:i}]of Object.entries(Cr))if(i(e,t))return r;throw new Cc(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),ha=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)xc(t,r,i)},"registerLazyLoadedDiagrams"),xc=p((e,t,r)=>{Cr[e]&&N.warn(`Detector with key ${e} already exists. Overwriting.`),Cr[e]={detector:t,loader:r},N.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),Ay=p(e=>Cr[e].loader,"getDiagramLoader"),ca=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>ca(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=ca(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),Ot=ca,Me="#ffffff",$e="#f2f2f2",ot=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),Ey=class{static{p(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor),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||$(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||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,10)):(this.rowOdd=this.rowOdd||$(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},My=p(e=>{const t=new Ey;return t.calculate(e),t},"getThemeVariables"),$y=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=v(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.lineColor=v(this.background),this.textColor=v(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(v("#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=O("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=O(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||$(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||O(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=$(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=$(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.altSectionBkgColor=this.background,this.taskBkgColor=$(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=v(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=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Oy=p(e=>{const t=new $y;return t.calculate(e),t},"getThemeVariables"),Iy=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.lineColor=v(this.background),this.textColor=v(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ot(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||O(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||O(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]})}},Dy=p(e=>{const t=new Iy;return t.calculate(e),t},"getThemeVariables"),Ry=class{static{p(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=$("#cde498",10),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.primaryColor),this.lineColor=v(this.background),this.textColor=v(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=O(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.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||O(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||O(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Py=p(e=>{const t=new Ry;return t.calculate(e),t},"getThemeVariables"),Ny=class{static{p(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=$(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.lineColor=v(this.background),this.textColor=v(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||$(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=$(this.contrast,55),this.border2=this.contrast,this.actorBorder=$(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,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]})}},qy=p(e=>{const t=new Ny;return t.calculate(e),t},"getThemeVariables"),Wy=class{static{p(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=ot(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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||x(e,{h:30}),this.cScale4=this.cScale4||x(e,{h:60}),this.cScale5=this.cScale5||x(e,{h:90}),this.cScale6=this.cScale6||x(e,{h:120}),this.cScale7=this.cScale7||x(e,{h:150}),this.cScale8=this.cScale8||x(e,{h:210,l:150}),this.cScale9=this.cScale9||x(e,{h:270}),this.cScale10=this.cScale10||x(e,{h:300}),this.cScale11=this.cScale11||x(e,{h:330}),this.darkMode)for(let o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},zy=p(e=>{const t=new Wy;return t.calculate(e),t},"getThemeVariables"),Hy=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=v(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(v("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=v(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor),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||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Yy=p(e=>{const t=new Hy;return t.calculate(e),t},"getThemeVariables"),Uy=class{static{p(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=ot("#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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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 o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},jy=p(e=>{const t=new Uy;return t.calculate(e),t},"getThemeVariables"),Gy=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=v(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(v("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=v(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor),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||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Xy=p(e=>{const t=new Gy;return t.calculate(e),t},"getThemeVariables"),Vy=class{static{p(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=ot(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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 o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Zy=p(e=>{const t=new Vy;return t.calculate(e),t},"getThemeVariables"),Ky=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=v(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=v(this.primaryColor),this.secondaryTextColor=v(this.secondaryColor),this.tertiaryTextColor=v(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(v("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=v(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||v(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||v(this.tertiaryColor),this.lineColor=this.lineColor||v(this.background),this.arrowheadColor=this.arrowheadColor||v(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||v(this.lineColor),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||$(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]})}},Qy=p(e=>{const t=new Ky;return t.calculate(e),t},"getThemeVariables"),We={base:{getThemeVariables:My},dark:{getThemeVariables:Oy},default:{getThemeVariables:Dy},forest:{getThemeVariables:Py},neutral:{getThemeVariables:qy},neo:{getThemeVariables:zy},"neo-dark":{getThemeVariables:Yy},redux:{getThemeVariables:jy},"redux-dark":{getThemeVariables:Xy},"redux-color":{getThemeVariables:Zy},"redux-dark-color":{getThemeVariables:Qy}},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},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},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,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},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},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},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},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},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},bc={...jt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:We.default.getThemeVariables(),sequence:{...jt.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...jt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...jt.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...jt.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(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},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}},kc=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...kc(e[i],"")]:[...r,t+i],[]),"keyify"),Jy=new Set(kc(bc,"")),Tc=bc,Oo=p(e=>{if(N.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Oo(t));return}for(const t of Object.keys(e)){if(N.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Jy.has(t)||e[t]==null){N.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){if(t==="nodeColors"){const i=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const o of Object.keys(e[t]))(typeof e[t][o]!="string"||!i.test(e[t][o]))&&(N.debug("sanitize deleting invalid color:",o,e[t][o]),delete e[t][o])}else N.debug("sanitizing object",t),Oo(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(N.debug("sanitizing css option",t),e[t]=wc(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]="")}N.debug("After sanitization",e)}},"sanitizeDirective"),wc=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Jt=Ot({},Xr),Io,xr=[],Fi=Ot({},Xr),us=p((e,t)=>{let r=Ot({},e),i={};for(const o of t)vc(o),i=Ot(i,o);if(r=Ot(r,i),i.theme&&i.theme in We){const o=Ot({},Io),s=Ot(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in We&&(r.themeVariables=We[r.theme].getThemeVariables(s))}return Fi=r,Lc(Fi),Fi},"updateCurrentConfig"),t0=p(e=>(Jt=Ot({},Xr),Jt=Ot(Jt,e),e.theme&&We[e.theme]&&(Jt.themeVariables=We[e.theme].getThemeVariables(e.themeVariables)),us(Jt,xr),Jt),"setSiteConfig"),e0=p(e=>{Io=Ot({},e)},"saveConfigFromInitialize"),r0=p(e=>(Jt=Ot(Jt,e),us(Jt,xr),Jt),"updateSiteConfig"),Sc=p(()=>Ot({},Jt),"getSiteConfig"),_c=p(e=>(Lc(e),Ot(Fi,e),vt()),"setConfig"),vt=p(()=>Ot({},Fi),"getConfig"),vc=p(e=>{e&&(["secure",...Jt.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(N.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"&&vc(e[t])}))},"sanitize"),i0=p(e=>{Oo(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),xr.push(e),us(Jt,xr)},"addDirective"),Do=p((e=Jt)=>{xr=[],us(e,xr)},"reset"),o0={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."},Hl={},Bc=p(e=>{Hl[e]||(N.warn(o0[e]),Hl[e]=!0)},"issueWarning"),Lc=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bc("LAZY_LOAD_DEPRECATED")},"checkConfig"),xB=p(()=>{let e={};Io&&(e=Ot(e,Io));for(const t of xr)e=Ot(e,t);return e},"getUserDefinedConfig"),Kt=p(e=>(e.flowchart?.htmlLabels!=null&&Bc("FLOWCHART_HTML_LABELS_DEPRECATED"),je(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Ui=//gi,s0=p(e=>e?Ec(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),a0=(()=>{let e=!1;return()=>{e||(Fc(),e=!0)}})();function Fc(){const e="data-temp-href-target";Gr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Gr.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"))})}p(Fc,"setupDompurifyHooks");var Ac=p(e=>(a0(),Gr.sanitize(e)),"removeScript"),Yl=p((e,t)=>{if(Kt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Ac(e):r!=="loose"&&(e=Ec(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=c0(e))}return e},"sanitizeMore"),Ce=p((e,t)=>e&&(t.dompurifyConfig?e=Gr.sanitize(Yl(e,t),t.dompurifyConfig).toString():e=Gr.sanitize(Yl(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),n0=p((e,t)=>typeof e=="string"?Ce(e,t):e.flat().map(r=>Ce(r,t)),"sanitizeTextOrArray"),l0=p(e=>Ui.test(e),"hasBreaks"),h0=p(e=>e.split(Ui),"splitBreaks"),c0=p(e=>e.replace(/#br#/g,"
      "),"placeholderToBreak"),Ec=p(e=>e.replace(Ui,"#br#"),"breakToPlaceholder"),d0=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),u0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),f0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Ul=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),p0=p((e,t)=>{const r=da(e,"~"),i=da(t,"~");return r===1&&i===1},"shouldCombineSets"),g0=p(e=>{const t=da(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),jl=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ua=/\$\$(.*)\$\$/g,$i=p(e=>(e.match(ua)?.length??0)>0,"hasKatex"),bB=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Mc(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 o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),m0=p(async(e,t)=>{if(!$i(e))return e;if(!(jl()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ua,"MathML is unsupported in this environment.");{const{default:r}=await pt(async()=>{const{default:o}=await import("./katex-HP8lGamR.js");return{default:o}},[]),i=t.forceLegacyMathML||!jl()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ui).map(o=>$i(o)?`
      ${o}
      `:`
      ${o}
      `).join("").replace(ua,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Mc=p(async(e,t)=>Ce(await m0(e,t),t),"renderKatexSanitized"),ji={getRows:s0,sanitizeText:Ce,sanitizeTextOrArray:n0,hasBreaks:l0,splitBreaks:h0,lineBreakRegex:Ui,removeScript:Ac,getUrl:d0,evaluate:je,getMax:u0,getMin:f0},y0=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),C0=p(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"),$c=p(function(e,t,r,i){const o=C0(t,r,i);y0(e,o)},"configureSvgSize"),x0=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;N.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;N.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,N.info(`Calculated bounds: ${n}x${l}`),$c(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),To={};function fa(e){return[...e.cssRules].map(t=>t.cssText).join(` +`)}p(fa,"cssStyleSheetToString");var b0=p((e,t,r,i)=>{let o="";return e in To&&To[e]?o=To[e]({...r,svgId:i}):N.warn(`No theme found for ${e}`),` & { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + fill: ${r.textColor} + } + @keyframes edge-animation-frame { + from { + stroke-dashoffset: 0; + } + } + @keyframes dash { + to { + stroke-dashoffset: 0; + } + } + & .edge-animation-slow { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 50s linear infinite; + stroke-linecap: round; + } + & .edge-animation-fast { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 20s linear infinite; + stroke-linecap: round; + } + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${r.errorBkgColor}; + } + & .error-text { + fill: ${r.errorTextColor}; + stroke: ${r.errorTextColor}; + } + + & .edge-thickness-normal { + stroke-width: ${r.strokeWidth??1}px; + } + & .edge-thickness-thick { + stroke-width: 3.5px + } + & .edge-pattern-solid { + stroke-dasharray: 0; + } + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } + & .edge-pattern-dashed{ + stroke-dasharray: 3; + } + .edge-pattern-dotted { + stroke-dasharray: 2; + } + + & .marker { + fill: ${r.lineColor}; + stroke: ${r.lineColor}; + } + & .marker.cross { + stroke: ${r.lineColor}; + } + + & svg { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + } + & p { + margin: 0 + } + + ${o} + .node .neo-node { + stroke: ${r.nodeBorder}; + } + + [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + + [data-look="neo"].node path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + stroke-width: ${r.strokeWidth??1}px; + } + + [data-look="neo"].node .outer-path { + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node .neo-line path { + stroke: ${r.nodeBorder}; + filter: none; + } + + [data-look="neo"].node circle{ + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node circle .state-start{ + fill: #000000; + } + + [data-look="neo"].icon-shape .icon { + fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].icon-shape .icon-neo path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + ${t} +`},"getStyles"),k0=p((e,t)=>{t!==void 0&&(To[e]=t)},"addStylesForDiagram"),T0=b0,Oc={};Um(Oc,{clear:()=>w0,getAccDescription:()=>B0,getAccTitle:()=>_0,getDiagramTitle:()=>F0,setAccDescription:()=>v0,setAccTitle:()=>S0,setDiagramTitle:()=>L0});var cn="",dn="",un="",fn=p(e=>Ce(e,vt()),"sanitizeText"),w0=p(()=>{cn="",un="",dn=""},"clear"),S0=p(e=>{cn=fn(e).replace(/^\s+/g,"")},"setAccTitle"),_0=p(()=>cn,"getAccTitle"),v0=p(e=>{un=fn(e).replace(/\n\s+/g,` +`)},"setAccDescription"),B0=p(()=>un,"getAccDescription"),L0=p(e=>{dn=fn(e)},"setDiagramTitle"),F0=p(()=>dn,"getDiagramTitle"),Gl=N,A0=ln,yt=vt,kB=_c,TB=Xr,pn=p(e=>Ce(e,yt()),"sanitizeText"),E0=x0,M0=p(()=>Oc,"getCommonDb"),Ro={},Po=p((e,t,r)=>{Ro[e]&&Gl.warn(`Diagram with id ${e} already registered. Overwriting.`),Ro[e]=t,r&&xc(e,r),k0(e,t.styles),t.injectUtils?.(Gl,A0,yt,pn,E0,M0(),()=>{})},"registerDiagram"),pa=p(e=>{if(e in Ro)return Ro[e];throw new $0(e)},"getDiagram"),$0=class extends Error{static{p(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}},O0={value:()=>{}};function Ic(){for(var e=0,t=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}wo.prototype=Ic.prototype={constructor:wo,on:function(e,t){var r=this._,i=I0(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var r=new Array(o),i=0,o,s;i=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Vl.hasOwnProperty(t)?{space:Vl[t],local:e}:e}function R0(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ga&&t.documentElement.namespaceURI===ga?t.createElement(e):t.createElementNS(r,e)}}function P0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Dc(e){var t=fs(e);return(t.local?P0:R0)(t)}function N0(){}function gn(e){return e==null?N0:function(){return this.querySelector(e)}}function q0(e){typeof e!="function"&&(e=gn(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o=k&&(k=b+1);!(S=y[k])&&++k=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function dC(e){e||(e=uC);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;st?1:e>=t?0:NaN}function fC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pC(){return Array.from(this)}function gC(){for(var e=this._groups,t=0,r=e.length;t1?this.each((t==null?vC:typeof t=="function"?LC:BC)(e,t,r??"")):Vr(this.node(),e)}function Vr(e,t){return e.style.getPropertyValue(t)||Wc(e).getComputedStyle(e,null).getPropertyValue(t)}function AC(e){return function(){delete this[e]}}function EC(e,t){return function(){this[e]=t}}function MC(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function $C(e,t){return arguments.length>1?this.each((t==null?AC:typeof t=="function"?MC:EC)(e,t)):this.node()[e]}function zc(e){return e.trim().split(/^|\s+/)}function mn(e){return e.classList||new Hc(e)}function Hc(e){this._node=e,this._names=zc(e.getAttribute("class")||"")}Hc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Yc(e,t){for(var r=mn(e),i=-1,o=t.length;++i=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function nx(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?lo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?lo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mx.exec(e))?new ee(t[1],t[2],t[3],1):(t=yx.exec(e))?new ee(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Cx.exec(e))?lo(t[1],t[2],t[3],t[4]):(t=xx.exec(e))?lo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bx.exec(e))?rh(t[1],t[2]/100,t[3]/100,1):(t=kx.exec(e))?rh(t[1],t[2]/100,t[3]/100,t[4]):Zl.hasOwnProperty(e)?Jl(Zl[e]):e==="transparent"?new ee(NaN,NaN,NaN,0):null}function Jl(e){return new ee(e>>16&255,e>>8&255,e&255,1)}function lo(e,t,r,i){return i<=0&&(e=t=r=NaN),new ee(e,t,r,i)}function Sx(e){return e instanceof Xi||(e=Di(e)),e?(e=e.rgb(),new ee(e.r,e.g,e.b,e.opacity)):new ee}function ma(e,t,r,i){return arguments.length===1?Sx(e):new ee(e,t,r,i??1)}function ee(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}yn(ee,ma,Xc(Xi,{brighter(e){return e=e==null?qo:Math.pow(qo,e),new ee(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oi:Math.pow(Oi,e),new ee(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ee(yr(this.r),yr(this.g),yr(this.b),Wo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:th,formatHex:th,formatHex8:_x,formatRgb:eh,toString:eh}));function th(){return`#${pr(this.r)}${pr(this.g)}${pr(this.b)}`}function _x(){return`#${pr(this.r)}${pr(this.g)}${pr(this.b)}${pr((isNaN(this.opacity)?1:this.opacity)*255)}`}function eh(){const e=Wo(this.opacity);return`${e===1?"rgb(":"rgba("}${yr(this.r)}, ${yr(this.g)}, ${yr(this.b)}${e===1?")":`, ${e})`}`}function Wo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pr(e){return e=yr(e),(e<16?"0":"")+e.toString(16)}function rh(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,r,i)}function Vc(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof Xi||(e=Di(e)),!e)return new pe;if(e instanceof pe)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r0&&l<1?0:a,new pe(a,n,l,e.opacity)}function vx(e,t,r,i){return arguments.length===1?Vc(e):new pe(e,t,r,i??1)}function pe(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}yn(pe,vx,Xc(Xi,{brighter(e){return e=e==null?qo:Math.pow(qo,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oi:Math.pow(Oi,e),new pe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new ee(js(e>=240?e-240:e+120,o,i),js(e,o,i),js(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new pe(ih(this.h),ho(this.s),ho(this.l),Wo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wo(this.opacity);return`${e===1?"hsl(":"hsla("}${ih(this.h)}, ${ho(this.s)*100}%, ${ho(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ih(e){return e=(e||0)%360,e<0?e+360:e}function ho(e){return Math.max(0,Math.min(1,e||0))}function js(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Cn=e=>()=>e;function Zc(e,t){return function(r){return e+r*t}}function Bx(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function wB(e,t){var r=t-e;return r?Zc(e,r>180||r<-180?r-360*Math.round(r/360):r):Cn(isNaN(e)?t:e)}function Lx(e){return(e=+e)==1?Kc:function(t,r){return r-t?Bx(t,r,e):Cn(isNaN(t)?r:t)}}function Kc(e,t){var r=t-e;return r?Zc(e,r):Cn(isNaN(e)?t:e)}const oh=(function e(t){var r=Lx(t);function i(o,s){var a=r((o=ma(o)).r,(s=ma(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=Kc(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Ke(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var ya=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gs=new RegExp(ya.source,"g");function Fx(e){return function(){return e}}function Ax(e){return function(t){return e(t)+""}}function Ex(e,t){var r=ya.lastIndex=Gs.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=ya.exec(e))&&(o=Gs.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Ke(i,o)})),r=Gs.lastIndex;return r180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Ke(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Ke(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:Ke(c,d)},{i:m-2,x:Ke(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var g=-1,m=f.length,y;++g=0&&e._call.call(void 0,t),e=e._next;--Zr}function ah(){br=(Ho=Ri.now())+ps,Zr=bi=0;try{Rx()}finally{Zr=0,Nx(),br=0}}function Px(){var e=Ri.now(),t=e-Ho;t>td&&(ps-=t,Ho=e)}function Nx(){for(var e,t=zo,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:zo=r);ki=e,xa(i)}function xa(e){if(!Zr){bi&&(bi=clearTimeout(bi));var t=e-br;t>24?(e<1/0&&(bi=setTimeout(ah,e-Ri.now()-ps)),di&&(di=clearInterval(di))):(di||(Ho=Ri.now(),di=setInterval(Px,td)),Zr=1,ed(ah))}}function nh(e,t,r){var i=new Yo;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var qx=Ic("start","end","cancel","interrupt"),Wx=[],id=0,lh=1,ba=2,So=3,hh=4,ka=5,_o=6;function gs(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;zx(e,r,{name:t,index:i,group:o,on:qx,tween:Wx,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:id})}function bn(e,t){var r=be(e,t);if(r.state>id)throw new Error("too late; already scheduled");return r}function Oe(e,t){var r=be(e,t);if(r.state>So)throw new Error("too late; already running");return r}function be(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function zx(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=rd(s,0,r.time);function s(c){r.state=lh,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==lh)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===So)return nh(a);u.state===hh?(u.state=_o,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+hba&&i.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function xb(e,t,r){var i,o,s=Cb(t)?bn:Oe;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function bb(e,t){var r=this._id;return arguments.length<2?be(this.node(),r).on.on(e):this.each(xb(r,e,t))}function kb(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Tb(){return this.on("end.remove",kb(this._id))}function wb(e){var t=this._name,r=this._id;typeof e!="function"&&(e=gn(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nd;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;odr)if(!(Math.abs(d*l-c*h)>dr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,C=Math.sqrt(m),b=Math.sqrt(f),k=s*Math.tan((Ta-Math.acos((m+f-y)/(2*C*b)))/2),w=k/b,S=k/C;Math.abs(w-1)>dr&&this._append`L${t+w*h},${r+w*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>dr||Math.abs(this._y1-h)>dr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%wa+wa),f>Xb?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>dr&&this._append`A${i},${i},0,${+(f>=Ta)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function Ir(e){return function(){return e}}const SB=Math.abs,_B=Math.atan2,vB=Math.cos,BB=Math.max,LB=Math.min,FB=Math.sin,AB=Math.sqrt,ch=1e-12,Tn=Math.PI,dh=Tn/2,EB=2*Tn;function MB(e){return e>1?0:e<-1?Tn:Math.acos(e)}function $B(e){return e>=1?dh:e<=-1?-dh:Math.asin(e)}function Kb(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new Zb(t)}function Qb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ld(e){this._context=e}ld.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ai(e){return new ld(e)}function Jb(e){return e[0]}function tk(e){return e[1]}function ek(e,t){var r=Ir(!0),i=null,o=Ai,s=null,a=Kb(n);e=typeof e=="function"?e:e===void 0?Jb:Ir(e),t=typeof t=="function"?t:t===void 0?tk:Ir(t);function n(l){var c,h=(l=Qb(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const ok=(function e(t){function r(i){return t===1?new ms(i):new pd(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function jo(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function wn(e,t){this._context=e,this._k=(1-t)/6}wn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gd=(function e(t){function r(i){return new wn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Sn(e,t){this._context=e,this._k=(1-t)/6}Sn.prototype={areaStart:rr,areaEnd:rr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sk=(function e(t){function r(i){return new Sn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function _n(e,t){this._context=e,this._k=(1-t)/6}_n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ak=(function e(t){function r(i){return new _n(i,t)}return r.tension=function(i){return e(+i)},r})(0);function vn(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ch){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ch){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function md(e,t){this._context=e,this._alpha=t}md.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:vn(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const yd=(function e(t){function r(i){return t?new md(i,t):new wn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Cd(e,t){this._context=e,this._alpha=t}Cd.prototype={areaStart:rr,areaEnd:rr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:vn(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nk=(function e(t){function r(i){return t?new Cd(i,t):new Sn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function xd(e,t){this._context=e,this._alpha=t}xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vn(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const lk=(function e(t){function r(i){return t?new xd(i,t):new _n(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function bd(e){this._context=e}bd.prototype={areaStart:rr,areaEnd:rr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hk(e){return new bd(e)}function uh(e){return e<0?-1:1}function fh(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(uh(s)+uh(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function ph(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Xs(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Go(e){this._context=e}Go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xs(this,this._t0,ph(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Xs(this,ph(this,r=fh(this,e,t)),r);break;default:Xs(this,this._t0,r=fh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function kd(e){this._context=new Td(e)}(kd.prototype=Object.create(Go.prototype)).point=function(e,t){Go.prototype.point.call(this,t,e)};function Td(e){this._context=e}Td.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function wd(e){return new Go(e)}function Sd(e){return new kd(e)}function _d(e){this._context=e}_d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=gh(e),o=gh(t),s=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Bd(e){return new ys(e,.5)}function Ld(e){return new ys(e,0)}function Fd(e){return new ys(e,1)}function Ti(e,t,r){this.k=e,this.x=t,this.y=r}Ti.prototype={constructor:Ti,scale:function(e){return e===1?this:new Ti(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ti(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Ti.prototype;var ck=p(e=>{const{securityLevel:t}=yt();let r=ht("body");if(t==="sandbox"){const s=ht(`#i${e}`).node()?.contentDocument??document;r=ht(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Bn(e){return typeof e>"u"||e===null}p(Bn,"isNothing");function Ad(e){return typeof e=="object"&&e!==null}p(Ad,"isObject");function Ed(e){return Array.isArray(e)?e:Bn(e)?[]:[e]}p(Ed,"toArray");function Md(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;rn&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(vo,"getLine");function Bo(e,t){return It.repeat(" ",t-e.length)+e}p(Bo,"padStart");function Id(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=vo(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=It.repeat(" ",t.indent)+Bo((e.line-l+1).toString(),h)+" | "+c.str+` +`+n;for(c=vo(e.buffer,i[a],o[a],e.position,d),n+=It.repeat(" ",t.indent)+Bo((e.line+1).toString(),h)+" | "+c.str+` +`,n+=It.repeat("-",t.indent+h+3+c.pos)+`^ +`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=vo(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=It.repeat(" ",t.indent)+Bo((e.line+l+1).toString(),h)+" | "+c.str+` +`;return n.replace(/\n$/,"")}p(Id,"makeSnippet");var yk=Id,Ck=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],xk=["scalar","sequence","mapping"];function Dd(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(Dd,"compileStyleAliases");function Rd(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Ck.indexOf(r)===-1)throw new te('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Dd(t.styleAliases||null),xk.indexOf(this.kind)===-1)throw new te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(Rd,"Type$1");var Yt=Rd;function _a(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(_a,"compileList");function Pd(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Lk=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Kd(e){return!(e===null||!Lk.test(e)||e[e.length-1]==="_")}p(Kd,"resolveYamlFloat");function Qd(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(Qd,"constructYamlFloat");var Fk=/^[-+]?[0-9]+e/;function Jd(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(It.isNegativeZero(e))return"-0.0";return r=e.toString(10),Fk.test(r)?r.replace("e",".e"):r}p(Jd,"representYamlFloat");function tu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||It.isNegativeZero(e))}p(tu,"isFloat");var Ak=new Yt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Kd,construct:Qd,predicate:tu,represent:Jd,defaultStyle:"lowercase"}),eu=Sk.extend({implicit:[_k,vk,Bk,Ak]}),Ek=eu,ru=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),iu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ou(e){return e===null?!1:ru.exec(e)!==null||iu.exec(e)!==null}p(ou,"resolveYamlTimestamp");function su(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=ru.exec(e),t===null&&(t=iu.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(su,"constructYamlTimestamp");function au(e){return e.toISOString()}p(au,"representYamlTimestamp");var Mk=new Yt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ou,construct:su,instanceOf:Date,represent:au});function nu(e){return e==="<<"||e===null}p(nu,"resolveYamlMerge");var $k=new Yt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nu}),Fn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function lu(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Fn;for(r=0;r64)){if(t<0)return!1;i+=6}return i%8===0}p(lu,"resolveYamlBinary");function hu(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Fn,a=0,n=[];for(t=0;t>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(hu,"constructYamlBinary");function cu(e){var t="",r=0,i,o,s=e.length,a=Fn;for(i=0;i>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(cu,"representYamlBinary");function du(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(du,"isBinary");var Ok=new Yt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:lu,construct:hu,predicate:du,represent:cu}),Ik=Object.prototype.hasOwnProperty,Dk=Object.prototype.toString;function uu(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r>10)+55296,(e-65536&1023)+56320)}p(vu,"charFromCodepoint");function An(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(An,"setProperty");var Bu=new Array(256),Lu=new Array(256);for(hr=0;hr<256;hr++)Bu[hr]=Ba(hr)?1:0,Lu[hr]=Ba(hr);var hr;function Fu(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Cu,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p(Fu,"State$1");function En(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=yk(r),new te(t,r)}p(En,"generateError");function J(e,t){throw En(e,t)}p(J,"throwError");function Pi(e,t){e.onWarning&&e.onWarning.call(null,En(e,t))}p(Pi,"throwWarning");var yh={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&J(t,"duplication of %YAML directive"),i.length!==1&&J(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&J(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&J(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Pi(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&J(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],ku.test(o)||J(t,"ill-formed tag handle (first argument) of the TAG directive"),ir.call(t.tagMap,o)&&J(t,'there is a previously declared suffix for "'+o+'" tag handle'),Tu.test(s)||J(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{J(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function ze(e,t,r,i){var o,s,a,n;if(t1&&(e.result+=It.repeat(` +`,t-1))}p(xs,"writeFoldedLines");function Au(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),Xt(u)||gr(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(o=e.input.charCodeAt(e.position+1),Xt(o)||r&&gr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),Xt(o)||r&&gr(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),Xt(i))break}else{if(e.position===e.lineStart&&Vi(e)||r&&gr(u))break;if(me(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,At(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(ze(e,s,a,!1),xs(e,e.line-l),s=a=e.position,n=!1),er(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return ze(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(Au,"readPlainScalar");function Eu(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(ze(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else me(r)?(ze(e,i,o,!0),xs(e,At(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Vi(e)?J(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);J(e,"unexpected end of the stream within a single quoted scalar")}p(Eu,"readSingleQuotedScalar");function Mu(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return ze(e,r,e.position,!0),e.position++,!0;if(n===92){if(ze(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),me(n))At(e,!1,t);else if(n<256&&Bu[n])e.result+=Lu[n],e.position++;else if((a=Su(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=wu(n))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=vu(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else me(n)?(ze(e,r,i,!0),xs(e,At(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Vi(e)?J(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}J(e,"unexpected end of the stream within a double quoted scalar")}p(Mu,"readDoubleQuotedScalar");function $u(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=Object.create(null),m,y,C,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,u=!1,n=[];else if(b===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),b=e.input.charCodeAt(++e.position);b!==0;){if(At(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?b===44&&J(e,"expected the node content, but found ','"):J(e,"missed comma between flow collection entries"),y=m=C=null,d=f=!1,b===63&&(c=e.input.charCodeAt(e.position+1),Xt(c)&&(d=f=!0,e.position++,At(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,kr(e,t,Vo,!1,!0),y=e.tag,m=e.result,At(e,!0,t),b=e.input.charCodeAt(e.position),(f||e.line===i)&&b===58&&(d=!0,b=e.input.charCodeAt(++e.position),At(e,!0,t),kr(e,t,Vo,!1,!0),C=e.result),u?mr(e,n,g,y,m,C,i,o,s):d?n.push(mr(e,null,g,y,m,C,i,o,s)):n.push(m),At(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}J(e,"unexpected end of the stream within a flow collection")}p($u,"readFlowCollection");function Ou(e,t){var r,i,o=Vs,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Vs===o?o=d===43?mh:zk:J(e,"repeat of a chomping mode identifier");else if((h=_u(d))>=0)h===0?J(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?J(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(er(d)){do d=e.input.charCodeAt(++e.position);while(er(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!me(d)&&d!==0)}for(;d!==0;){for(Cs(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndentn&&(n=e.lineIndent),me(d)){l++;continue}if(e.lineIndentt)&&l!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(a=e.line,n=e.lineStart,l=e.position),kr(e,t,Zo,!0,o)&&(y?g=e.result:m=e.result),y||(mr(e,d,f,u,g,m,a,n,l),u=g=m=null),At(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)J(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d"),e.result!==null&&g.kind!==e.kind&&J(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):J(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(kr,"composeNode");function Nu(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(At(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Xt(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&J(e,"directive name must not be less than one character in length");a!==0;){for(;er(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!me(a));break}if(me(a))break;for(r=e.position;a!==0&&!Xt(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Cs(e),ir.call(yh,i)?yh[i](e,i,o):Pi(e,'unknown document directive "'+i+'"')}if(At(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,At(e,!0,-1)):s&&J(e,"directives end mark is expected"),kr(e,e.lineIndent-1,Zo,!1,!0),At(e,!0,-1),e.checkLineBreaks&&Yk.test(e.input.slice(t,e.position))&&Pi(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vi(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,At(e,!0,-1));return}if(e.position"u"&&(r=t,t=null);var i=Mn(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o=55296&&r<=56319&&t+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(zr,"codePointAt");function On(e){var t=/^\n* /;return t.test(e)}p(On,"needIndentIndicator");var tf=1,Oa=2,ef=3,rf=4,Nr=5;function of(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=Qu(zr(e,0))&&Ju(zr(e,e.length-1));if(t||a)for(l=0;l=65536?l+=2:l++){if(c=zr(e,l),!Qr(c))return Nr;m=m&&$a(c,h,n),h=c}else{for(l=0;l=65536?l+=2:l++){if(c=zr(e,l),c===Ni)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Qr(c))return Nr;m=m&&$a(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?tf:s===qi?Nr:Oa:r>9&&On(e)?Nr:a?s===qi?Nr:Oa:f?rf:ef}p(of,"chooseScalarStyle");function sf(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===qi?'""':"''";if(!e.noCompatMode&&(d1.indexOf(t)!==-1||u1.test(t)))return e.quotingType===qi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Ku(e,c)}switch(p(l,"testAmbiguity"),of(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case tf:return t;case Oa:return"'"+t.replace(/'/g,"''")+"'";case ef:return"|"+Ia(t,e.indent)+Da(Ea(t,s));case rf:return">"+Ia(t,e.indent)+Da(Ea(af(t,a),s));case Nr:return'"'+nf(t)+'"';default:throw new te("impossible error: invalid scalar style")}})()}p(sf,"writeScalar");function Ia(e,t){var r=On(e)?String(t):"",i=e[e.length-1]===` +`,o=i&&(e[e.length-2]===` +`||e===` +`),s=o?"+":i?"":"-";return r+s+` +`}p(Ia,"blockHeader");function Da(e){return e[e.length-1]===` +`?e.slice(0,-1):e}p(Da,"dropEndingNewline");function af(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(` +`);return c=c!==-1?c:e.length,r.lastIndex=c,Ra(e.slice(0,c),t)})(),o=e[0]===` +`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?` +`:"")+Ra(l,t),o=s}return i}p(af,"foldString");function Ra(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=` +`+e.slice(o,s),o=s+1),a=n;return l+=` +`,e.length-o>t&&a>o?l+=e.slice(o,a)+` +`+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(Ra,"foldLine");function nf(e){for(var t="",r=0,i,o=0;o=65536?o+=2:o++)r=zr(e,o),i=Ut[r],!i&&Qr(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Vu(r);return t}p(nf,"escapeString");function lf(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s"u"&&Ee(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(lf,"writeFlowSequence");function Pa(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a"u"&&Ee(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Qo(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(Pa,"writeBlockSequence");function hf(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ee(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(hf,"writeFlowMapping");function cf(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new te("sortKeys must be a boolean or a function");for(n=0,l=a.length;n1024,d&&(e.dump&&Ni===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Qo(e,t)),Ee(e,t+1,h,!0,d)&&(e.dump&&Ni===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(cf,"writeBlockMapping");function Na(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(Na,"detectType");function Ee(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Na(e,r,!1)||Na(e,r,!0);var n=Wu.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(cf(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(hf(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Pa(e,t-1,e.dump,o):Pa(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(lf(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&sf(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new te("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(Ee,"writeNode");function df(e,t){var r=[],i=[],o,s;for(Jo(e,r,i),o=0,s=i.length;o{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Ht={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Ch={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function wi(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=_t(e),t=_t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(wi,"calculateDeltaAndAngle");var _t=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),C1=p(e=>({x:p(function(t,r,i){let o=0;const s=_t(i[0]).x<_t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Ht,e.arrowTypeStart)){const{angle:u,deltaX:g}=wi(i[0],i[1]);o=Ht[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ht,e.arrowTypeEnd)){const{angle:u,deltaX:g}=wi(i[i.length-1],i[i.length-2]);o=Ht[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(_t(t).x-_t(i[i.length-1]).x),n=Math.abs(_t(t).y-_t(i[i.length-1]).y),l=Math.abs(_t(t).x-_t(i[0]).x),c=Math.abs(_t(t).y-_t(i[0]).y),h=Ht[e.arrowTypeStart],d=Ht[e.arrowTypeEnd],f=1;if(a0&&n0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ht,e.arrowTypeEnd)){const{angle:u,deltaY:g}=wi(i[i.length-1],i[i.length-2]);o=Ht[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(_t(t).y-_t(i[i.length-1]).y),n=Math.abs(_t(t).x-_t(i[i.length-1]).x),l=Math.abs(_t(t).y-_t(i[0]).y),c=Math.abs(_t(t).x-_t(i[0]).x),h=Ht[e.arrowTypeStart],d=Ht[e.arrowTypeEnd],f=1;if(a0&&n0&&c-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return uo}var k1=b1();function Zs(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function T1(){}function uf(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function In(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const w1="[object RegExp]",ff="[object String]",pf="[object Number]",gf="[object Boolean]",mf="[object Arguments]",S1="[object Symbol]",_1="[object Date]",v1="[object Map]",B1="[object Set]",L1="[object Array]",F1="[object ArrayBuffer]",A1="[object Object]",E1="[object DataView]",M1="[object Uint8Array]",$1="[object Uint8ClampedArray]",O1="[object Uint16Array]",I1="[object Uint32Array]",D1="[object Int8Array]",R1="[object Int16Array]",P1="[object Int32Array]",N1="[object Float32Array]",q1="[object Float64Array]",kh=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Dn(e){return typeof kh.Buffer<"u"&&kh.Buffer.isBuffer(e)}function W1(e){return Number.isSafeInteger(e)&&e>=0}function yf(e){return e!=null&&typeof e!="function"&&W1(e.length)}function z1(e){return e==="__proto__"}function Rn(e){return e==null||typeof e!="object"&&typeof e!="function"}function Pn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function H1(e,t){return Hr(e,void 0,e,new Map,t)}function Hr(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(Rn(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n{if(typeof e=="object"){if(In(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),de(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case pf:case ff:case gf:{const a=new e.constructor(e?.valueOf());return de(a,e),a}case mf:{const a={};return de(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Th(e){return U1(e)}function qa(e){return e!==null&&typeof e=="object"&&In(e)==="[object Arguments]"}function Wa(e){return typeof e=="object"&&e!==null}function j1(e){return Wa(e)&&yf(e)}function Zi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Zi.Cache||Map),r}Zi.Cache=Map;function Lo(e){return Pn(e)}function G1(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function X1(e){if(Rn(e))return e;if(Array.isArray(e)||Pn(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function V1(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;sr!=="constructor").length===0:t.length===0}return!0}var K1="​",Q1={curveBasis:Sa,curveBasisClosed:rk,curveBasisOpen:ik,curveBumpX:cd,curveBumpY:dd,curveBundle:ok,curveCardinalClosed:sk,curveCardinalOpen:ak,curveCardinal:gd,curveCatmullRomClosed:nk,curveCatmullRomOpen:lk,curveCatmullRom:yd,curveLinear:Ai,curveLinearClosed:hk,curveMonotoneX:wd,curveMonotoneY:Sd,curveNatural:vd,curveStep:Bd,curveStepAfter:Fd,curveStepBefore:Ld},J1=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,t2=p(function(e,t){const r=Cf(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Oo(a),i=Ot(i,[...a])}else i=r.args;if(!i)return;let o=hn(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),Cf=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${J1.source})(?=[}][%]{2}).* +`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),N.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=Li.exec(e))!==null;)if(i.index===Li.lastIndex&&Li.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return N.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),e2=p(function(e){return e.replace(Li,"")},"removeDirectives"),r2=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Nn(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return Q1[r]??t}p(Nn,"interpolateToCurve");function xf(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?k1.sanitizeUrl(r):r}p(xf,"formatUrl");var i2=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a{r+=qn(o,t),t=o});const i=r/2;return Wn(e,i)}p(bf,"traverseEdge");function kf(e){return e.length===1?e[0]:bf(e)}p(kf,"calcLabelPosition");var Sh=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Wn=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=qn(o,r);if(s===0)return r;if(s=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Sh((1-a)*r.x+a*o.x,5),y:Sh((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),o2=p((e,t,r)=>{N.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Wn(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Tf(e,t,r){const i=structuredClone(r);N.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=Wn(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(Tf,"calcTerminalLabelPosition");function wf(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(wf,"getStylesFromArray");var _h=0,s2=p(()=>(_h++,"id-"+Math.random().toString(36).substr(2,12)+"-"+_h),"generateId");function Sf(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;oSf(e.length),"random"),n2=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),l2=p(function(e,t){const r=t.text.replace(ji.lineBreakRegex," "),[,i]=bs(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),h2=Zi((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
      "},r),ji.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=Ye(`${a} `,r),c=Ye(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=c2(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),c2=Zi((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(Ye(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function _f(e,t){return zn(e,t).height}p(_f,"calculateTextHeight");function Ye(e,t){return zn(e,t).width}p(Ye,"calculateTextWidth");var zn=Zi((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=bs(r),a=["sans-serif",i],n=e.split(ji.lineBreakRegex),l=[],c=ht("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=n2();y.text=m||K1;const C=l2(h,y).style("font-size",s).style("font-weight",o).style("font-family",f),b=(C._groups||C)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),u=Math.round(b.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),d2=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{p(this,"InitIDGenerator")}},fo,u2=p(function(e){return fo=fo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),fo.innerHTML=e,unescape(fo.textContent)},"entityDecode");function Hn(e){return"str"in e}p(Hn,"isDetailedError");var f2=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),bs=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Yn(e,t){return Z1({},e,t)}p(Yn,"cleanAndMerge");var ge={assignWithDepth:Ot,wrapLabel:h2,calculateTextHeight:_f,calculateTextWidth:Ye,calculateTextDimensions:zn,cleanAndMerge:Yn,detectInit:t2,detectDirective:Cf,isSubstringInArray:r2,interpolateToCurve:Nn,calcLabelPosition:kf,calcCardinalityPosition:o2,calcTerminalLabelPosition:Tf,formatUrl:xf,getStylesFromArray:wf,generateId:s2,random:a2,runFunc:i2,entityDecode:u2,insertTitle:f2,isLabelCoordinateInPath:vf,parseFontSize:bs,InitIDGenerator:d2},p2=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Tr=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),OB=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Rt(e){return e??null}p(Rt,"handleUndefinedAttr");function vf(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(vf,"isLabelCoordinateInPath");var Un=p(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function Bf(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=yt().fontSize?yt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Tc.fontSize]=bs(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(Bf,"configureLabelImages");var g2=p(e=>{const{handDrawnSeed:t}=yt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),ei=p(e=>{const t=m2([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),m2=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Lf=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Z=p(e=>{const{stylesArray:t}=ei(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Lf(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),V=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=yt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=ei(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:y2(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),y2=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const C2=Object.freeze({left:0,top:0,width:16,height:16}),ts=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ff=Object.freeze({...C2,...ts}),x2=Object.freeze({...Ff,body:"",hidden:!1}),b2=Object.freeze({width:null,height:null}),k2=Object.freeze({...b2,...ts}),T2=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Ks(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Ks(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Ks(n,r)?n:null}return null},Ks=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function w2(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function vh(e,t){const r=w2(e,t);for(const i in x2)i in ts?i in e&&!(i in r)&&(r[i]=ts[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function S2(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function Bh(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=vh(i[n]||o[n],s)}return a(t),r.forEach(a),vh(e,s)}function _2(e,t){if(e.icons[t])return Bh(e,t,[]);const r=S2(e,[t])[t];return r?Bh(e,t,r):null}const v2=/(-?[0-9.]*[0-9]+[0-9.]*)/g,B2=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Lh(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(v2);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=B2.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function L2(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function F2(e,t){return e?""+e+""+t:t}function A2(e,t,r){const i=L2(e);return F2(i.defs,t+i.content+r)}const E2=e=>e==="unset"||e==="undefined"||e==="none";function M2(e,t){const r={...Ff,...e},i={...k2,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],C=m.hFlip,b=m.vFlip;let k=m.rotate;C?b?k+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):b&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let w;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:w=o.height/2+o.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}k%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),y.length&&(s=A2(s,'',""))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Lh(d,l/c)):(h=a==="auto"?l:a,d=n===null?Lh(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{E2(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const $2=/\sid="(\S+)"/g,Fh=new Map;function O2(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Fh.get(e)||0;return Fh.set(e,t+1),t?`${e}${t}`:e}function I2(e){const t=[];let r;for(;r=$2.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=O2(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function D2(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}function jn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _r=jn();function Af(e){_r=e}var Ei={exec:()=>null};function Ct(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Vt.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var R2=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
      /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},P2=/^(?:[ \t]*(?:\n|$))+/,N2=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,q2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ki=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gn=/(?:[*+-]|\d{1,9}[.)])/,Ef=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mf=Ct(Ef).replace(/bull/g,Gn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),z2=Ct(Ef).replace(/bull/g,Gn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Xn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,H2=/^[^\n]+/,Vn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Y2=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),U2=Ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gn).getRegex(),ks="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zn=/|$))/,j2=Ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zn).replace("tag",ks).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$f=Ct(Xn).replace("hr",Ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex(),G2=Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$f).getRegex(),Kn={blockquote:G2,code:N2,def:Y2,fences:q2,heading:W2,hr:Ki,html:j2,lheading:Mf,list:U2,newline:P2,paragraph:$f,table:Ei,text:H2},Ah=Ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex(),X2={...Kn,lheading:z2,table:Ah,paragraph:Ct(Xn).replace("hr",Ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ah).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex()},V2={...Kn,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ei,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Xn).replace("hr",Ki).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Mf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Z2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,K2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Of=/^( {2,}|\\)\n(?!\s*$)/,Q2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",R2?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Rf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iT=Ct(Rf,"u").replace(/punct/g,Ts).getRegex(),oT=Ct(Rf,"u").replace(/punct/g,Df).getRegex(),Pf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sT=Ct(Pf,"gu").replace(/notPunctSpace/g,If).replace(/punctSpace/g,Qn).replace(/punct/g,Ts).getRegex(),aT=Ct(Pf,"gu").replace(/notPunctSpace/g,eT).replace(/punctSpace/g,tT).replace(/punct/g,Df).getRegex(),nT=Ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,If).replace(/punctSpace/g,Qn).replace(/punct/g,Ts).getRegex(),lT=Ct(/\\(punct)/,"gu").replace(/punct/g,Ts).getRegex(),hT=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cT=Ct(Zn).replace("(?:-->|$)","-->").getRegex(),dT=Ct("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",cT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),es=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,uT=Ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",es).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nf=Ct(/^!?\[(label)\]\[(ref)\]/).replace("label",es).replace("ref",Vn).getRegex(),qf=Ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vn).getRegex(),fT=Ct("reflink|nolink(?!\\()","g").replace("reflink",Nf).replace("nolink",qf).getRegex(),Eh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Jn={_backpedal:Ei,anyPunctuation:lT,autolink:hT,blockSkip:rT,br:Of,code:K2,del:Ei,emStrongLDelim:iT,emStrongRDelimAst:sT,emStrongRDelimUnd:nT,escape:Z2,link:uT,nolink:qf,punctuation:J2,reflink:Nf,reflinkSearch:fT,tag:dT,text:Q2,url:Ei},pT={...Jn,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",es).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",es).getRegex()},za={...Jn,emStrongRDelimAst:aT,emStrongLDelim:oT,url:Ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Eh).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Mh=e=>mT[e];function ve(e,t){if(t){if(Vt.escapeTest.test(e))return e.replace(Vt.escapeReplace,Mh)}else if(Vt.escapeTestNoEncode.test(e))return e.replace(Vt.escapeReplaceNoEncode,Mh);return e}function $h(e){try{e=encodeURI(e).replace(Vt.percentDecode,"%")}catch{return null}return e}function Oh(e,t){let r=e.replace(Vt.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(Vt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Ih(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function CT(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(` +`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(` +`)}var rs=class{options;rules;lexer;constructor(t){this.options=t||_r}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:pi(i,` +`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=CT(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=pi(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:pi(r[0],` +`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=pi(r[0],` +`).split(` +`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),u=t.split(` +`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+` +`,t=t.substring(u.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let E=t.split(` +`,1)[0],B;if(u=E,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),B=u):B=u.replace(this.rules.other.tabCharGlobal," "),w.test(u)||S.test(u)||_.test(u)||b.test(u)||k.test(u))break;if(B.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=` +`+B.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||S.test(f)||k.test(f))break;d+=` +`+u}!g&&!u.trim()&&(g=!0),h+=E+` +`,t=t.substring(E.length+1),f=B.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,C;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(C=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:C,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;cf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=pi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=yT(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),Ih(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Ih(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},ue=class Ha{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||_r,this.options.tokenizer=this.options.tokenizer||new rs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Vt,block:po.normal,inline:fi.normal};this.options.pedantic?(r.block=po.pedantic,r.inline=fi.pedantic):this.options.gfm&&(r.block=po.gfm,this.options.breaks?r.inline=fi.breaks:r.inline=fi.gfm),this.tokenizer.rules=r}static get rules(){return{block:po,inline:fi}}static lex(t,r){return new Ha(r).lex(t)}static lexInline(t,r){return new Ha(r).inlineTokens(t)}lex(t){t=t.replace(Vt.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let r=0;r(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=` +`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},is=class{options;parser;constructor(t){this.options=t||_r}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(Vt.notSpaceStart)?.[0],s=t.replace(Vt.endingNewline,"")+` +`;return o?'
      '+(i?s:ve(s,!0))+`
      +`:"
      "+(i?s:ve(s,!0))+`
      +`}blockquote({tokens:t}){return`
      +${this.parser.parse(t)}
      +`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} +`}hr(t){return`
      +`}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n +`+o+" +`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+ve(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
    1. ${r}
    2. +`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

      ${this.parser.parseInline(t)}

      +`}table(t){let r="",i="";for(let s=0;s${o}`),` + +`+r+` +`+o+`
      +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ve(t,!0)}`}br(t){return"
      "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=$h(t);if(s===null)return o;t=s;let a='
      ",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=$h(t);if(s===null)return ve(i);t=s;let a=`${i}{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new is(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new rs(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Si;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];Si.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&Si.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ue.lex(t,r??this.defaults)}parser(t,r){return fe.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?ue.lex:ue.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?fe.parse:fe.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?ue.lex:ue.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?fe.parse:fe.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let o="

      An error occurred:

      "+ve(i.message+"",!0)+"
      ";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},wr=new xT;function bt(e,t){return wr.parse(e,t)}bt.options=bt.setOptions=function(e){return wr.setOptions(e),bt.defaults=wr.defaults,Af(bt.defaults),bt};bt.getDefaults=jn;bt.defaults=_r;bt.use=function(...e){return wr.use(...e),bt.defaults=wr.defaults,Af(bt.defaults),bt};bt.walkTokens=function(e,t){return wr.walkTokens(e,t)};bt.parseInline=wr.parseInline;bt.Parser=fe;bt.parser=fe.parse;bt.Renderer=is;bt.TextRenderer=tl;bt.Lexer=ue;bt.lexer=ue.lex;bt.Tokenizer=rs;bt.Hooks=Si;bt.parse=bt;bt.options;bt.setOptions;bt.use;bt.walkTokens;bt.parseInline;fe.parse;ue.lex;function Wf(e){for(var t=[],r=1;r?',height:80,width:80},Ua=new Map,zf=new Map,kT=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(N.debug("Registering icon pack:",t.name),"loader"in t)zf.set(t.name,t.loader);else if("icons"in t)Ua.set(t.name,t.icons);else throw N.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Hf=p(async(e,t)=>{const r=T2(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Ua.get(i);if(!o){const a=zf.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Ua.set(i,o)}catch(n){throw N.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=_2(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),TT=p(async e=>{try{return await Hf(e),!0}catch{return!1}},"isIconAvailable"),Qi=p(async(e,t,r)=>{let i;try{i=await Hf(e,t?.fallbackPrefix)}catch(a){N.error(a),i=bT}const o=M2(i,t),s=D2(I2(o.body),{...o.attributes,...r});return Ce(s,vt())},"getIconSVG");function Yf(e,{markdownAutoWrap:t}){const i=e.replace(//g,` +`).replace(/\n{2,}/g,` +`);return Wf(i)}p(Yf,"preprocessMarkdown");function Uf(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Uf,"nonMarkdownToLines");function jf(e,t={}){const r=Yf(e,t),i=bt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(` +`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(jf,"markdownToLines");function Gf(e){return e?`

      ${e.replace(/\\n|\n/g,"
      ")}

      `:""}p(Gf,"nonMarkdownToHTML");function Xf(e,{markdownAutoWrap:t}={}){const r=bt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"
      ").replace(/ /g," "):o.text.replace(/\n */g,"
      "):o.type==="strong"?`${o.tokens?.map(i).join("")}`:o.type==="em"?`${o.tokens?.map(i).join("")}`:o.type==="paragraph"?`

      ${o.tokens?.map(i).join("")}

      `:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(N.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(Xf,"markdownToHTML");function Vf(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Vf,"splitTextToChars");function Zf(e,t){const r=Vf(t.content);return el(e,[],r,t.type)}p(Zf,"splitWordToFitWidth");function el(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?el(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(el,"splitWordToFitWidthRecursion");function Kf(e,t){if(e.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return os(e,t)}p(Kf,"splitLineToFitWidth");function os(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return os(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Zf(t,s);r.push([n]),l.content&&e.unshift(l)}return os(e,t,r)}p(os,"splitLineToFitWidthRecursion");function ja(e,t){t&&e.attr("style",t)}p(ja,"applyStyle");var Dh=16384;async function Qf(e,t,r,i,o=!1,s=vt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Dh)}px`),a.attr("height",`${Math.min(10*r,Dh)}px`);const n=a.append("xhtml:div"),l=$i(t.label)?await Mc(t.label.replace(ji.lineBreakRegex,` +`),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),ja(h,t.labelStyle),h.attr("class",`${c} ${i}`),ja(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(Qf,"addHtmlSpan");function ws(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(ws,"createTspan");function Jf(e,t,r){const i=e.append("text"),o=ws(i,1,t);Ss(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Jf,"computeWidthOfText");function wT(e,t,r){const i=e.append("text"),o=ws(i,1,t);Ss(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(wT,"computeDimensionOfText");function tp(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Jf(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Kf(h,d);for(const u of f){const g=ws(l,c,1.1,o);Ss(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}p(tp,"createFormattedText");function Ga(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(Ga,"decodeHTMLEntities");function Ss(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(Ga(r.content)):o.text(" "+Ga(r.content))})}p(Ss,"updateTextContentAndStyles");async function ep(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await TT(n)?await Qi(n,void 0,{class:"label-icon"}):``})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(ep,"replaceIconSubstring");var Ge=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(N.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Xf(t,h):Gf(t),f=await ep(Tr(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:$i(t)?u:f,labelStyle:r.replace("fill:","color:")};return await Qf(e,g,l,o,c,h)}else{const d=Tr(t.replace(//g,"
      ")),f=a?jf(d.replace("
      ","
      "),h):Uf(d),u=tp(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ht(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(u).select("text").attr("style",m)}return i?ht(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ht(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function Qs(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function ST(e,t){return e[0]===t[0]&&e[1]===t[1]}function _T(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Qs(c,n,o);const l=(function(c,h,d){const f=[];for(const b of c){const k=[...b];ST(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return u;let m=[],y=g[0].ymin,C=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(d!==1||C%h==0)&&m.length>1)for(let b=0;b=m.length)break;const w=m[b].edge,S=m[k].edge;u.push([[Math.round(w.x),y],[Math.round(S.x),y]])}y+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),C++}return u})(a,s,i);if(o){for(const c of a)Qs(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),Qs(f,h,d)})(l,n,-o)}return l}function Ji(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),_T(e,o,i,s||1)}class rl{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ji(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function _s(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class vT extends rl{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Ji(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)_s([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class BT extends rl{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class LT{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ji(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=_s(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g{const n=_s(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u{const a=_s(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;dh%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function ip(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,C=d+2*(u-d)/3,b=f+2*(g-f)/3;t.push({key:"C",data:[m,y,C,b,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,C=u+2*(d-u)/3,b=g+2*(f-g)/3;t.push({key:"C",data:[m,y,C,b,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],C=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,C,y,C]}),i=y,o=C):(i!==y||o!==C)&&(op(i,o,y,C,d,f,u,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function gi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function op(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=gi(e,t,-h),[r,i]=gi(r,i,-h);const W=(e-r)/2,F=(t-i)/2;let A=W*W/(o*o)+F*F/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const L=o*o,M=s*s,D=L*M-L*F*F-M*W*W,z=L*F*F+M*W*W,Y=(n===l?-1:1)*Math.sqrt(Math.abs(D/z));m=Y*o*F/s+(e+r)/2,y=Y*-s*W/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),eg&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let C=g-u;if(Math.abs(C)>120*Math.PI/180){const W=g,F=r,A=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=op(r=m+o*Math.cos(g),i=y+s*Math.sin(g),F,A,o,s,a,0,l,[g,W,m,y])}C=g-u;const b=Math.cos(u),k=Math.sin(u),w=Math.cos(g),S=Math.sin(g),_=Math.tan(C/4),E=4/3*o*_,B=4/3*s*_,q=[e,t],I=[e+E*k,t-B*b],R=[r+E*S,i-B*w],H=[r,i];if(I[0]=2*q[0]-I[0],I[1]=2*q[1]-I[1],c)return[I,R,H].concat(f);{f=[I,R,H].concat(f);const W=[];for(let F=0;F2){const o=[];for(let s=0;s2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),C=Hh(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const b=Hh(y,c,h,d,f,u,g,1.5,l);C.push(...b)}return a&&(n?C.push(...or(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...or(c,h,c+d*Math.cos(g),h+f*Math.sin(g),l)):C.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:C}}function qh(e,t){const r=ip(rp(il(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...or(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...IT(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...or(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function ea(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+it(o,t),i[0][1]+it(o,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*np(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=it(u,o,c),g=it(g,o,c);const m=[],y=()=>it(d,o,c),C=()=>it(h,o,c),b=o.preserveVertices;return a?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:it(h,o,c)),t+(b?0:it(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+C(),g+t+(i-t)*f+C(),u+e+2*(r-e)*f+C(),g+t+2*(i-t)*f+C(),r+(b?0:C()),i+(b?0:C())]}),m}function mo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+it(t,r),e[0][1]+it(t,r)]),i.push([e[0][0]+it(t,r),e[0][1]+it(t,r)]);for(let o=1;o3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=ur(l,c,.5),u=ur(c,h,.5),g=ur(h,d,.5),m=ur(f,u,.5),y=ur(u,g,.5),C=ur(m,y,.5);Za([l,f,m,C],0,r,o),Za([C,y,g,d],0,r,o)}var s,a;return o}function RT(e,t){return ns(e,0,e.length,t)}function ns(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=d,c=h)}return Math.sqrt(l)>i?(ns(e,t,c+1,i,s),ns(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function ra(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s0?ns(i,0,i.length,r):i}const re="none";class ls{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[sp(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=OT(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(ea([c],a)):n.push(Dr([c],a))}return a.stroke!==re&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=ap(i,o,a),c=Xa(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Xa(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Dr([c.estimatedPoints],a));return a.stroke!==re&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Ao(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=Nh(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=Nh(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,C,b){const k=f,w=u;let S=Math.abs(g/2),_=Math.abs(m/2);S+=it(.01*S,b),_+=it(.01*_,b);let E=y,B=C;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const q=(B-E)/b.curveStepCount,I=[];for(let R=E;R<=B;R+=q)I.push([k+S*Math.cos(R),w+_*Math.sin(R)]);return I.push([k+S*Math.cos(B),w+_*Math.sin(B)]),I.push([k,w]),Dr([I],b)})(t,r,i,o,s,a,c));return c.stroke!==re&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Ph(t,i);if(i.fill&&i.fill!==re)if(i.fillStyle==="solid"){const a=Ph(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...ra(Yh([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...ra(Yh(c),10,(1+i.roughness)/2))}a.length&&o.push(Dr([a],i))}return i.stroke!==re&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Ao(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(ea([t],i)):o.push(Dr([t],i))),i.stroke!==re&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==re,a=i.stroke!==re,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=ip(rp(il(h))),g=[];let m=[],y=[0,0],C=[];const b=()=>{C.length>=4&&m.push(...ra(C,d)),C=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:S,data:_}of u)switch(S){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":b(),m.push([_[0],_[1]]);break;case"C":if(!C.length){const E=m.length?m[m.length-1]:y;C.push([E[0],E[1]])}C.push([_[0],_[1]]),C.push([_[2],_[3]]),C.push([_[4],_[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!f)return g;const w=[];for(const S of g){const _=RT(S,f);_.length&&w.push(_)}return w})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=qh(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=qh(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(ea(l,i));else o.push(Dr(l,i));return a&&(n?l.forEach((h=>{o.push(Ao(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:re};break;case"fillPath":a={d:this.opsToPath(s),stroke:re,strokeWidth:0,fill:i.fill||re};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||re,strokeWidth:i,fill:re}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class PT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ls(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const yo="http://www.w3.org/2000/svg";class NT{constructor(t,r){this.svg=t,this.gen=new ls(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(yo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(yo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(yo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(yo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var X={canvas:(e,t)=>new PT(e,t),svg:(e,t)=>new NT(e,t),generator:e=>new ls(e),newSeed:()=>ls.newSeed()},rt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||je(yt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Rt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Ge(a,Ce(Tr(n),yt()),{useHtmlLabels:o,width:t.width||yt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},yt());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=ht(h);await Bf(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),ia=p(async(e,t,r)=>{const i=r.useHtmlLabels??Kt(yt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Ge(o,Ce(Tr(t),yt()),{useHtmlLabels:i,width:r.width||yt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(Kt(yt())){const l=s.children[0],c=ht(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),K=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),et=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function ft(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(ft,"createPathFromPoints");function sr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(sr,"generateFullSineWavePoints");function zi(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(Ka,"mergePaths");var qT=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),ri=qT,WT=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=yt(),n=Kt(a);return await Ge(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Qe=WT,ar=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),lp=p(async(e,t)=>{N.info("Creating subgraph rect for ",t.id,t);const r=yt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Z(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=Kt(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Ge(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await Qe(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(Kt(r)){const E=g.children[0],B=ht(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;N.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const E=X.svg(d),B=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),q=E.path(ar(b,k,y,C,0),B);w=d.insert(()=>(N.debug("Rough node insert CXC",q),q),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=Un(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=w.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return ri(t,E)},{cluster:d,labelBBox:m}},"rect"),zT=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return ri(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),HT=p(async(e,t)=>{const r=yt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await Qe(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(Kt(r)){const q=u.children[0],I=ht(u);g=q.getBoundingClientRect(),I.attr("width",g.width),I.attr("height",g.height)}const m=0*t.padding,y=m/2,C=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,k=t.height+m-g.height-6,w=t.x-C/2,S=t.y-b/2;t.width=C;const _=t.y-t.height/2-y+g.height+2;let E;if(t.look==="handDrawn"){const q=t.cssClasses.includes("statediagram-cluster-alt"),I=X.svg(c),R=t.rx||t.ry?I.path(ar(w,S,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):I.rectangle(w,S,C,b,{seed:o});E=c.insert(()=>R,":first-child");const H=I.rectangle(w,_,C,k,{fill:q?s:a,fillStyle:q?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>R,":first-child"),f=c.insert(()=>H)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",w).attr("y",S).attr("width",C).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",w).attr("y",_).attr("width",C).attr("height",k);d.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(Kt(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(q){return ri(t,q)},{cluster:c,labelBBox:g}},"roundedWithTitle"),YT=p(async(e,t)=>{N.info("Creating subgraph rect for ",t.id,t);const r=yt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Z(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=Kt(r),u=d.insert("g").attr("class","cluster-label "),g=await Ge(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(Kt(r)){const E=g.children[0],B=ht(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;N.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const E=X.svg(d),B=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),q=E.path(ar(b,k,y,C,t.rx),B);w=d.insert(()=>(N.debug("Rough node insert CXC",q),q),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=Un(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=w.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return ri(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),UT=p((e,t)=>{const r=yt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=X.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return ri(t,m)},{cluster:a,labelBBox:{}}},"divider"),jT=lp,GT={rect:lp,squareRect:jT,roundedWithTitle:HT,noteGroup:zT,divider:UT,kanbanSection:YT},hp=new Map,XT=p(async(e,t)=>{const r=t.shape||"rect",i=await GT[r](e,t);return hp.set(t.id,i),i},"insertCluster"),qB=p(()=>{hp=new Map},"clear");function cp(e,t){return e.intersect(t)}p(cp,"intersectNode");var VT=cp;function dp(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x0}p(Qa,"sameSign");var KT=pp;function gp(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,C=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Rt(n)),K(t,d),t.intersect=function(f){return N.info("Circle intersect",t,a,f),j.circle(t,a,f)},s}p(mp,"anchor");function Ja(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),C=l+y*s*Math.sin(h)*(a?-1:1),b=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-b)/s,(e-C)/o);let S=Math.atan2((i-b)/s,(r-C)/o)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,q=k+B*S,I=C+o*Math.cos(q),R=b+s*Math.sin(q);_.push({x:I,y:R})}return _}p(Ja,"generateArcPoints");function yp(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(yp,"calculateArcSagitta");async function Cp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(q=>q+a,"calcTotalHeight"),l=p(q=>{const I=q/2;return[I/(2.5+q/50),I]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await rt(e,t,et(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=yp(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,C=d,{cssStyles:b}=t,k=[{x:y/2,y:-C/2},{x:-y/2,y:-C/2},...Ja(-y/2,-C/2,-y/2,C/2,f,u,!1),{x:y/2,y:C/2},...Ja(y/2,C/2,y/2,-C/2,f,u,!0)],w=X.svg(c),S=V(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=ft(k),E=w.path(_,S),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${f/2}, 0)`),K(t,B),t.intersect=function(q){return j.polygon(t,k,q)},c}p(Cp,"bowTieRect");function Xe(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Xe,"insertPolygonShape");var Co=12;async function xp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+Co),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+Co,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+Co},{x:d+Co,y:u}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=X.svg(n),k=V(t,{}),w=ft(m),S=b.path(w,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),C&&y.attr("style",C)}else y=Xe(n,c,h,m);return i&&y.attr("style",i),K(t,y),t.intersect=function(b){return j.polygon(t,m,b)},n}p(xp,"card");function bp(e,t){const{nodeStyles:r}=Z(t);t.label="";const i=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=X.svg(i),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=ft(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return j.polygon(t,a,f)},i}p(bp,"choice");async function ol(e,t,r){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await rt(e,t,et(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=X.svg(s),g=V(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Rt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return K(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return j.circle(u,m,g)},t.intersect=function(u){return N.info("Circle intersect",t,h,u),j.circle(t,h,u)},s}p(ol,"circle");function kp(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y} + M ${o.x},${o.y} L ${a.x},${a.y}`}p(kp,"createLine");function Tp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=X.svg(o),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=kp(s),d=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),K(t,f),t.intersect=function(u){return N.info("crossedCircle intersect",t,{radius:s,point:u}),j.circle(t,s,u)},o}p(Tp,"crossedCircle");function Ne(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,_),t.intersect=function(E){return j.polygon(t,g,E)},o}p(wp,"curlyBraceLeft");function qe(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,_),t.intersect=function(E){return j.polygon(t,g,E)},o}p(Sp,"curlyBraceRight");function Nt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dq,":first-child").attr("stroke-opacity",0),I.insert(()=>w,":first-child"),I.insert(()=>E,":first-child"),I.attr("class","text"),f&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,I),t.intersect=function(R){return j.polygon(t,m,R)},o}p(_p,"curlyBraces");async function vp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await rt(e,t,et(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=X.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=d,b=f,k=C-u,w=b/4,S=[{x:k,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:k,y:b},...zi(-k,-b/2,u,50,270,90)],_=ft(S),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-f/2})`),K(t,B),t.intersect=function(q){return j.polygon(t,S,q)},c}p(vp,"curvedTrapezoid");var JT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),tw=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),ew=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Uh=8,jh=8;async function Bp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.widthS,":first-child"),g=n.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=JT(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Rt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),K(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const C=j.rect(t,y),b=C.x-(t.x??0);if(d!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-b*b/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),C.y+=k}return C},n}p(Bp,"cylinder");async function ii(e,t,r){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await rt(e,t,et(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=X.svg(s),y=V(t,{}),C=f||u?m.path(ar(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>C,":first-child"),d.attr("class","basic label-container").attr("style",Rt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Rt(f)).attr("ry",Rt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return K(t,d),t.calcIntersect=function(m,y){return j.rect(m,y)},t.intersect=function(m){return j.rect(t,m)},s}p(ii,"drawRect");async function Lp(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await ii(e,t,l);if(t.look==="handDrawn"){const u=X.svg(c),g=V(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let C=null;if(y instanceof SVGGraphicsElement)C=y.getBBox();else return c;return c.insert(()=>u.line(C.x,C.y,C.x+C.width,C.y,g),".basic.label-container g.label"),c.insert(()=>u.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(Lp,"datastore");async function Fp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=X.svg(a),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],b=m.polygon(C.map(w=>[w.x,w.y]),y),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),K(t,k),t.intersect=function(w){return j.rect(t,w)},a}p(Fp,"dividedRectangle");async function Ap(e,t){const{labelStyles:r,nodeStyles:i}=Z(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=X.svg(n),g=V(t,{roughness:.2,strokeWidth:2.5}),m=V(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),C=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Rt(t.cssClasses)).attr("style",Rt(f)),d.node()?.appendChild(y),d.node()?.appendChild(C)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return K(t,d),t.intersect=function(u){return N.info("DoubleCircle intersect",t,c,u),j.circle(t,c,u)},n}p(Ap,"doublecircle");function Ep(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=X.svg(s),{nodeBorder:c}=r,h=V(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),K(t,f),t.intersect=function(u){return N.info("filledCircle intersect",t,{radius:a,point:u}),j.circle(t,a,u)},s}p(Ep,"filledCircle");var Gh=10,Xh=10;async function Mp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.heightC,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=h,K(t,b),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return N.info("Triangle intersect",t,f,k),j.polygon(t,f,k)},a}p(Mp,"flippedTriangle");function $p(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=Z(t);t.label="";const a=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=X.svg(a),u=V(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),K(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(C){return j.rect(t,C)},a}p($p,"forkJoin");async function Op(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),K(t,k),t.intersect=function(w){return N.info("Pill intersect",t,{radius:f,point:w}),j.polygon(t,y,w)},l}p(Op,"halfRoundedRectangle");var rw=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Ip(e,t){const{labelStyles:r,nodeStyles:i}=Z(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await rt(e,t,et(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=X.svg(h),k=V(t,{}),w=rw(0,0,g,f,u),S=b.path(w,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),C&&y.attr("style",C)}else y=Xe(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,K(t,y),t.intersect=function(b){return j.polygon(t,m,b)},h}p(Ip,"hexagon");async function Dp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await rt(e,t,et(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=X.svg(o),c=V(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=ft(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-a/2})`),K(t,u),t.intersect=function(g){return N.info("Pill intersect",t,{points:h}),j.polygon(t,h,g)},o}p(Dp,"hourglass");async function Rp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await rt(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=ei(t),C=-g/2,b=-u/2,k=t.label?8:0,w=X.svg(c),S=V(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=w.rectangle(C,b,g,u,S),E=Math.max(g,h.width),B=u+h.height+k,q=w.rectangle(-E/2,-B/2,E,B,{...S,fill:"transparent",stroke:"none"}),I=c.insert(()=>_,":first-child"),R=c.insert(()=>q);if(t.icon){const H=c.append("g");H.html(`${await Qi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const W=H.node().getBBox(),F=W.width,A=W.height,L=W.x,M=W.y;H.attr("transform",`translate(${-F/2-L},${f?h.height/2+k/2-A/2-M:-h.height/2-k/2-A/2-M})`),H.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),I.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),K(t,R),t.intersect=function(H){if(N.info("iconSquare intersect",t,H),!t.label)return j.rect(t,H);const W=t.x??0,F=t.y??0,A=t.height??0;let L=[];return f?L=[{x:W-h.width/2,y:F-A/2},{x:W+h.width/2,y:F-A/2},{x:W+h.width/2,y:F-A/2+h.height+k},{x:W+g/2,y:F-A/2+h.height+k},{x:W+g/2,y:F+A/2},{x:W-g/2,y:F+A/2},{x:W-g/2,y:F-A/2+h.height+k},{x:W-h.width/2,y:F-A/2+h.height+k}]:L=[{x:W-g/2,y:F-A/2},{x:W+g/2,y:F-A/2},{x:W+g/2,y:F-A/2+u},{x:W+h.width/2,y:F-A/2+u},{x:W+h.width/2/2,y:F+A/2},{x:W-h.width/2,y:F+A/2},{x:W-h.width/2,y:F-A/2+u},{x:W-g/2,y:F-A/2+u}],j.polygon(t,L,H)},c}p(Rp,"icon");async function Pp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await rt(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:C}=ei(t),b=X.svg(c),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const w=C.get("fill");k.stroke=w??y;const S=c.append("g");t.icon&&S.html(`${await Qi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const _=S.node().getBBox(),E=_.width,B=_.height,q=_.x,I=_.y,R=Math.max(E,B)*Math.SQRT2+f*2,H=b.circle(0,0,R,k),W=Math.max(R,h.width),F=R+h.height+u,A=b.rectangle(-W/2,-F/2,W,F,{...k,fill:"transparent",stroke:"none"}),L=c.insert(()=>H,":first-child"),M=c.insert(()=>A);return S.attr("transform",`translate(${-E/2-q},${g?h.height/2+u/2-B/2-I:-h.height/2-u/2-B/2-I})`),S.attr("style",`color: ${C.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-F/2:F/2-h.height})`),L.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),K(t,M),t.intersect=function(D){return N.info("iconSquare intersect",t,D),j.rect(t,D)},c}p(Pp,"iconCircle");async function Np(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await rt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=ei(t),k=-m/2,w=-g/2,S=t.label?8:0,_=X.svg(c),E=V(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=b.get("fill");E.stroke=B??C;const q=_.path(ar(k,w,m,g,5),E),I=Math.max(m,h.width),R=g+h.height+S,H=_.rectangle(-I/2,-R/2,I,R,{...E,fill:"transparent",stroke:"none"}),W=c.insert(()=>q,":first-child").attr("class","icon-shape2"),F=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`${await Qi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=A.node().getBBox(),M=L.width,D=L.height,z=L.x,Y=L.y;A.attr("transform",`translate(${-M/2-z},${u?h.height/2+S/2-D/2-Y:-h.height/2-S/2-D/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),W.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),K(t,F),t.intersect=function(A){if(N.info("iconSquare intersect",t,A),!t.label)return j.rect(t,A);const L=t.x??0,M=t.y??0,D=t.height??0;let z=[];return u?z=[{x:L-h.width/2,y:M-D/2},{x:L+h.width/2,y:M-D/2},{x:L+h.width/2,y:M-D/2+h.height+S},{x:L+m/2,y:M-D/2+h.height+S},{x:L+m/2,y:M+D/2},{x:L-m/2,y:M+D/2},{x:L-m/2,y:M-D/2+h.height+S},{x:L-h.width/2,y:M-D/2+h.height+S}]:z=[{x:L-m/2,y:M-D/2},{x:L+m/2,y:M-D/2},{x:L+m/2,y:M-D/2+g},{x:L+h.width/2,y:M-D/2+g},{x:L+h.width/2/2,y:M+D/2},{x:L-h.width/2,y:M+D/2},{x:L-h.width/2,y:M-D/2+g},{x:L-m/2,y:M-D/2+g}],j.polygon(t,z,A)},c}p(Np,"iconRounded");async function qp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await rt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=ei(t),k=-m/2,w=-g/2,S=t.label?8:0,_=X.svg(c),E=V(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=b.get("fill");E.stroke=B??C;const q=_.path(ar(k,w,m,g,.1),E),I=Math.max(m,h.width),R=g+h.height+S,H=_.rectangle(-I/2,-R/2,I,R,{...E,fill:"transparent",stroke:"none"}),W=c.insert(()=>q,":first-child"),F=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`${await Qi(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=A.node().getBBox(),M=L.width,D=L.height,z=L.x,Y=L.y;A.attr("transform",`translate(${-M/2-z},${u?h.height/2+S/2-D/2-Y:-h.height/2-S/2-D/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),W.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),K(t,F),t.intersect=function(A){if(N.info("iconSquare intersect",t,A),!t.label)return j.rect(t,A);const L=t.x??0,M=t.y??0,D=t.height??0;let z=[];return u?z=[{x:L-h.width/2,y:M-D/2},{x:L+h.width/2,y:M-D/2},{x:L+h.width/2,y:M-D/2+h.height+S},{x:L+m/2,y:M-D/2+h.height+S},{x:L+m/2,y:M+D/2},{x:L-m/2,y:M+D/2},{x:L-m/2,y:M-D/2+h.height+S},{x:L-h.width/2,y:M-D/2+h.height+S}]:z=[{x:L-m/2,y:M-D/2},{x:L+m/2,y:M-D/2},{x:L+m/2,y:M-D/2+g},{x:L+h.width/2,y:M-D/2+g},{x:L+h.width/2/2,y:M+D/2},{x:L-h.width/2,y:M+D/2},{x:L-h.width/2,y:M-D/2+g},{x:L-m/2,y:M-D/2+g}],j.polygon(t,z,A)},c}p(qp,"iconSquare");async function Wp(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=Z(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await rt(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,C=t.label?8:0,b=X.svg(d),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const w=b.rectangle(m,y,c,h,k),S=Math.max(c,f.width),_=h+f.height+C,E=b.rectangle(-S/2,-_/2,S,_,{...k,fill:"none",stroke:"none"}),B=d.insert(()=>w,":first-child"),q=d.insert(()=>E);if(t.img){const I=d.append("image");I.attr("href",t.img),I.attr("width",c),I.attr("height",h),I.attr("preserveAspectRatio","none"),I.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-C/2:h/2-f.height/2+C/2})`),B.attr("transform",`translate(0,${g?f.height/2+C/2:-f.height/2-C/2})`),K(t,q),t.intersect=function(I){if(N.info("iconSquare intersect",t,I),!t.label)return j.rect(t,I);const R=t.x??0,H=t.y??0,W=t.height??0;let F=[];return g?F=[{x:R-f.width/2,y:H-W/2},{x:R+f.width/2,y:H-W/2},{x:R+f.width/2,y:H-W/2+f.height+C},{x:R+c/2,y:H-W/2+f.height+C},{x:R+c/2,y:H+W/2},{x:R-c/2,y:H+W/2},{x:R-c/2,y:H-W/2+f.height+C},{x:R-f.width/2,y:H-W/2+f.height+C}]:F=[{x:R-c/2,y:H-W/2},{x:R+c/2,y:H-W/2},{x:R+c/2,y:H-W/2+h},{x:R+f.width/2,y:H-W/2+h},{x:R+f.width/2/2,y:H+W/2},{x:R-f.width/2,y:H+W/2},{x:R-f.width/2,y:H-W/2+h},{x:R-c/2,y:H-W/2+h}],j.polygon(t,F,I)},d}p(Wp,"imageSquare");async function zp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=Xe(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,K(t,f),t.intersect=function(g){return j.polygon(t,d,g)},n}p(zp,"inv_trapezoid");async function Hp(e,t){const{shapeSvg:r,bbox:i,label:o}=await rt(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),K(t,s),t.intersect=function(l){return j.rect(t,l)},r}p(Hp,"labelRect");async function Yp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,d,g)},n}p(Yp,"lean_left");async function Up(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,d,g)},n}p(Up,"lean_right");function jp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=X.svg(o),d=V(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=ft(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),K(t,g),t.intersect=function(m){return N.info("lightningBolt intersect",t,m),j.polygon(t,c,m)},o}p(jp,"lightningBolt");var iw=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),ow=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),sw=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Vh=10,Zh=10;async function Gp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.width_,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const C=iw(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Rt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),K(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(C){const b=j.rect(t,C),k=b.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let w=f*f*(1-k*k/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,C.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},n}p(Gp,"linedCylinder");async function Xp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const w=t.width;t.width=(w??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=X.svg(n),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...sr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],b=m.polygon(C.map(w=>[w.x,w.y]),y),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),K(t,k),t.intersect=function(w){return j.polygon(t,C,w)},n}p(Xp,"linedWaveEdgedRect");async function Vp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await rt(e,t,et(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:C}=t,b=X.svg(l),k=V(t,{}),w=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=ft(w);let E=b.path(_,k);const B=ft(S);let q=b.path(B,k);t.look!=="handDrawn"&&(E=Ka(E),q=Ka(q));const I=l.insert("g",":first-child");return I.insert(()=>E),I.insert(()=>q),I.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),K(t,I),t.intersect=function(R){return j.polygon(t,w,R)},l}p(Vp,"multiRect");async function Zp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await rt(e,t,et(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,C=10,{cssStyles:b}=t,k=sr(m-C,y+g+C,m+d-C,y+g+C,u,.8),w=k?.[k.length-1],S=[{x:m-C,y:y+C},{x:m-C,y:y+g+C},...k,{x:m+d-C,y:w.y-C},{x:m+d,y:w.y-C},{x:m+d,y:w.y-2*C},{x:m+d+C,y:w.y-2*C},{x:m+d+C,y:y-C},{x:m+C,y:y-C},{x:m+C,y},{x:m,y},{x:m,y:y+C}],_=[{x:m,y:y+C},{x:m+d-C,y:y+C},{x:m+d-C,y:w.y-C},{x:m+d,y:w.y-C},{x:m+d,y},{x:m,y}],E=X.svg(o),B=V(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const q=ft(S),I=E.path(q,B),R=ft(_),H=E.path(R,B),W=o.insert(()=>I,":first-child");return W.insert(()=>H),W.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",i),W.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-u/2-(s.y-(s.top??0))})`),K(t,W),t.intersect=function(F){return j.polygon(t,S,F)},o}p(Zp,"multiWaveEdgedRectangle");async function Kp(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i,t.useHtmlLabels||Kt(vt())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=X.svg(a),m=V(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,c,h,m),C=a.insert(()=>y,":first-child");return C.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,C),t.intersect=function(b){return j.rect(t,b)},a}p(Kp,"note");var aw=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Qp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await rt(e,t,et(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=X.svg(o),g=V(t,{}),m=aw(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=Xe(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),K(t,d),t.calcIntersect=function(u,g){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],C=j.polygon(u,y,g);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Qp,"question");async function Jp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,C=X.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=ft(m),w=C.path(k,b),S=n.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),K(t,S),t.intersect=function(_){return j.polygon(t,m,_)},n}p(Jp,"rect_left_inv_arrow");async function tg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await Qe(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Kt(yt())){const B=h.children[0],q=ht(h);d=B.getBoundingClientRect(),q.attr("width",d.width),q.attr("height",d.height)}N.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await Qe(n,Array.isArray(f)?f.join("
      "):f,t.labelStyle,!0,!0),m=g.children[0],y=ht(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const C=(t.padding||0)/2;ht(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+C+5)+")"),ht(h).attr("transform","translate( "+(d.width(N.debug("Rough node insert CXC",I),R),":first-child"),_=s.insert(()=>(N.debug("Rough node insert CXC",I),I),":first-child")}else _=a.insert("rect",":first-child"),E=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-C).attr("y",-d.height/2-C).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-C).attr("x2",d.width/2+C).attr("y1",-d.height/2-C+u.height+C).attr("y2",-d.height/2-C+u.height+C);return K(t,_),t.intersect=function(B){return j.rect(t,B)},s}p(tg,"rectWithTitle");async function eg(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ii(e,t,o)}p(eg,"roundedRect");var cr=8;async function rg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?cr:cr*2),h=(t?.height??n.height)+s*2,d=c-cr,f=h,u=cr-c/2,g=-h/2,{cssStyles:m}=t,y=X.svg(a),C=V(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-cr,y:g+f},{x:u-cr,y:g},{x:u,y:g},{x:u,y:g+f}],k=y.polygon(b.map(S=>[S.x,S.y]),C),w=a.insert(()=>k,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Rt(m)),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),l.attr("transform",`translate(${cr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,w),t.intersect=function(S){return j.rect(t,S)},a}p(rg,"shadedProcess");async function ig(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,C=X.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],w=ft(k),S=C.path(w,b),_=n.insert(()=>S,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),K(t,_),t.intersect=function(E){return j.polygon(t,k,E)},n}p(ig,"slopedRect");async function og(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return ii(e,t,s)}p(og,"squareRect");async function sg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=X.svg(n),g=V(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...zi(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...zi(h/2-d,0,d,50,270,450)],y=ft(m),C=u.path(y,g),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),K(t,b),t.intersect=function(k){return j.polygon(t,m,k)},n}p(sg,"stadium");async function ag(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return ii(e,t,r)}p(ag,"state");function ng(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=X.svg(h),f=V(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),C=h.insert(()=>u,":first-child");if(C.insert(()=>y),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",k=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${k})`)}return K(t,C),t.intersect=function(b){return j.circle(t,(t.width??0)/2,b)},h}p(ng,"stateEnd");function lg(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=X.svg(s).circle(0,0,t.width,g2(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return K(t,a),t.intersect=function(n){return j.circle(t,(t.width??7)/2,n)},s}p(lg,"stateStart");var Rr=8;async function hg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width??l.width)+2*Rr+s,h=(t?.height??l.height)+a,d=c-2*Rr,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=X.svg(n),C=V(t,{}),b=y.rectangle(u,g,d+16,f,C),k=y.line(u+Rr,g,u+Rr,g+f,C),w=y.line(u+Rr+d,g,u+Rr+d,g+f,C);n.insert(()=>k,":first-child"),n.insert(()=>w,":first-child");const S=n.insert(()=>b,":first-child"),{cssStyles:_}=t;S.attr("class","basic label-container").attr("style",Rt(_)),K(t,S)}else{const y=Xe(n,d,f,m);i&&y.attr("style",i),K(t,y)}return t.intersect=function(y){return j.polygon(t,m,y)},n}p(hg,"subroutine");var oa=.2;async function cg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-oa*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height?t?.height:l.height)+a*2,h=oa*c,d=oa*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:C}=t,b=X.svg(n),k=V(t,{}),w=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],S=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=ft(w),E=b.path(_,k),B=ft(S),q=b.path(B,{...k,fillStyle:"solid"}),I=n.insert(()=>q,":first-child");return I.insert(()=>E,":first-child"),I.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),K(t,I),t.intersect=function(R){return j.polygon(t,w,R)},n}p(cg,"taggedRect");async function dg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await rt(e,t,et(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=X.svg(o),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...sr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],C=-n/2+n/2*.1,b=-f/2-d*.4,k=[{x:C+n-h,y:(b+l)*1.3},{x:C+n,y:b+l-d},{x:C+n,y:(b+l)*.9},...sr(C+n,(b+l)*1.25,C+n-h,(b+l)*1.3,-l*.02,.5)],w=ft(y),S=g.path(w,m),_=ft(k),E=g.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>S,":first-child"),B.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),K(t,B),t.intersect=function(q){return j.polygon(t,y,q)},o}p(dg,"taggedWaveEdgedRectangle");async function ug(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await rt(e,t,et(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),K(t,h),t.intersect=function(d){return j.rect(t,d)},o}p(ug,"text");var nw=p((e,t,r,i,o,s)=>`M${e},${t} + a${o},${s} 0,0,1 0,${-i} + l${r},0 + a${o},${s} 0,0,1 0,${i} + M${r},${-i} + a${o},${s} 0,0,0 0,${i} + l${-r},0`,"createCylinderPathD"),lw=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),hw=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Kh=5,Qh=10;async function fg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.heightk,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=nw(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Rt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,g),t.intersect=function(m){const y=j.rect(t,m),C=y.y-(t.y??0);if(h!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let b=d*d*(1-C*C/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(fg,"tiltedCylinder");async function pg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,d,g)},n}p(pg,"trapezoid");async function gg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),K(t,k),t.intersect=function(w){return j.polygon(t,y,w)},c}p(gg,"trapezoidalPentagon");var Jh=10,tc=10;async function mg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,K(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(w){return N.info("Triangle intersect",t,u,w),j.polygon(t,u,w)},a}p(mg,"triangle");async function yg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await rt(e,t,et(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,C=14-d,b=C>0?C/2:0,k=X.svg(l),w=V(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=[{x:-d/2-b,y:g/2},...sr(-d/2-b,g/2,d/2+b,g/2,u,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],_=ft(S),E=k.path(_,w),B=l.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),K(t,B),t.intersect=function(q){return j.polygon(t,S,q)},l}p(yg,"waveEdgedRectangle");async function Cg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-w*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=X.svg(n),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...sr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...sr(c/2,-f/2,-c/2,-f/2,d,-1)],C=ft(y),b=g.path(C,m),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),K(t,k),t.intersect=function(w){return j.polygon(t,y,w)},n}p(Cg,"waveRectangle");var Bt=10;async function xg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Bt,10),t.height=Math.max((t?.height??0)-s*2-Bt,10));const{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=(t?.width?t?.width:n.width)+o*2+Bt,h=(t?.height?t?.height:n.height)+s*2+Bt,d=c-Bt,f=h-Bt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=X.svg(a),C=V(t,{}),b=[{x:u-Bt,y:g-Bt},{x:u-Bt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Bt}],k=`M${u-Bt},${g-Bt} L${u+d},${g-Bt} L${u+d},${g+f} L${u-Bt},${g+f} L${u-Bt},${g-Bt} + M${u-Bt},${g} L${u+d},${g} + M${u},${g-Bt} L${u},${g+f}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=y.path(k,C),S=a.insert(()=>w,":first-child");return S.attr("transform",`translate(${Bt/2}, ${Bt/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Bt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Bt/2-(n.y-(n.top??0))})`),K(t,S),t.intersect=function(_){return j.polygon(t,b,_)},a}p(xg,"windowPane");var ec=new Set(["redux-color","redux-dark-color"]),cw=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function sl(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=vt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:G}=vt(),{background:ct}=G,st={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ct}`]};await sl(e,st)}const c=vt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=Z(t);if(r.attributes.length===0&&t.label){const G={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ye(t.label,c)+G.labelPaddingX*20){const G=C.width+h*2-(S+_+E+B);S+=G/R,_+=G/R,E>0&&(E+=G/R),B>0&&(B+=G/R)}const W=S+_+E+B,F=X.svg(y),A=V(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let L=0;w.length>0&&(L=w.reduce((G,ct)=>G+(ct?.rowHeight??0),0));const M=Math.max(H.width+h*2,t?.width||0,W),D=Math.max((L??0)+C.height,t?.height||0),z=-M/2,Y=-D/2;if(y.selectAll("g:not(:first-child)").each((G,ct,st)=>{const kt=ht(st[ct]),Tt=kt.attr("transform");let wt=0,le=0;if(Tt){const vr=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Tt);vr&&(wt=parseFloat(vr[1]),le=parseFloat(vr[2]),kt.attr("class").includes("attribute-name")?wt+=S:kt.attr("class").includes("attribute-keys")?wt+=S+_:kt.attr("class").includes("attribute-comment")&&(wt+=S+_+E))}kt.attr("transform",`translate(${z+h/2+wt}, ${le+Y+C.height+d/2})`)}),y.select(".name").attr("transform","translate("+-C.width/2+", "+(Y+d/2)+")"),i!=null&&ec.has(i)){const G=r.colorIndex??0;y.attr("data-color-id",`color-${G%l.length}`)}const lt=F.rectangle(z,Y,M,D,A),gt=y.insert(()=>lt,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[G,ct]of w.entries()){const kt=(G+1)%2===0&&ct.yOffset!==0,Tt=F.rectangle(z,C.height+Y+ct?.yOffset,M,ct?.rowHeight,{...A,fill:kt?s:a,stroke:n});y.insert(()=>Tt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${kt?"even":"odd"}`)}const dt=1e-4;let tt=Wr(z,C.height+Y,M+z,C.height+Y,dt),mt=F.polygon(tt.map(G=>[G.x,G.y]),A);if(y.insert(()=>mt).attr("class","divider"),tt=Wr(S+z,C.height+Y,S+z,D+Y,dt),mt=F.polygon(tt.map(G=>[G.x,G.y]),A),y.insert(()=>mt).attr("class","divider"),q){const G=S+_+z;tt=Wr(G,C.height+Y,G,D+Y,dt),mt=F.polygon(tt.map(ct=>[ct.x,ct.y]),A),y.insert(()=>mt).attr("class","divider")}if(I){const G=S+_+E+z;tt=Wr(G,C.height+Y,G,D+Y,dt),mt=F.polygon(tt.map(ct=>[ct.x,ct.y]),A),y.insert(()=>mt).attr("class","divider")}for(const G of k){const ct=C.height+Y+G;tt=Wr(z,ct,M+z,ct,dt),mt=F.polygon(tt.map(st=>[st.x,st.y]),A),y.insert(()=>mt).attr("class","divider")}if(K(t,gt),g&&t.look!=="handDrawn")if(i!=null&&cw.has(i))y.selectAll("path").attr("style",g);else{const ct=g.split(";")?.filter(st=>st.includes("stroke"))?.map(st=>`${st}`).join("; ");y.selectAll("path").attr("style",ct??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(G){return j.rect(t,G)},y}p(sl,"erBox");async function qr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Ul(t)&&(t=Ul(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Ge(n,t,{width:Ye(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(je(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ht(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(qr,"addText");function Wr(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(Wr,"lineToPolygon");async function bg(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",et(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await _i(n,{text:`«${b}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await _i(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await _i(c,b,m,[b.parseClassifier()]);m+=k+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const k=await _i(h,b,y,[b.parseClassifier()]);y+=k+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),C=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}p(bg,"textHelper");async function _i(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=vt();let a="useHtmlLabels"in t?t.useHtmlLabels:je(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),$i(n)&&(a=!0);const l=await Ge(o,pn(Tr(n)),{width:Ye(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=ht(l);h=d.innerHTML.split("
      ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const u=d.getElementsByTagName("img");if(u){const g=n.replace(/]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function C(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,w=parseInt(b,10)*5+"px";m.style.minWidth=w,m.style.maxWidth=w}else m.style.width="100%";y(m)}p(C,"setupImage"),setTimeout(()=>{m.complete&&C()}),m.addEventListener("error",C),m.addEventListener("load",C)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ht(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(_i,"addText");async function kg(e,t){const r=yt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??je(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await bg(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=Z(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=X.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Math.max(t.width??0,h.width);let b=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=a:l.members.length>0&&l.methods.length===0&&(b+=a*2);const w=-C/2,S=-b/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const E=m.rectangle(w-s,S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),C+2*s,b+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const q=B.node().getBBox(),I=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,R=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,H=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,W=(I+R+S+s-(S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((F,A,L)=>{const M=ht(L[A]),D=M.attr("transform");let z=0;if(D){const dt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);dt&&(z=parseFloat(dt[2]))}let Y=z+S+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(M.attr("class").includes("methods-group")){const gt=Math.max(H,a/2);k?Y=Math.max(W,I+R+gt+S+a*2+s)+a*2:Y=I+R+gt+S+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?Y=z-a:Y=z),n||(Y-=4);let lt=w;(M.attr("class").includes("label-group")||M.attr("class").includes("annotation-group"))&&(lt=-M.node()?.getBBox().width/2||0,c.selectAll("text").each(function(gt,dt,tt){window.getComputedStyle(tt[dt]).textAnchor==="middle"&&(lt=0)})),M.attr("transform",`translate(${lt}, ${Y})`)}),l.members.length>0||l.methods.length>0||g){const F=I+R+S+s,A=m.line(q.x,F,q.x+q.width,F+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const F=I+R+H+S+a*2+s,A=m.line(q.x,k?Math.max(W,F):F,q.x+q.width,(k?Math.max(W,F):F)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),B.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const F=RegExp(/color\s*:\s*([^;]*)/),A=F.exec(u);if(A){const L=A[0].replace("color","fill");c.selectAll("tspan").attr("style",L)}else if(d){const L=F.exec(d);if(L){const M=L[0].replace("color","fill");c.selectAll("tspan").attr("style",M)}}}return K(t,B),t.intersect=function(F){return j.rect(t,F)},c}p(kg,"classBox");async function Tg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=et(t),{themeVariables:h}=yt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Be(u,`<<${o.type}>>`,0,t.labelStyle):g=await Be(u,"<<Element>>",0,t.labelStyle);let m=g;const y=await Be(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const q=await Be(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=q;const I=await Be(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=I;const R=await Be(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=R,await Be(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const q=await Be(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=q,await Be(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const C=(u.node()?.getBBox().width??200)+a,b=(u.node()?.getBBox().height??200)+a,k=-C/2,w=-b/2,S=X.svg(u),_=V(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=S.rectangle(k,w,C,b,_),B=u.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const q=t.colorIndex??0;u.attr("data-color-id",`color-${q%d.length}`)}if(u.selectAll(".label").each((q,I,R)=>{const H=ht(R[I]),W=H.attr("transform");let F=0,A=0;if(W){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(W);z&&(F=parseFloat(z[1]),A=parseFloat(z[2]))}const L=A-b/2;let M=k+a/2;(I===0||I===1)&&(M=F),H.attr("transform",`translate(${M}, ${L+a})`)}),m>g+y+n){const q=w+g+y+n;let I;if(t.look==="neo"){const W=[[k,q],[k+C,q],[k+C,q+.001],[k,q+.001]];I=S.polygon(W,_)}else I=S.line(k,q,k+C,q,_);u.insert(()=>I).attr("class","divider")}return K(t,B),t.intersect=function(q){return j.rect(t,q)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(Tg,"requirementBox");async function Be(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=yt(),a=s.htmlLabels??!0,n=await Ge(o,pn(Tr(t)),{width:Ye(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=ht(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Be,"addText");var dw=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function wg(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await ia(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await ia(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:C}=await ia(n,"assigned"in t&&t.assigned||"",u);t.width=a;const b=10,k=t?.width||0,w=Math.max(m.height,C.height)/2,S=Math.max(l.height+b*2,t?.height||0)+w,_=-k/2,E=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-C.width-2*s)+", "+(-w+l.height/2)+")");let B;const{rx:q,ry:I}=t,{cssStyles:R}=t;if(t.look==="handDrawn"){const H=X.svg(n),W=V(t,{}),F=q||I?H.path(ar(_,E,k,S,q||0),W):H.rectangle(_,E,k,S,W);B=n.insert(()=>F,":first-child"),B.attr("class","basic label-container").attr("style",R||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",q??5).attr("ry",I??5).attr("x",_).attr("y",E).attr("width",k).attr("height",S);const H="priority"in t&&t.priority;if(H){const W=n.append("line"),F=_+2,A=E+Math.floor((q??0)/2),L=E+S-Math.floor((q??0)/2);W.attr("x1",F).attr("y1",A).attr("x2",F).attr("y2",L).attr("stroke-width","4").attr("stroke",dw(H))}}return K(t,B),t.height=S,t.intersect=function(H){return j.rect(t,H)},n}p(wg,"kanbanItem");async function Sg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const C=`M0 0 + a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},${m*.1} + + a${h},${h} 1 0,0 ${g*.15},${m*.33} + a${h*.8},${h*.8} 1 0,0 0,${m*.34} + a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} + + a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} + + a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} + a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} + a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} + H0 V0 Z`;if(t.look==="handDrawn"){const b=X.svg(o),k=V(t,{}),w=b.path(C,k);y=o.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Rt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),K(t,y),t.calcIntersect=function(b,k){return j.rect(b,k)},t.intersect=function(b){return N.info("Bang intersect",t,b),j.rect(t,b)},o}p(Sg,"bang");async function _g(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 + a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} + a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} + a${d},${d} 1 0,1 ${l*.35},${l*.2} + + a${h},${h} 1 0,1 ${l*.15},${c*.35} + a${u},${u} 1 0,1 ${-1*l*.15},${c*.65} + + a${d},${h} 1 0,1 ${-1*l*.25},${l*.15} + a${f},${f} 1 0,1 ${-1*l*.5},0 + a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} + + a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} + a${u},${u} 1 0,1 ${l*.1},${-1*c*.65} + H0 V0 Z`;if(t.look==="handDrawn"){const C=X.svg(o),b=V(t,{}),k=C.path(y,b);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Rt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),K(t,m),t.calcIntersect=function(C,b){return j.rect(C,b)},t.intersect=function(C){return N.info("Cloud intersect",t,C),j.rect(t,C)},o}p(_g,"cloud");async function vg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-h} + H${-l/2} + Z + `:` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-2*h} + q0,${h} ${-h},${h} + h${-(l-2*h)} + q${-h},0 ${-h},${-h} + Z + `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),K(t,f),t.calcIntersect=function(u,g){return j.rect(u,g)},t.intersect=function(u){return j.rect(t,u)},o}p(vg,"defaultMindmapNode");async function Bg(e,t){const r={padding:t.padding??0};return ol(e,t,r)}p(Bg,"mindmapCircle");var uw=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:og},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:eg},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:sg},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:hg},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Bp},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Lp},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:ol},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Sg},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:_g},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Qp},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ip},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Up},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Yp},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:pg},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:zp},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ap},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:ug},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:xp},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rg},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:lg},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:ng},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:$p},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Dp},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:wp},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Sp},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:_p},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:jp},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:yg},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Op},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:fg},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Gp},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:vp},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Fp},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:mg},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:xg},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ep},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:gg},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Mp},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ig},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Zp},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Vp},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Cp},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Tp},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:dg},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:cg},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Cg},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Jp},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Xp}],fw=p(()=>{const t=[...Object.entries({state:ag,choice:bp,note:Kp,rectWithTitle:tg,labelRect:Hp,iconSquare:qp,iconCircle:Pp,icon:Rp,iconRounded:Np,imageSquare:Wp,anchor:mp,kanbanItem:wg,mindmapCircle:Bg,defaultMindmapNode:vg,classBox:kg,erBox:sl,requirementBox:Tg}),...uw.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Lg=fw();function pw(e){return e in Lg}p(pw,"isValidShape");var vs=new Map;async function Fg(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Lg[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Rt(t.look)),t.tooltip&&o.attr("title",t.tooltip),vs.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Fg,"insertNode");var WB=p((e,t)=>{vs.set(t.id,e)},"setNodeElem"),zB=p(()=>{vs.clear()},"clear"),HB=p(e=>{const t=vs.get(e.id);N.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),gw=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&rc(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&rc(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),mw={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},yw=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],rc=p((e,t,r,i,o,s,a=!1,n)=>{const l=mw[r],c=l&&yw.includes(l.type);if(!l){N.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const C=y.cloneNode(!0);C.id=m,C.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),Cw=p(e=>typeof e=="string"?e:yt()?.flowchart?.curve,"resolveEdgeCurveType"),hs=new Map,qt=new Map,YB=p(()=>{hs.clear(),qt.clear()},"clear"),yi=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),xw=p(async(e,t)=>{const r=yt();let i=Kt(r);const{labelStyles:o}=Z(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Ge(e,t.label,{style:yi(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),N.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],g=ht(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=ht(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",ui(d,i)),hs.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await Qe(g,t.startLabelLeft,yi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).startLeft=u,vi(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await Qe(g,t.startLabelRight,yi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).startRight=u,vi(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await Qe(u,t.endLabelLeft,yi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).endLeft=u,vi(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await Qe(u,t.endLabelRight,yi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),qt.get(t.id)||qt.set(t.id,{}),qt.get(t.id).endRight=u,vi(f,t.endLabelRight)}return c},"insertEdgeLabel");function vi(e,t){Kt(yt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(vi,"setTerminalWidth");var bw=p((e,t)=>{N.debug("Moving label abc88 ",e.id,e.label,hs.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=yt(),{subGraphTitleTotalMargin:o}=Un(i);if(e.label){const s=hs.get(e.id);let a=e.x,n=e.y;if(r){const l=ge.calcLabelPosition(r);N.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=qt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=ge.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=qt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=ge.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=qt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=ge.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=qt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=ge.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),kw=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),Tw=p((e,t,r)=>{N.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(r)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.xMath.abs(i-t.x)*l){let d=r.y{N.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(N.info("abc88 checking point",s,t),!kw(t,s)&&!o){const a=Tw(t,i,s);N.debug("abc88 inside",s,i,a),N.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?N.warn("abc88 no intersect",a,r):r.push(a),o=!0}else N.warn("abc88 outside",s,i),i=s,o||r.push(s)}),N.debug("returning points",r),r},"cutPathAtIntersect");function Ag(e){const t=[],r=[];for(let i=1;i5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(Ag,"extractCornerPoints");var oc=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),ww=p(function(e){const{cornerPointPositions:t}=Ag(e),r=[];for(let i=0;i10&&Math.abs(s.y-o.y)>=10){N.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else N.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),Sw=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),_w=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=yt();let c=t.points,h=!1;const d=o;var f=s;const u=[];for(const M in t.cssCompiledStyles)Lf(M)||u.push(t.cssCompiledStyles[M]);N.debug("UIO intersect check",t.points,f.x,d.x),f.intersect&&d.intersect&&!n&&(c=c.slice(1,t.points.length-1),c.unshift(d.intersect(c[0])),N.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(N.info("to cluster abc88",r.get(t.toCluster)),c=ic(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(N.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=ic(c.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let m=c.filter(M=>!Number.isNaN(M.y));const y=Cw(t.curve);y!=="rounded"&&(m=ww(m));let C=Ai;switch(y){case"linear":C=Ai;break;case"basis":C=Sa;break;case"cardinal":C=gd;break;case"bumpX":C=cd;break;case"bumpY":C=dd;break;case"catmullRom":C=yd;break;case"monotoneX":C=wd;break;case"monotoneY":C=Sd;break;case"natural":C=vd;break;case"step":C=Bd;break;case"stepAfter":C=Fd;break;case"stepBefore":C=Ld;break;case"rounded":C=Ai;break;default:C=Sa}const{x:b,y:k}=C1(t),w=ek().x(b).y(k).curve(C);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let _,E=y==="rounded"?Eg(Mg(m,t),5):w(m);const B=Array.isArray(t.style)?t.style:[t.style];let q=B.find(M=>M?.startsWith("stroke:")),I="";t.animate&&(I="edge-animation-fast"),t.animation&&(I="edge-animation-"+t.animation);let R=!1;if(t.look==="handDrawn"){const M=X.svg(e);Object.assign([],m);const D=M.path(E,{roughness:.3,seed:l});S+=" transition",_=ht(D).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",B?B.reduce((Y,lt)=>Y+";"+lt,""):"");let z=_.attr("d");_.attr("d",z),e.node().appendChild(_.node())}else{const M=u.join(";"),D=B?B.reduce((tt,mt)=>tt+mt+";",""):"",z=(M?M+";"+D+";":D)+";"+(B?B.reduce((tt,mt)=>tt+";"+mt,""):"");_=e.append("path").attr("d",E).attr("id",`${a}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",z),q=z.match(/stroke:([^;]+)/)?.[1],R=t.animate===!0||!!t.animation||M.includes("animation");const Y=_.node(),lt=typeof Y.getTotalLength=="function"?Y.getTotalLength():0,gt=Ch[t.arrowTypeStart]||0,dt=Ch[t.arrowTypeEnd]||0;if(t.look==="neo"&&!R){const mt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Sw(lt,gt,dt):`0 ${gt} ${lt-gt-dt} ${dt}`}; stroke-dashoffset: 0;`;_.attr("style",mt+_.attr("style"))}}_.attr("data-edge",!0),_.attr("data-et","edge"),_.attr("data-id",t.id),_.attr("data-points",g),_.attr("data-look",Rt(t.look)),t.showPoints&&m.forEach(M=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",M.x).attr("cy",M.y)});let H="";(yt().flowchart.arrowMarkerAbsolute||yt().state.arrowMarkerAbsolute)&&(H=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,H=H.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),N.info("arrowTypeStart",t.arrowTypeStart),N.info("arrowTypeEnd",t.arrowTypeEnd);const W=!R&&t?.look==="neo";gw(_,t,H,a,i,W,q);const F=Math.floor(c.length/2),A=c[F];ge.isLabelCoordinateInPath(A,_.attr("d"))||(h=!0);let L={};return h&&(L.updatedPath=c),L.originalPath=t.points,L},"insertEdge");function Eg(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s({...o}));if(e.length>=2&&Ht[t.arrowTypeStart]){const o=Ht[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=tn(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Ht[t.arrowTypeEnd]){const o=Ht[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=tn(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(Mg,"applyMarkerOffsetsToPoints");var vw=p((e,t,r,i)=>{t.forEach(o=>{Vw[o](e,r,i)})},"insertMarkers"),Bw=p((e,t,r)=>{N.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),Lw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Fw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Aw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ew=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),Mw=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),$w=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),Ow=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),Iw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Dw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),Rw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),Pw=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Nw=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),qw=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),Ww=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),zw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),Hw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),Yw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),Uw=p((e,t,r)=>{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").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`)},"requirement_arrow"),jw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`).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"),Gw=p((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"),Xw=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o,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",`${s}`)},"requirement_contains_neo"),Vw={extension:Bw,composition:Lw,aggregation:Fw,dependency:Aw,lollipop:Ew,point:Mw,circle:$w,cross:Ow,barb:Iw,barbNeo:Dw,only_one:Rw,zero_or_one:Pw,one_or_more:Nw,zero_or_more:qw,only_one_neo:Ww,zero_or_one_neo:zw,one_or_more_neo:Hw,zero_or_more_neo:Yw,requirement_arrow:Uw,requirement_contains:Gw,requirement_arrow_neo:jw,requirement_contains_neo:Xw},Zw=vw,Kw={common:ji,getConfig:vt,insertCluster:XT,insertEdge:_w,insertEdgeLabel:xw,insertMarkers:Zw,insertNode:Fg,interpolateToCurve:Nn,labelHelper:rt,log:N,positionEdgeLabel:bw},Hi={},$g=p(e=>{for(const t of e)Hi[t.name]=t},"registerLayoutLoaders"),Qw=p(()=>{$g([{name:"dagre",loader:p(async()=>await pt(()=>import("./dagre-BM42HDAG-D1rsVyHJ.js"),__vite__mapDeps([0,1,2,3,4])),"loader")},{name:"cose-bilkent",loader:p(async()=>await pt(()=>import("./cose-bilkent-S5V4N54A-FADnp6Lk.js"),__vite__mapDeps([5,6,3,4])),"loader")}])},"registerDefaultLayoutLoaders");Qw();var UB=p(async(e,t)=>{if(!(e.layoutAlgorithm in Hi))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=Hi[e.layoutAlgorithm],i=await r.loader(),{theme:o,themeVariables:s}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=s,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",`${o?.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",`${o?.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,Kw,{algorithm:r.algorithm})},"render"),jB=p((e="",{fallback:t="dagre"}={})=>{if(e in Hi)return e;if(t in Hi)return N.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"),al="comm",Og="rule",Ig="decl",Jw="@media",tS="@import",eS="@supports",rS="@namespace",en="@keyframes",Dg="@layer",iS="@scope",oS=Math.abs,Mi=String.fromCharCode;function Rg(e){return e.trim()}function rn(e,t,r){return e.replace(t,r)}function jr(e,t){return e.charCodeAt(t)|0}function Jr(e,t,r){return e.slice(t,r)}function Le(e){return e.length}function Pg(e){return e.length}function xo(e,t){return t.push(e),e}var Bs=1,ti=1,Ng=0,ne=0,Et=0,oi="";function nl(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Bs,column:ti,length:a,return:"",siblings:n}}function sS(){return Et}function aS(){return Et=ne>0?jr(oi,--ne):0,ti--,Et===10&&(ti=1,Bs--),Et}function ye(){return Et=ne2||Yi(Et)>3?"":" "}function cS(e,t){for(;--t&&ye()&&!(Et<48||Et>102||Et>57&&Et<65||Et>70&&Et<97););return Ls(e,Mo()+(t<6&&Je()==32&&ye()==32))}function on(e){for(;ye();)switch(Et){case e:return ne;case 34:case 39:e!==34&&e!==39&&on(Et);break;case 40:e===41&&on(e);break;case 92:ye();break}return ne}function dS(e,t){for(;ye()&&e+Et!==57;)if(e+Et===84&&Je()===47)break;return"/*"+Ls(t,ne-1)+"*"+Mi(e===47?e:ye())}function uS(e){for(;!Yi(Je());)ye();return Ls(e,ne)}function fS(e){return lS($o("",null,null,null,[""],e=nS(e),0,[0],e))}function $o(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,C=1,b=0,k=0,w="",S=o,_=s,E=i,B=w;y;)switch(g=k,k=ye()){case 40:g!=108&&jr(B,d-1)==58?(b++,B+="("):B+=sa(k);break;case 41:b--,B+=")";break;case 34:case 39:case 91:B+=sa(k);break;case 9:case 10:case 13:case 32:if(b>0){B+=Mi(k);break}B+=hS(g);break;case 92:B+=cS(Mo()-1,7);continue;case 47:switch(Je()){case 42:case 47:xo(pS(dS(ye(),Mo()),t,r,l),l),(Yi(g||1)==5||Yi(Je()||1)==5)&&Le(B)&&Jr(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=Le(B)*C;case 125*m:case 59:case 0:if(b>0&&k){B+=Mi(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(B=rn(B,/\f/g,"")),u>0&&(Le(B)-d||m===0)&&xo(u>32?ac(B+";",i,r,d-1,l):ac(rn(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(xo(E=sc(B,t,r,c,h,o,n,w,S=[],_=[],d,s),s),k===123)if(h===0)$o(B,t,E,E,S,s,d,n,_);else{switch(f){case 99:if(jr(B,3)===110)break;case 108:if(jr(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?$o(e,E,E,i&&xo(sc(e,E,E,0,0,o,n,w,o,S=[],d,_),_),o,_,d,n,i?S:_):$o(B,E,E,E,[""],_,0,n,_)}}c=h=u=0,m=C=1,w=B="",d=a;break;case 58:d=1+Le(B),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&aS()==125)continue}switch(B+=Mi(k),k*m){case 38:C=h>0?1:(B+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Le(B)-1)*C,C=1;break;case 64:Je()===45&&(B+=sa(ye())),f=Je(),h=d=Le(w=B+=uS(Mo())),k++;break;case 45:g===45&&Le(B)==2&&(m=0)}}return s}function sc(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=Pg(u),m=0,y=0,C=0;m0?u[b]+" "+k:rn(k,/&\f/g,u[b])))&&(l[C++]=w);return nl(e,t,r,o===0?Og:n,l,c,h,d)}function pS(e,t,r,i){return nl(e,t,r,al,Mi(sS()),Jr(e,2,-2),0,i)}function ac(e,t,r,i,o){return nl(e,t,r,Ig,Jr(e,0,i),Jr(e,i+1,-1),i,o)}function sn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),CS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./c4Diagram-AAUBKEIU-DjQbQYqy.js");return{diagram:t}},__vite__mapDeps([7,8,3,4]));return{id:qg,diagram:e}},"loader"),xS={id:qg,detector:yS,loader:CS},bS=xS,Wg="flowchart",kS=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),TS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-ChzNYmSi.js");return{diagram:t}},__vite__mapDeps([9,10,8,11,12,13,3,4]));return{id:Wg,diagram:e}},"loader"),wS={id:Wg,detector:kS,loader:TS},SS=wS,zg="flowchart-v2",_S=p((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"),vS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-ChzNYmSi.js");return{diagram:t}},__vite__mapDeps([9,10,8,11,12,13,3,4]));return{id:zg,diagram:e}},"loader"),BS={id:zg,detector:_S,loader:vS},LS=BS,Hg="er",FS=p(e=>/^\s*erDiagram/.test(e),"detector"),AS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./erDiagram-TEJ5UH35-BiQkmfSz.js");return{diagram:t}},__vite__mapDeps([14,11,12,13,3,4]));return{id:Hg,diagram:e}},"loader"),ES={id:Hg,detector:FS,loader:AS},MS=ES,Yg="gitGraph",$S=p(e=>/^\s*gitGraph/.test(e),"detector"),OS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-PVQCEYII-XdaI0ZOj.js");return{diagram:t}},__vite__mapDeps([15,16,17,18,3,4]));return{id:Yg,diagram:e}},"loader"),IS={id:Yg,detector:$S,loader:OS},DS=IS,Ug="gantt",RS=p(e=>/^\s*gantt/.test(e),"detector"),PS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./ganttDiagram-6RSMTGT7-DQcybq4U.js");return{diagram:t}},__vite__mapDeps([19,20,21,22,3,4]));return{id:Ug,diagram:e}},"loader"),NS={id:Ug,detector:RS,loader:PS},qS=NS,jg="info",WS=p(e=>/^\s*info/.test(e),"detector"),zS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./infoDiagram-5YYISTIA-B1S64SqR.js");return{diagram:t}},__vite__mapDeps([23,18,3,4]));return{id:jg,diagram:e}},"loader"),HS={id:jg,detector:WS,loader:zS},Gg="pie",YS=p(e=>/^\s*pie/.test(e),"detector"),US=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./pieDiagram-4H26LBE5-DA34Bt67.js");return{diagram:t}},__vite__mapDeps([24,16,18,3,4,25,26,21]));return{id:Gg,diagram:e}},"loader"),jS={id:Gg,detector:YS,loader:US},Xg="quadrantChart",GS=p(e=>/^\s*quadrantChart/.test(e),"detector"),XS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./quadrantDiagram-W4KKPZXB-DToe-wqP.js");return{diagram:t}},__vite__mapDeps([27,20,21,22,3,4]));return{id:Xg,diagram:e}},"loader"),VS={id:Xg,detector:GS,loader:XS},ZS=VS,Vg="xychart",KS=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),QS=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./xychartDiagram-2RQKCTM6-zsCch4aR.js");return{diagram:t}},__vite__mapDeps([28,21,26,20,22,3,4]));return{id:Vg,diagram:e}},"loader"),JS={id:Vg,detector:KS,loader:QS},t_=JS,Zg="requirement",e_=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),r_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./requirementDiagram-4Y6WPE33-CgOSnyR8.js");return{diagram:t}},__vite__mapDeps([29,11,12,3,4]));return{id:Zg,diagram:e}},"loader"),i_={id:Zg,detector:e_,loader:r_},o_=i_,Kg="sequence",s_=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),a_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./sequenceDiagram-3UESZ5HK-BwZabocW.js");return{diagram:t}},__vite__mapDeps([30,8,17,3,4]));return{id:Kg,diagram:e}},"loader"),n_={id:Kg,detector:s_,loader:a_},l_=n_,Qg="class",h_=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),c_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./classDiagram-4FO5ZUOK-DpkPh8gn.js");return{diagram:t}},__vite__mapDeps([31,32,10,8,11,12,3,4]));return{id:Qg,diagram:e}},"loader"),d_={id:Qg,detector:h_,loader:c_},u_=d_,Jg="classDiagram",f_=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),p_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./classDiagram-v2-Q7XG4LA2-DpkPh8gn.js");return{diagram:t}},__vite__mapDeps([33,32,10,8,11,12,3,4]));return{id:Jg,diagram:e}},"loader"),g_={id:Jg,detector:f_,loader:p_},m_=g_,tm="state",y_=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),C_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./stateDiagram-AJRCARHV-BJcdTFrX.js");return{diagram:t}},__vite__mapDeps([34,35,11,12,1,2,3,4]));return{id:tm,diagram:e}},"loader"),x_={id:tm,detector:y_,loader:C_},b_=x_,em="stateDiagram",k_=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),T_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-BHNVJYJU-DpW8Zeth.js");return{diagram:t}},__vite__mapDeps([36,35,11,12,3,4]));return{id:em,diagram:e}},"loader"),w_={id:em,detector:k_,loader:T_},S_=w_,rm="journey",__=p(e=>/^\s*journey/.test(e),"detector"),v_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./journeyDiagram-JHISSGLW-BhwFOFOc.js");return{diagram:t}},__vite__mapDeps([37,10,8,25,3,4]));return{id:rm,diagram:e}},"loader"),B_={id:rm,detector:__,loader:v_},L_=B_,F_=p((e,t,r)=>{N.debug(`rendering svg for syntax error +`);const i=ck(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),$c(i,100,512,!0),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),im={draw:F_},A_=im,E_={db:{},renderer:im,parser:{parse:p(()=>{},"parse")}},M_=E_,om="flowchart-elk",$_=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),O_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-ChzNYmSi.js");return{diagram:t}},__vite__mapDeps([9,10,8,11,12,13,3,4]));return{id:om,diagram:e}},"loader"),I_={id:om,detector:$_,loader:O_},D_=I_,sm="timeline",R_=p(e=>/^\s*timeline/.test(e),"detector"),P_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./timeline-definition-PNZ67QCA-DRsCTcc3.js");return{diagram:t}},__vite__mapDeps([38,25,3,4]));return{id:sm,diagram:e}},"loader"),N_={id:sm,detector:R_,loader:P_},q_=N_,am="mindmap",W_=p(e=>/^\s*mindmap/.test(e),"detector"),z_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./mindmap-definition-RKZ34NQL-B2x0JCB3.js");return{diagram:t}},__vite__mapDeps([39,11,12,3,4]));return{id:am,diagram:e}},"loader"),H_={id:am,detector:W_,loader:z_},Y_=H_,nm="kanban",U_=p(e=>/^\s*kanban/.test(e),"detector"),j_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./kanban-definition-UN3LZRKU-Dh0udSeO.js");return{diagram:t}},__vite__mapDeps([40,10,3,4]));return{id:nm,diagram:e}},"loader"),G_={id:nm,detector:U_,loader:j_},X_=G_,lm="sankey",V_=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Z_=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./sankeyDiagram-5OEKKPKP-DBhf2qeh.js");return{diagram:t}},__vite__mapDeps([41,26,21,3,4]));return{id:lm,diagram:e}},"loader"),K_={id:lm,detector:V_,loader:Z_},Q_=K_,hm="packet",J_=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),tv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-LMA3HP47-WWKSVuAU.js");return{diagram:t}},__vite__mapDeps([42,16,18,3,4]));return{id:hm,diagram:e}},"loader"),ev={id:hm,detector:J_,loader:tv},cm="radar",rv=p(e=>/^\s*radar-beta/.test(e),"detector"),iv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-2AECGRRQ-BSy9xCZO.js");return{diagram:t}},__vite__mapDeps([43,16,18,3,4]));return{id:cm,diagram:e}},"loader"),ov={id:cm,detector:rv,loader:iv},dm="block",sv=p(e=>/^\s*block(-beta)?/.test(e),"detector"),av=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./blockDiagram-GPEHLZMM-CilEmNW0.js");return{diagram:t}},__vite__mapDeps([44,10,1,13,3,4]));return{id:dm,diagram:e}},"loader"),nv={id:dm,detector:sv,loader:av},lv=nv,um="treeView",hv=p(e=>/^\s*treeView-beta/.test(e),"detector"),cv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-5GNKFQAL-BsckzYNE.js");return{diagram:t}},__vite__mapDeps([45,16,17,18,3,4]));return{id:um,diagram:e}},"loader"),dv={id:um,detector:hv,loader:cv},uv=dv,fm="architecture",fv=p(e=>/^\s*architecture/.test(e),"detector"),pv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./architectureDiagram-3BPJPVTR-bSps5znF.js");return{diagram:t}},__vite__mapDeps([46,16,18,3,4,6]));return{id:fm,diagram:e}},"loader"),gv={id:fm,detector:fv,loader:pv},mv=gv,pm="eventmodeling",yv=p(e=>/^\s*eventmodeling/.test(e),"detector"),Cv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-KO2AKTUF-C4GWXOE2.js");return{diagram:t}},__vite__mapDeps([47,16,18,3,4]));return{id:pm,diagram:e}},"loader"),xv={id:pm,detector:yv,loader:Cv},bv=xv,gm="ishikawa",kv=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Tv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-YF4QCWOH-O5IEMrWO.js");return{diagram:t}},__vite__mapDeps([48,3,4]));return{id:gm,diagram:e}},"loader"),wv={id:gm,detector:kv,loader:Tv},mm="venn",Sv=p(e=>/^\s*venn-beta/.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./vennDiagram-CIIHVFJN-B95s0NJK.js");return{diagram:t}},__vite__mapDeps([49,3,4]));return{id:mm,diagram:e}},"loader"),vv={id:mm,detector:Sv,loader:_v},Bv=vv,ym="treemap",Lv=p(e=>/^\s*treemap/.test(e),"detector"),Fv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./diagram-OG6HWLK6-B6TtcB01.js");return{diagram:t}},__vite__mapDeps([50,12,16,18,3,4,22,26,21]));return{id:ym,diagram:e}},"loader"),Av={id:ym,detector:Lv,loader:Fv},Cm="wardley-beta",Ev=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Mv=p(async()=>{const{diagram:e}=await pt(async()=>{const{diagram:t}=await import("./wardleyDiagram-YWT4CUSO-CnvLrs5Q.js");return{diagram:t}},__vite__mapDeps([51,16,18,3,4]));return{id:Cm,diagram:e}},"loader"),$v={id:Cm,detector:Ev,loader:Mv},Ov=$v,nc=!1,Fs=p(()=>{nc||(nc=!0,Po("error",M_,e=>e.toLowerCase().trim()==="error"),Po("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ha(D_,Y_,mv),ha(bS,X_,m_,u_,MS,qS,HS,jS,o_,l_,LS,SS,q_,DS,S_,b_,L_,ZS,Q_,ev,t_,lv,bv,uv,ov,wv,Av,Bv,Ov))},"addDiagrams"),Iv=p(async()=>{N.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Cr).map(async([r,{detector:i,loader:o}])=>{if(o)try{pa(r)}catch{try{const{diagram:s,id:a}=await o();Po(a,s,i)}catch(s){throw N.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Cr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){N.error(`Failed to load ${t.length} external diagrams`);for(const r of t)N.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Dv="graphics-document document";function xm(e,t){e.attr("role",Dv),t!==""&&e.attr("aria-roledescription",t)}p(xm,"setA11yDiagramInfo");function bm(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(bm,"addSVGa11yTitleDescription");var an=class km{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{p(this,"Diagram")}static async fromText(t,r={}){const i=vt(),o=hn(t,i);t=p2(t)+` +`;try{pa(o)}catch{const c=Ay(o);if(!c)throw new Cc(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();Po(h,d)}const{db:s,parser:a,renderer:n,init:l}=pa(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new km(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},lc=[],Rv=p(()=>{lc.forEach(e=>{e()}),lc=[]},"attachFunctions"),Pv=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Tm(e){const t=e.match(yc);if(!t)return{text:e,metadata:{}};let r=y1(t[1],{schema:m1})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}p(Tm,"extractFrontMatter");var Nv=p(e=>e.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),qv=p(e=>{const{text:t,metadata:r}=Tm(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),Wv=p(e=>{const t=ge.detectInit(e)??{},r=ge.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:e2(e),directive:t}},"processDirectives");function ll(e){const t=Nv(e),r=qv(t),i=Wv(r.text),o=Yn(r.config,i.directive);return e=Pv(i.text),{code:e,title:r.title,config:o}}p(ll,"preprocessDiagram");function wm(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(wm,"toBase64");var zv=5e4,Hv="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Yv="sandbox",Uv="loose",jv="http://www.w3.org/2000/svg",Gv="http://www.w3.org/1999/xlink",Xv="http://www.w3.org/1999/xhtml",Vv="100%",Zv="100%",Kv="border:0;margin:0;",Qv="margin:0",Jv="allow-top-navigation-by-user-activation allow-popups",tB='The "iframe" tag is not supported by your browser.',eB=["foreignobject"],rB=["dominant-baseline"];function hl(e){const t=ll(e);return Do(),i0(t.config??{}),t}p(hl,"processAndSetConfigs");async function Sm(e,t){Fs();try{const{code:r,config:i}=hl(e);return{diagramType:(await vm(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(Sm,"parse");var hc=p((e,t,r=[])=>{const i=wc(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),iB=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=Kt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{wh(l.styles)||n.forEach(c=>{r.insertRule(hc(l.id,c,l.styles),r.cssRules.length)}),wh(l.textStyles)||r.insertRule(hc(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=fa(o)+` +`}else i+=`${e.themeCSS} +`;return i+fa(r)},"createCssStyles"),oB=p((e,t)=>sn(fS(`${e}{${t}}`),mS([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===en)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[Jw,eS,Dg,iS,"@container","@starting-style"],en].includes(i.type)||(N.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=al))},"addNamespace"),gS])),"compileCSS"),sB=p((e,t,r,i)=>{const o=iB(e,r),s=T0(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return oB(i,s)},"createUserStyles"),aB=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Tr(i),i=i.replace(/
      /g,"
      "),i},"cleanUpSvgCode"),nB=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Zv,i=wm(`${e}`);return``},"putIntoIFrame"),cc=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",jv);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function nn(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(nn,"sandboxedIframe");var lB=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),hB=p(async function(e,t,r){Fs();const i=hl(t);t=i.code;const o=vt();N.debug(o),t.length>(o?.maxTextSize??zv)&&(t=Hv);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const W=ht(f?n:c).node();W&&"remove"in W&&W.remove()},"removeTempElements");let d=ht(document.body);const f=o.securityLevel===Yv,u=o.securityLevel===Uv,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const H=nn(ht(r),a);d=ht(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ht(r);cc(d,e,l,`font-family: ${g}`,Gv)}else{if(lB(document,e,l,a),f){const H=nn(ht(document.body),a);d=ht(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ht("body");cc(d,e,l)}let m,y;try{m=await an.fromText(t,{title:i.title})}catch(H){if(o.suppressErrorRendering)throw h(),H;m=await an.fromText("error"),y=H}const C=d.select(c).node(),b=m.type,k=C.firstChild,w=k.firstChild,S=m.renderer.getClasses?.(t,m),_=sB(o,b,S,s),E=document.createElement("style");E.innerHTML=_,k.insertBefore(E,w);try{await m.renderer.draw(t,e,"11.15.0",m)}catch(H){throw o.suppressErrorRendering?h():A_.draw(t,e,"11.15.0"),H}const B=d.select(`${c} svg`),q=m.db.getAccTitle?.(),I=m.db.getAccDescription?.();Bm(b,B,q,I),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Xv);let R=d.select(c).node().innerHTML;if(N.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),R=aB(R,f,je(o.arrowMarkerAbsolute)),f){const H=d.select(c+" svg").node();R=nB(R,H)}else u||(R=Gr.sanitize(R,{ADD_TAGS:eB,ADD_ATTR:rB,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Rv(),y)throw y;return h(),{diagramType:b,svg:R,bindFunctions:m.db.bindFunctions}},"render");function _m(e={}){const t=Ot({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),e0(t),t?.theme&&t.theme in We?t.themeVariables=We[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=We.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?t0(t):Sc();ln(r.logLevel),Fs()}p(_m,"initialize");var vm=p((e,t={})=>{const{code:r}=ll(e);return an.fromText(r,t)},"getDiagramFromText");function Bm(e,t,r,i){xm(t,e),bm(t,r,i,t.attr("id"))}p(Bm,"addA11yInfo");var Sr=Object.freeze({render:hB,parse:Sm,getDiagramFromText:vm,initialize:_m,getConfig:vt,setConfig:_c,getSiteConfig:Sc,updateSiteConfig:r0,reset:p(()=>{Do()},"reset"),globalReset:p(()=>{Do(Xr)},"globalReset"),defaultConfig:Xr});ln(vt().logLevel);Do(vt());var cB=p((e,t,r)=>{N.warn(e),Hn(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Lm=p(async function(e={querySelector:".mermaid"}){try{await dB(e)}catch(t){if(Hn(t)&&N.error(t.str),Ue.parseError&&Ue.parseError(t),!e.suppressErrors)throw N.error("Use the suppressErrors option to suppress these errors"),t}},"run"),dB=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Sr.getConfig();N.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");N.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(N.debug("Start On Load: "+i?.startOnLoad),Sr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new ge.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(N.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Wf(ge.entityDecode(a)).trim().replace(//gi,"
      ");const h=ge.detectInit(a);h&&N.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Mm(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){cB(d,n,Ue.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Fm=p(function(e){Sr.initialize(e)},"initialize"),uB=p(async function(e,t,r){N.warn("mermaid.init is deprecated. Please use run instead."),e&&Fm(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Lm(i)},"init"),fB=p(async(e,{lazyLoad:t=!0}={})=>{Fs(),ha(...e),t===!1&&await Iv()},"registerExternalDiagrams"),Am=p(function(){if(Ue.startOnLoad){const{startOnLoad:e}=Sr.getConfig();e&&Ue.run().catch(t=>N.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Am,!1);var pB=p(function(e){Ue.parseError=e},"setParseErrorHandler"),cs=[],aa=!1,Em=p(async()=>{if(!aa){for(aa=!0;cs.length>0;){const e=cs.shift();if(e)try{await e()}catch(t){N.error("Error executing queue",t)}}aa=!1}},"executeQueue"),gB=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Sr.parse(e,t).then(n=>{s(n),r(n)},n=>{N.error("Error parsing",n),Ue.parseError?.(n),a(n),i(n)})}),"performCall");cs.push(o),Em().catch(i)}),"parse"),Mm=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Sr.render(e,t,r).then(l=>{a(l),i(l)},l=>{N.error("Error parsing",l),Ue.parseError?.(l),n(l),o(l)})}),"performCall");cs.push(s),Em().catch(o)}),"render"),mB=p(()=>Object.keys(Cr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ue={startOnLoad:!0,mermaidAPI:Sr,parse:gB,render:Mm,init:uB,run:Lm,registerExternalDiagrams:fB,registerLayoutLoaders:$g,initialize:Fm,parseError:void 0,contentLoaded:Am,setParseErrorHandler:pB,detectType:hn,registerIconPacks:kT,getRegisteredDiagramsMetadata:mB},yB=Ue;/*! Check if previously processed *//*! + * Wait for document loaded before starting the execution + */const GB=Object.freeze(Object.defineProperty({__proto__:null,default:yB},Symbol.toStringTag,{value:"Module"}));export{dh as $,TB as A,tr as B,Um as C,vt as D,E0 as E,Yn as F,Tc as G,a2 as H,ck as I,m1 as J,Dy as K,$i as L,bB as M,bs as N,d0 as O,Mc as P,Ul as Q,Ui as R,Ae as S,Kb as T,at as U,Tn as V,vB as W,FB as X,Ir as Y,K1 as Z,p as _,_0 as a,_w as a$,ch as a0,EB as a1,AB as a2,LB as a3,SB as a4,_B as a5,BB as a6,$B as a7,MB as a8,ek as a9,v1 as aA,P1 as aB,R1 as aC,D1 as aD,q1 as aE,N1 as aF,_1 as aG,gf as aH,E1 as aI,F1 as aJ,L1 as aK,mf as aL,C1 as aM,Kt as aN,Ge as aO,ui as aP,Un as aQ,wf as aR,Tr as aS,Bf as aT,fc as aU,Zw as aV,zB as aW,YB as aX,qB as aY,K as aZ,WB as a_,Sa as aa,s2 as ab,xe as ac,$ as ad,O as ae,x0 as af,Oc as ag,XT as ah,Fg as ai,HB as aj,zn as ak,X as al,wT as am,Rn as an,In as ao,Lo as ap,I1 as aq,O1 as ar,$1 as as,M1 as at,S1 as au,ff as av,B1 as aw,w1 as ax,A1 as ay,pf as az,S0 as b,bw as b0,xw as b1,Qb as b2,xB as b3,qm as b4,Qi as b5,kT as b6,bT as b7,Cn as b8,Ke as b9,Di as ba,oh as bb,Ex as bc,Z as bd,Lf as be,ee as bf,Sx as bg,yn as bh,Xc as bi,Xi as bj,Kc as bk,wB as bl,Ym as bm,GB as bn,yt as c,ht as d,$c as e,Ot as f,B0 as g,Ye as h,Ce as i,k1 as j,ji as k,N as l,_f as m,kB as n,jB as o,L0 as p,F0 as q,UB as r,v0 as s,y1 as t,ge as u,pw as v,h2 as w,OB as x,Gr as y,w0 as z}; diff --git a/apps/kimi-code/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js b/apps/kimi-code/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js new file mode 100644 index 0000000000..45e015c6b1 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js @@ -0,0 +1,313 @@ +function Ym(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bo={exports:{}},Um=bo.exports,Ml;function jm(){return Ml||(Ml=1,(function(e,t){(function(r,i){e.exports=i()})(Um,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",u="month",f="quarter",d="year",g="date",m="Invalid Date",y=/^(\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,b={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(F){var A=["th","st","nd","rd"],L=F%100;return"["+F+(A[(L-20)%10]||A[L]||A[0])+"]"}},k=function(F,A,L){var E=String(F);return!E||E.length>=A?F:""+Array(A+1-E.length).join(L)+F},T={s:k,z:function(F){var A=-F.utcOffset(),L=Math.abs(A),E=Math.floor(L/60),D=L%60;return(A<=0?"+":"-")+k(E,2,"0")+":"+k(D,2,"0")},m:function F(A,L){if(A.date()1)return F(Y[0])}else{var lt=A.name;_[lt]=A,D=lt}return!E&&D&&(S=D),D||!E&&S},I=function(F,A){if(v(F))return F.clone();var L=typeof A=="object"?A:{};return L.date=F,L.args=arguments,new H(L)},R=T;R.l=q,R.i=v,R.w=function(F,A){return I(F,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var H=(function(){function F(L){this.$L=q(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[M]=!0}var A=F.prototype;return A.parse=function(L){this.$d=(function(E){var D=E.date,z=E.utc;if(D===null)return new Date(NaN);if(R.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var Y=D.match(y);if(Y){var lt=Y[2]-1||0,pt=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],lt,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pt)):new Date(Y[1],lt,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,pt)}}return new Date(D)})(L),this.init()},A.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},A.$utils=function(){return R},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(L,E){var D=I(L);return this.startOf(E)<=D&&D<=this.endOf(E)},A.isAfter=function(L,E){return I(L)pc(e,"name",{value:t,configurable:!0}),Vm=(e,t)=>{for(var r in t)pc(e,r,{get:t[r],enumerable:!0})},De={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},N={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},cn=p(function(e="fatal"){let t=De.fatal;typeof e=="string"?e.toLowerCase()in De&&(t=De[e]):typeof e=="number"&&(t=e),N.trace=()=>{},N.debug=()=>{},N.info=()=>{},N.warn=()=>{},N.error=()=>{},N.fatal=()=>{},t<=De.fatal&&(N.fatal=console.error?console.error.bind(console,oe("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",oe("FATAL"))),t<=De.error&&(N.error=console.error?console.error.bind(console,oe("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",oe("ERROR"))),t<=De.warn&&(N.warn=console.warn?console.warn.bind(console,oe("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",oe("WARN"))),t<=De.info&&(N.info=console.info?console.info.bind(console,oe("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",oe("INFO"))),t<=De.debug&&(N.debug=console.debug?console.debug.bind(console,oe("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("DEBUG"))),t<=De.trace&&(N.trace=console.debug?console.debug.bind(console,oe("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("TRACE")))},"setLogLevel"),oe=p(e=>`%c${Xm().format("ss.SSS")} : ${e} : `,"format");const ko={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 o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return ko.hue2rgb(s,o,e+1/3)*255;case"g":return ko.hue2rgb(s,o,e)*255;case"b":return ko.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){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},Km={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},at={channel:ko,lang:Zm,unit:Km},Ve={};for(let e=0;e<=255;e++)Ve[e]=at.unit.dec2hex(e);const Wt={ALL:0,RGB:1,HSL:2};class Qm{constructor(){this.type=Wt.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=Wt.ALL}is(t){return this.type===t}}class Jm{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Qm}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Wt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=at.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=at.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=at.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=at.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=at.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=at.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Wt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Wt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Wt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Wt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Wt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Wt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Wt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Wt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Wt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Wt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Wt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Wt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const us=new Jm({r:0,g:0,b:0,a:0},"transparent"),Hr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Hr.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return us.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Ve[Math.round(t)]}${Ve[Math.round(r)]}${Ve[Math.round(i)]}${Ve[Math.round(o*255)]}`:`#${Ve[Math.round(t)]}${Ve[Math.round(r)]}${Ve[Math.round(i)]}`}},dr={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(dr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return at.channel.clamp.h(parseFloat(r)*.9);case"rad":return at.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return at.channel.clamp.h(parseFloat(r)*360)}}return at.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(dr.re);if(!r)return;const[,i,o,s,a,n]=r;return us.set({h:dr._hue2deg(i),s:at.channel.clamp.s(parseFloat(o)),l:at.channel.clamp.l(parseFloat(s)),a:a?at.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%, ${o})`:`hsl(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%)`}},Bi={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=Bi.colors[e];if(t)return Hr.parse(t)},stringify:e=>{const t=Hr.stringify(e);for(const r in Bi.colors)if(Bi.colors[r]===t)return r}},yi={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(yi.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return us.set({r:at.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:at.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:at.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?at.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)}, ${at.lang.round(o)})`:`rgb(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)})`}},Fe={format:{keyword:Bi,hex:Hr,rgb:yi,rgba:yi,hsl:dr,hsla:dr},parse:e=>{if(typeof e!="string")return e;const t=Hr.parse(e)||yi.parse(e)||dr.parse(e)||Bi.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Wt.HSL)||e.data.r===void 0?dr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?yi.stringify(e):Hr.stringify(e)},gc=(e,t)=>{const r=Fe.parse(e);for(const i in t)r[i]=at.channel.clamp[i](t[i]);return Fe.stringify(r)},Je=(e,t,r=0,i=1)=>{if(typeof e!="number")return gc(e,{a:t});const o=us.set({r:at.channel.clamp.r(e),g:at.channel.clamp.g(t),b:at.channel.clamp.b(r),a:at.channel.clamp.a(i)});return Fe.stringify(o)},ty=e=>{const{r:t,g:r,b:i}=Fe.parse(e),o=.2126*at.channel.toLinear(t)+.7152*at.channel.toLinear(r)+.0722*at.channel.toLinear(i);return at.lang.round(o)},ey=e=>ty(e)>=.5,Ce=e=>!ey(e),mc=(e,t,r)=>{const i=Fe.parse(e),o=i[t],s=at.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Fe.stringify(i)},$=(e,t)=>mc(e,"l",t),O=(e,t)=>mc(e,"l",-t),x=(e,t)=>{const r=Fe.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return gc(e,i)},ry=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Fe.parse(e),{r:n,g:l,b:c,a:h}=Fe.parse(t),u=r/100,f=u*2-1,d=a-h,m=((f*d===-1?f:(f+d)/(1+f*d))+1)/2,y=1-m,C=i*m+n*y,b=o*m+l*y,k=s*m+c*y,T=a*u+h*(1-u);return Je(C,b,k,T)},B=(e,t=100)=>{const r=Fe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,ry(r,e,t)};/*! @license DOMPurify 3.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.7/LICENSE */function El(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r2?i-2:0),s=2;s1?r-1:0),o=1;o"u"?null:Mt(BigInt.prototype.toString),Pl=typeof Symbol>"u"?null:Mt(Symbol.prototype.toString),vt=Mt(Object.prototype.hasOwnProperty),li=Mt(Object.prototype.toString),Rt=Mt(RegExp.prototype.test),hi=my(TypeError);function Mt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ci;if($l&&$l(e,null),!jt(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){const s=r(o);s!==o&&(ly(t)||(t[i]=s),o=s)}e[o]=!0}return e}function yy(e){for(let t=0;t/g),Sy=se(/\${[\w\W]*/g),_y=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),By=se(/^aria-[\-\w]+$/),Hl=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vy=se(/^(?:\w+script|data):/i),Ly=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fy=se(/^html$/i),Ay=se(/^[a-z][.\w]*(-[.\w]+)+$/i),Te={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},My=function(){return typeof window>"u"?null:window},Ey=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(i=r.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Yl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function xc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:My();const t=Q=>xc(Q);if(t.version="3.4.7",t.removed=[],!e||!e.document||e.document.nodeType!==Te.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const i=r,o=i.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,n=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,u=e.trustedTypes,f=n.prototype,d=Se(f,"cloneNode"),g=Se(f,"remove"),m=Se(f,"nextSibling"),y=Se(f,"childNodes"),C=Se(f,"parentNode"),b=Se(f,"shadowRoot"),k=Se(f,"attributes"),T=a&&a.prototype?Se(a.prototype,"nodeType"):null,S=a&&a.prototype?Se(a.prototype,"nodeName"):null;if(typeof s=="function"){const Q=r.createElement("template");Q.content&&Q.content.ownerDocument&&(r=Q.content.ownerDocument)}let _,M="";const v=r,q=v.implementation,I=v.createNodeIterator,R=v.createDocumentFragment,H=v.getElementsByTagName,W=i.importNode;let F=Yl();t.isSupported=typeof yc=="function"&&typeof C=="function"&&q&&q.createHTMLDocument!==void 0;const A=wy,L=Ty,E=Sy,D=_y,z=By,Y=vy,lt=Ly,pt=Ay;let ut=Hl,tt=null;const gt=nt({},[...Nl,...zs,...Hs,...Ys,...ql]);let G=null;const ct=nt({},[...Wl,...Us,...zl,...ao]);let st=Object.seal(Rr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bt=null,kt=null;const wt=Object.seal(Rr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ne=!0,Oe=!0,_r=!1,dl=!0,Xe=!1,oi=!0,ar=!1,As=!1,Ms=!1,Br=!1,Ji=!1,to=!1,fl=!0,pl=!1;const gl="user-content-";let Es=!0,si=!1,vr={},be=null;const $s=nt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ml=null;const yl=nt({},["audio","video","img","source","image","track"]);let Os=null;const Cl=nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eo="http://www.w3.org/1998/Math/MathML",ro="http://www.w3.org/2000/svg",ke="http://www.w3.org/1999/xhtml";let Lr=ke,Is=!1,Ds=null;const Rm=nt({},[eo,ro,ke],Ws);let Rs=nt({},["mi","mo","mn","ms","mtext"]),Ps=nt({},["annotation-xml"]);const Pm=nt({},["title","style","font","a","script"]);let ai=null;const Nm=["application/xhtml+xml","text/html"],qm="text/html";let Lt=null,Fr=null;const Wm=r.createElement("form"),xl=function(w){return w instanceof RegExp||w instanceof Function},Ns=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fr&&Fr===w)return;(!w||typeof w!="object")&&(w={}),w=qt(w),ai=Nm.indexOf(w.PARSER_MEDIA_TYPE)===-1?qm:w.PARSER_MEDIA_TYPE,Lt=ai==="application/xhtml+xml"?Ws:Ci,tt=vt(w,"ALLOWED_TAGS")&&jt(w.ALLOWED_TAGS)?nt({},w.ALLOWED_TAGS,Lt):gt,G=vt(w,"ALLOWED_ATTR")&&jt(w.ALLOWED_ATTR)?nt({},w.ALLOWED_ATTR,Lt):ct,Ds=vt(w,"ALLOWED_NAMESPACES")&&jt(w.ALLOWED_NAMESPACES)?nt({},w.ALLOWED_NAMESPACES,Ws):Rm,Os=vt(w,"ADD_URI_SAFE_ATTR")&&jt(w.ADD_URI_SAFE_ATTR)?nt(qt(Cl),w.ADD_URI_SAFE_ATTR,Lt):Cl,ml=vt(w,"ADD_DATA_URI_TAGS")&&jt(w.ADD_DATA_URI_TAGS)?nt(qt(yl),w.ADD_DATA_URI_TAGS,Lt):yl,be=vt(w,"FORBID_CONTENTS")&&jt(w.FORBID_CONTENTS)?nt({},w.FORBID_CONTENTS,Lt):$s,bt=vt(w,"FORBID_TAGS")&&jt(w.FORBID_TAGS)?nt({},w.FORBID_TAGS,Lt):qt({}),kt=vt(w,"FORBID_ATTR")&&jt(w.FORBID_ATTR)?nt({},w.FORBID_ATTR,Lt):qt({}),vr=vt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?qt(w.USE_PROFILES):w.USE_PROFILES:!1,ne=w.ALLOW_ARIA_ATTR!==!1,Oe=w.ALLOW_DATA_ATTR!==!1,_r=w.ALLOW_UNKNOWN_PROTOCOLS||!1,dl=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=w.SAFE_FOR_TEMPLATES||!1,oi=w.SAFE_FOR_XML!==!1,ar=w.WHOLE_DOCUMENT||!1,Br=w.RETURN_DOM||!1,Ji=w.RETURN_DOM_FRAGMENT||!1,to=w.RETURN_TRUSTED_TYPE||!1,Ms=w.FORCE_BODY||!1,fl=w.SANITIZE_DOM!==!1,pl=w.SANITIZE_NAMED_PROPS||!1,Es=w.KEEP_CONTENT!==!1,si=w.IN_PLACE||!1,ut=xy(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:Hl,Lr=typeof w.NAMESPACE=="string"?w.NAMESPACE:ke,Rs=vt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?qt(w.MATHML_TEXT_INTEGRATION_POINTS):nt({},["mi","mo","mn","ms","mtext"]),Ps=vt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?qt(w.HTML_INTEGRATION_POINTS):nt({},["annotation-xml"]);const P=vt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?qt(w.CUSTOM_ELEMENT_HANDLING):Rr(null);if(st=Rr(null),vt(P,"tagNameCheck")&&xl(P.tagNameCheck)&&(st.tagNameCheck=P.tagNameCheck),vt(P,"attributeNameCheck")&&xl(P.attributeNameCheck)&&(st.attributeNameCheck=P.attributeNameCheck),vt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),Xe&&(Oe=!1),Ji&&(Br=!0),vr&&(tt=nt({},ql),G=Rr(null),vr.html===!0&&(nt(tt,Nl),nt(G,Wl)),vr.svg===!0&&(nt(tt,zs),nt(G,Us),nt(G,ao)),vr.svgFilters===!0&&(nt(tt,Hs),nt(G,Us),nt(G,ao)),vr.mathMl===!0&&(nt(tt,Ys),nt(G,zl),nt(G,ao))),wt.tagCheck=null,wt.attributeCheck=null,vt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?wt.tagCheck=w.ADD_TAGS:jt(w.ADD_TAGS)&&(tt===gt&&(tt=qt(tt)),nt(tt,w.ADD_TAGS,Lt))),vt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?wt.attributeCheck=w.ADD_ATTR:jt(w.ADD_ATTR)&&(G===ct&&(G=qt(G)),nt(G,w.ADD_ATTR,Lt))),vt(w,"ADD_URI_SAFE_ATTR")&&jt(w.ADD_URI_SAFE_ATTR)&&nt(Os,w.ADD_URI_SAFE_ATTR,Lt),vt(w,"FORBID_CONTENTS")&&jt(w.FORBID_CONTENTS)&&(be===$s&&(be=qt(be)),nt(be,w.FORBID_CONTENTS,Lt)),vt(w,"ADD_FORBID_CONTENTS")&&jt(w.ADD_FORBID_CONTENTS)&&(be===$s&&(be=qt(be)),nt(be,w.ADD_FORBID_CONTENTS,Lt)),Es&&(tt["#text"]=!0),ar&&nt(tt,["html","head","body"]),tt.table&&(nt(tt,["tbody"]),delete bt.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw hi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,M=_.createHTML("")}else _===void 0&&(_=Ey(u,o)),_!==null&&typeof M=="string"&&(M=_.createHTML(""));(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&tt===gt&&(tt=qt(tt)),F.uponSanitizeAttribute.length>0&&G===ct&&(G=qt(G)),Vt&&Vt(w),Fr=w},bl=nt({},[...zs,...Hs,...by]),kl=nt({},[...Ys,...ky]),zm=function(w){let P=C(w);(!P||!P.tagName)&&(P={namespaceURI:Lr,tagName:"template"});const U=Ci(w.tagName),Ct=Ci(P.tagName);return Ds[w.namespaceURI]?w.namespaceURI===ro?P.namespaceURI===ke?U==="svg":P.namespaceURI===eo?U==="svg"&&(Ct==="annotation-xml"||Rs[Ct]):!!bl[U]:w.namespaceURI===eo?P.namespaceURI===ke?U==="math":P.namespaceURI===ro?U==="math"&&Ps[Ct]:!!kl[U]:w.namespaceURI===ke?P.namespaceURI===ro&&!Ps[Ct]||P.namespaceURI===eo&&!Rs[Ct]?!1:!kl[U]&&(Pm[U]||!bl[U]):!!(ai==="application/xhtml+xml"&&Ds[w.namespaceURI]):!1},le=function(w){Er(t.removed,{element:w});try{C(w).removeChild(w)}catch{g(w)}},nr=function(w,P){try{Er(t.removed,{attribute:P.getAttributeNode(w),from:P})}catch{Er(t.removed,{attribute:null,from:P})}if(P.removeAttribute(w),w==="is")if(Br||Ji)try{le(P)}catch{}else try{P.setAttribute(w,"")}catch{}},wl=function(w){let P=null,U=null;if(Ms)w=""+w;else{const Tt=Il(w,/^[\r\n\t ]+/);U=Tt&&Tt[0]}ai==="application/xhtml+xml"&&Lr===ke&&(w=''+w+"");const Ct=_?_.createHTML(w):w;if(Lr===ke)try{P=new h().parseFromString(Ct,ai)}catch{}if(!P||!P.documentElement){P=q.createDocument(Lr,"template",null);try{P.documentElement.innerHTML=Is?M:Ct}catch{}}const dt=P.body||P.documentElement;return w&&U&&dt.insertBefore(r.createTextNode(U),dt.childNodes[0]||null),Lr===ke?H.call(P,ar?"html":"body")[0]:ar?P.documentElement:dt},Tl=function(w){return I.call(w.ownerDocument||w,w,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Sl=function(w){w.normalize();const P=I.call(w.ownerDocument||w,w,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let U=P.nextNode();for(;U;){let Ct=U.data;Mr([A,L,E],dt=>{Ct=$r(Ct,dt," ")}),U.data=Ct,U=P.nextNode()}},io=function(w){const P=S?S(w):null;return typeof P!="string"||Lt(P)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==k(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==T(w)||w.childNodes!==y(w)},ni=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return T(w)===Te.documentFragment}catch{return!1}},oo=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return typeof T(w)=="number"}catch{return!1}};function Ie(Q,w,P){Mr(Q,U=>{U.call(t,w,P,Fr)})}const _l=function(w){let P=null;if(Ie(F.beforeSanitizeElements,w,null),io(w))return le(w),!0;const U=Lt(w.nodeName);if(Ie(F.uponSanitizeElement,w,{tagName:U,allowedTags:tt}),oi&&w.hasChildNodes()&&!oo(w.firstElementChild)&&Rt(/<[/\w!]/g,w.innerHTML)&&Rt(/<[/\w!]/g,w.textContent)||oi&&w.namespaceURI===ke&&U==="style"&&oo(w.firstElementChild)||w.nodeType===Te.progressingInstruction||oi&&w.nodeType===Te.comment&&Rt(/<[/\w]/g,w.data))return le(w),!0;if(bt[U]||!(wt.tagCheck instanceof Function&&wt.tagCheck(U))&&!tt[U]){if(!bt[U]&&vl(U)&&(st.tagNameCheck instanceof RegExp&&Rt(st.tagNameCheck,U)||st.tagNameCheck instanceof Function&&st.tagNameCheck(U)))return!1;if(Es&&!be[U]){const dt=C(w),Tt=y(w);if(Tt&&dt){const ie=Tt.length;for(let we=ie-1;we>=0;--we){const he=d(Tt[we],!0);dt.insertBefore(he,m(w))}}}return le(w),!0}return(T?T(w):w.nodeType)===Te.element&&!zm(w)||(U==="noscript"||U==="noembed"||U==="noframes")&&Rt(/<\/no(script|embed|frames)/i,w.innerHTML)?(le(w),!0):(Xe&&w.nodeType===Te.text&&(P=w.textContent,Mr([A,L,E],dt=>{P=$r(P,dt," ")}),w.textContent!==P&&(Er(t.removed,{element:w.cloneNode()}),w.textContent=P)),Ie(F.afterSanitizeElements,w,null),!1)},Bl=function(w,P,U){if(kt[P]||fl&&(P==="id"||P==="name")&&(U in r||U in Wm))return!1;const Ct=G[P]||wt.attributeCheck instanceof Function&&wt.attributeCheck(P,w);if(!(Oe&&!kt[P]&&Rt(D,P))){if(!(ne&&Rt(z,P))){if(!Ct||kt[P]){if(!(vl(w)&&(st.tagNameCheck instanceof RegExp&&Rt(st.tagNameCheck,w)||st.tagNameCheck instanceof Function&&st.tagNameCheck(w))&&(st.attributeNameCheck instanceof RegExp&&Rt(st.attributeNameCheck,P)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(P,w))||P==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&Rt(st.tagNameCheck,U)||st.tagNameCheck instanceof Function&&st.tagNameCheck(U))))return!1}else if(!Os[P]){if(!Rt(ut,$r(U,lt,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&w!=="script"&&Dl(U,"data:")===0&&ml[w])){if(!(_r&&!Rt(Y,$r(U,lt,"")))){if(U)return!1}}}}}}return!0},Hm=nt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vl=function(w){return!Hm[Ci(w)]&&Rt(pt,w)},Ll=function(w){Ie(F.beforeSanitizeAttributes,w,null);const P=w.attributes;if(!P||io(w))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let Ct=P.length;for(;Ct--;){const dt=P[Ct],Tt=dt.name,ie=dt.namespaceURI,we=dt.value,he=Lt(Tt),qs=we;let It=Tt==="value"?qs:fy(qs);if(U.attrName=he,U.attrValue=It,U.keepAttr=!0,U.forceKeepAttr=void 0,Ie(F.uponSanitizeAttribute,w,U),It=U.attrValue,pl&&(he==="id"||he==="name")&&Dl(It,gl)!==0&&(nr(Tt,w),It=gl+It),oi&&Rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){nr(Tt,w);continue}if(he==="attributename"&&Il(It,"href")){nr(Tt,w);continue}if(U.forceKeepAttr)continue;if(!U.keepAttr){nr(Tt,w);continue}if(!dl&&Rt(/\/>/i,It)){nr(Tt,w);continue}Xe&&Mr([A,L,E],Al=>{It=$r(It,Al," ")});const Fl=Lt(w.nodeName);if(!Bl(Fl,he,It)){nr(Tt,w);continue}if(_&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!ie)switch(u.getAttributeType(Fl,he)){case"TrustedHTML":{It=_.createHTML(It);break}case"TrustedScriptURL":{It=_.createScriptURL(It);break}}if(It!==qs)try{ie?w.setAttributeNS(ie,Tt,It):w.setAttribute(Tt,It),io(w)?le(w):Ol(t.removed)}catch{nr(Tt,w)}}Ie(F.afterSanitizeAttributes,w,null)},so=function(w){let P=null;const U=Tl(w);for(Ie(F.beforeSanitizeShadowDOM,w,null);P=U.nextNode();)if(Ie(F.uponSanitizeShadowNode,P,null),_l(P),Ll(P),ni(P.content)&&so(P.content),(T?T(P):P.nodeType)===Te.element){const dt=b?b(P):P.shadowRoot;ni(dt)&&(Ar(dt),so(dt))}Ie(F.afterSanitizeShadowDOM,w,null)},Ar=function(w){const P=T?T(w):w.nodeType;if(P===Te.element){const dt=b?b(w):w.shadowRoot;ni(dt)&&(Ar(dt),so(dt))}const U=y?y(w):w.childNodes;if(!U)return;const Ct=[];Mr(U,dt=>{Er(Ct,dt)});for(const dt of Ct)Ar(dt);if(P===Te.element){const dt=S?S(w):null;if(typeof dt=="string"&&Lt(dt)==="template"){const Tt=w.content;ni(Tt)&&Ar(Tt)}}};return t.sanitize=function(Q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,U=null,Ct=null,dt=null;if(Is=!Q,Is&&(Q=""),typeof Q!="string"&&!oo(Q)&&(Q=Cy(Q),typeof Q!="string"))throw hi("dirty is not a string, aborting");if(!t.isSupported)return Q;if(As||Ns(w),t.removed=[],typeof Q=="string"&&(si=!1),si){const we=S?S(Q):Q.nodeName;if(typeof we=="string"){const he=Lt(we);if(!tt[he]||bt[he])throw hi("root node is forbidden and cannot be sanitized in-place")}if(io(Q))throw hi("root node is clobbered and cannot be sanitized in-place");Ar(Q)}else if(oo(Q))P=wl(""),U=P.ownerDocument.importNode(Q,!0),U.nodeType===Te.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?P=U:P.appendChild(U),Ar(U);else{if(!Br&&!Xe&&!ar&&Q.indexOf("<")===-1)return _&&to?_.createHTML(Q):Q;if(P=wl(Q),!P)return Br?null:to?M:""}P&&Ms&&le(P.firstChild);const Tt=Tl(si?Q:P);for(;Ct=Tt.nextNode();)_l(Ct),Ll(Ct),ni(Ct.content)&&so(Ct.content);if(si)return Xe&&Sl(Q),Q;if(Br){if(Xe&&Sl(P),Ji)for(dt=R.call(P.ownerDocument);P.firstChild;)dt.appendChild(P.firstChild);else dt=P;return(G.shadowroot||G.shadowrootmode)&&(dt=W.call(i,dt,!0)),dt}let ie=ar?P.outerHTML:P.innerHTML;return ar&&tt["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Rt(Fy,P.ownerDocument.doctype.name)&&(ie=" +`+ie),Xe&&Mr([A,L,E],we=>{ie=$r(ie,we," ")}),_&&to?_.createHTML(ie):ie},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ns(Q),As=!0},t.clearConfig=function(){Fr=null,As=!1},t.isValidAttribute=function(Q,w,P){Fr||Ns({});const U=Lt(Q),Ct=Lt(w);return Bl(U,Ct,P)},t.addHook=function(Q,w){typeof w=="function"&&Er(F[Q],w)},t.removeHook=function(Q,w){if(w!==void 0){const P=uy(F[Q],w);return P===-1?void 0:dy(F[Q],P,1)[0]}return Ol(F[Q])},t.removeHooks=function(Q){F[Q]=[]},t.removeAllHooks=function(){F=Yl()},t}var jr=xc(),bc=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,vi=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,$y=/\s*%%.*\n/gm,kc=class extends Error{static{p(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},yr={},un=p(function(e,t){e=e.replace(bc,"").replace(vi,"").replace($y,` +`);for(const[r,{detector:i}]of Object.entries(yr))if(i(e,t))return r;throw new kc(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),ua=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)wc(t,r,i)},"registerLazyLoadedDiagrams"),wc=p((e,t,r)=>{yr[e]&&N.warn(`Detector with key ${e} already exists. Overwriting.`),yr[e]={detector:t,loader:r},N.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),Oy=p(e=>yr[e].loader,"getDiagramLoader"),da=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>da(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=da(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),$t=da,Me="#ffffff",Ee="#f2f2f2",ot=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),Iy=class{static{p(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),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||$(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||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,10)):(this.rowOdd=this.rowOdd||$(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Dy=p(e=>{const t=new Iy;return t.calculate(e),t},"getThemeVariables"),Ry=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Je(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=O("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=O(this.sectionBkgColor,10),this.taskBorderColor=Je(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Je(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||$(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||O(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=$(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=$(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.altSectionBkgColor=this.background,this.taskBkgColor=$(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=B(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=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Py=p(e=>{const t=new Ry;return t.calculate(e),t},"getThemeVariables"),Ny=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ot(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=Je(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||O(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||O(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]})}},qy=p(e=>{const t=new Ny;return t.calculate(e),t},"getThemeVariables"),Wy=class{static{p(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=$("#cde498",10),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(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=O(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.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||O(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||O(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},zy=p(e=>{const t=new Wy;return t.calculate(e),t},"getThemeVariables"),Hy=class{static{p(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=$(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(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||$(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=$(this.contrast,55),this.border2=this.contrast,this.actorBorder=$(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,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]})}},Yy=p(e=>{const t=new Hy;return t.calculate(e),t},"getThemeVariables"),Uy=class{static{p(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=ot(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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||x(e,{h:30}),this.cScale4=this.cScale4||x(e,{h:60}),this.cScale5=this.cScale5||x(e,{h:90}),this.cScale6=this.cScale6||x(e,{h:120}),this.cScale7=this.cScale7||x(e,{h:150}),this.cScale8=this.cScale8||x(e,{h:210,l:150}),this.cScale9=this.cScale9||x(e,{h:270}),this.cScale10=this.cScale10||x(e,{h:300}),this.cScale11=this.cScale11||x(e,{h:330}),this.darkMode)for(let o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},jy=p(e=>{const t=new Uy;return t.calculate(e),t},"getThemeVariables"),Gy=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(B("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=B(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),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||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Xy=p(e=>{const t=new Gy;return t.calculate(e),t},"getThemeVariables"),Vy=class{static{p(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=ot("#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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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 o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Zy=p(e=>{const t=new Vy;return t.calculate(e),t},"getThemeVariables"),Ky=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(B("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=B(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),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||$(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Qy=p(e=>{const t=new Ky;return t.calculate(e),t},"getThemeVariables"),Jy=class{static{p(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=ot(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor);const e="#ECECFE",t="#E9E9F1",r=x(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||$(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 o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},t0=p(e=>{const t=new Jy;return t.calculate(e),t},"getThemeVariables"),e0=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=$(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ot(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=$(B("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=B(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||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?O(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||O(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),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||$(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]})}},r0=p(e=>{const t=new e0;return t.calculate(e),t},"getThemeVariables"),qe={base:{getThemeVariables:Dy},dark:{getThemeVariables:Py},default:{getThemeVariables:qy},forest:{getThemeVariables:zy},neutral:{getThemeVariables:Yy},neo:{getThemeVariables:jy},"neo-dark":{getThemeVariables:Xy},redux:{getThemeVariables:Zy},"redux-dark":{getThemeVariables:Qy},"redux-color":{getThemeVariables:t0},"redux-dark-color":{getThemeVariables:r0}},Ut={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},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},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,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},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},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},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500},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},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},Tc={...Ut,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:qe.default.getThemeVariables(),sequence:{...Ut.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Ut.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ut.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ut.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ut.pie,useWidth:984},xyChart:{...Ut.xyChart,useWidth:void 0},requirement:{...Ut.requirement,useWidth:void 0},packet:{...Ut.packet},eventmodeling:{...Ut.eventmodeling},treeView:{...Ut.treeView,useWidth:void 0},radar:{...Ut.radar},ishikawa:{...Ut.ishikawa},sankey:{...Ut.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:{...Ut.venn}},Sc=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Sc(e[i],"")]:[...r,t+i],[]),"keyify"),i0=new Set(Sc(Tc,"")),_c=Tc,Oo=p(e=>{if(N.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Oo(t));return}for(const t of Object.keys(e)){if(N.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!i0.has(t)||e[t]==null){N.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){if(t==="nodeColors"){const i=/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i;for(const o of Object.keys(e[t]))(typeof e[t][o]!="string"||!i.test(e[t][o]))&&(N.debug("sanitize deleting invalid color:",o,e[t][o]),delete e[t][o])}else N.debug("sanitizing object",t),Oo(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(N.debug("sanitizing css option",t),e[t]=Bc(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]="")}N.debug("After sanitization",e)}},"sanitizeDirective"),Bc=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Qt=$t({},Gr),Io,Cr=[],Li=$t({},Gr),ds=p((e,t)=>{let r=$t({},e),i={};for(const o of t)Fc(o),i=$t(i,o);if(r=$t(r,i),i.theme&&i.theme in qe){const o=$t({},Io),s=$t(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in qe&&(r.themeVariables=qe[r.theme].getThemeVariables(s))}return Li=r,Mc(Li),Li},"updateCurrentConfig"),o0=p(e=>(Qt=$t({},Gr),Qt=$t(Qt,e),e.theme&&qe[e.theme]&&(Qt.themeVariables=qe[e.theme].getThemeVariables(e.themeVariables)),ds(Qt,Cr),Qt),"setSiteConfig"),s0=p(e=>{Io=$t({},e)},"saveConfigFromInitialize"),a0=p(e=>(Qt=$t(Qt,e),ds(Qt,Cr),Qt),"updateSiteConfig"),vc=p(()=>$t({},Qt),"getSiteConfig"),Lc=p(e=>(Mc(e),$t(Li,e),_t()),"setConfig"),_t=p(()=>$t({},Li),"getConfig"),Fc=p(e=>{e&&(["secure",...Qt.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(N.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"&&Fc(e[t])}))},"sanitize"),n0=p(e=>{Oo(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Cr.push(e),ds(Qt,Cr)},"addDirective"),Do=p((e=Qt)=>{Cr=[],ds(e,Cr)},"reset"),l0={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."},Ul={},Ac=p(e=>{Ul[e]||(N.warn(l0[e]),Ul[e]=!0)},"issueWarning"),Mc=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Ac("LAZY_LOAD_DEPRECATED")},"checkConfig"),Lv=p(()=>{let e={};Io&&(e=$t(e,Io));for(const t of Cr)e=$t(e,t);return e},"getUserDefinedConfig"),Zt=p(e=>(e.flowchart?.htmlLabels!=null&&Ac("FLOWCHART_HTML_LABELS_DEPRECATED"),Ue(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Yi=//gi,h0=p(e=>e?Oc(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),c0=(()=>{let e=!1;return()=>{e||(Ec(),e=!0)}})();function Ec(){const e="data-temp-href-target";jr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),jr.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"))})}p(Ec,"setupDompurifyHooks");var $c=p(e=>(c0(),jr.sanitize(e)),"removeScript"),jl=p((e,t)=>{if(Zt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=$c(e):r!=="loose"&&(e=Oc(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=p0(e))}return e},"sanitizeMore"),ye=p((e,t)=>e&&(t.dompurifyConfig?e=jr.sanitize(jl(e,t),t.dompurifyConfig).toString():e=jr.sanitize(jl(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),u0=p((e,t)=>typeof e=="string"?ye(e,t):e.flat().map(r=>ye(r,t)),"sanitizeTextOrArray"),d0=p(e=>Yi.test(e),"hasBreaks"),f0=p(e=>e.split(Yi),"splitBreaks"),p0=p(e=>e.replace(/#br#/g,"
      "),"placeholderToBreak"),Oc=p(e=>e.replace(Yi,"#br#"),"breakToPlaceholder"),g0=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),m0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),y0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Gl=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),C0=p((e,t)=>{const r=fa(e,"~"),i=fa(t,"~");return r===1&&i===1},"shouldCombineSets"),x0=p(e=>{const t=fa(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Xl=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),pa=/\$\$(.*)\$\$/g,Ei=p(e=>(e.match(pa)?.length??0)>0,"hasKatex"),Fv=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Ic(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 o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),b0=p(async(e,t)=>{if(!Ei(e))return e;if(!(Xl()||t.legacyMathML||t.forceLegacyMathML))return e.replace(pa,"MathML is unsupported in this environment.");{const{default:r}=await import("./katex-HP8lGamR.js"),i=t.forceLegacyMathML||!Xl()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Yi).map(o=>Ei(o)?`
      ${o}
      `:`
      ${o}
      `).join("").replace(pa,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Ic=p(async(e,t)=>ye(await b0(e,t),t),"renderKatexSanitized"),Ui={getRows:h0,sanitizeText:ye,sanitizeTextOrArray:u0,hasBreaks:d0,splitBreaks:f0,lineBreakRegex:Yi,removeScript:$c,getUrl:g0,evaluate:Ue,getMax:m0,getMin:y0},k0=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),w0=p(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"),Dc=p(function(e,t,r,i){const o=w0(t,r,i);k0(e,o)},"configureSvgSize"),T0=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;N.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;N.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,N.info(`Calculated bounds: ${n}x${l}`),Dc(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),wo={};function ga(e){return[...e.cssRules].map(t=>t.cssText).join(` +`)}p(ga,"cssStyleSheetToString");var S0=p((e,t,r,i)=>{let o="";return e in wo&&wo[e]?o=wo[e]({...r,svgId:i}):N.warn(`No theme found for ${e}`),` & { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + fill: ${r.textColor} + } + @keyframes edge-animation-frame { + from { + stroke-dashoffset: 0; + } + } + @keyframes dash { + to { + stroke-dashoffset: 0; + } + } + & .edge-animation-slow { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 50s linear infinite; + stroke-linecap: round; + } + & .edge-animation-fast { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 20s linear infinite; + stroke-linecap: round; + } + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${r.errorBkgColor}; + } + & .error-text { + fill: ${r.errorTextColor}; + stroke: ${r.errorTextColor}; + } + + & .edge-thickness-normal { + stroke-width: ${r.strokeWidth??1}px; + } + & .edge-thickness-thick { + stroke-width: 3.5px + } + & .edge-pattern-solid { + stroke-dasharray: 0; + } + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } + & .edge-pattern-dashed{ + stroke-dasharray: 3; + } + .edge-pattern-dotted { + stroke-dasharray: 2; + } + + & .marker { + fill: ${r.lineColor}; + stroke: ${r.lineColor}; + } + & .marker.cross { + stroke: ${r.lineColor}; + } + + & svg { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + } + & p { + margin: 0 + } + + ${o} + .node .neo-node { + stroke: ${r.nodeBorder}; + } + + [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + + [data-look="neo"].node path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + stroke-width: ${r.strokeWidth??1}px; + } + + [data-look="neo"].node .outer-path { + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node .neo-line path { + stroke: ${r.nodeBorder}; + filter: none; + } + + [data-look="neo"].node circle{ + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node circle .state-start{ + fill: #000000; + } + + [data-look="neo"].icon-shape .icon { + fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + [data-look="neo"].icon-shape .icon-neo path { + stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder}; + filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"}; + } + + ${t} +`},"getStyles"),_0=p((e,t)=>{t!==void 0&&(wo[e]=t)},"addStylesForDiagram"),B0=S0,Rc={};Vm(Rc,{clear:()=>v0,getAccDescription:()=>M0,getAccTitle:()=>F0,getDiagramTitle:()=>$0,setAccDescription:()=>A0,setAccTitle:()=>L0,setDiagramTitle:()=>E0});var dn="",fn="",pn="",gn=p(e=>ye(e,_t()),"sanitizeText"),v0=p(()=>{dn="",pn="",fn=""},"clear"),L0=p(e=>{dn=gn(e).replace(/^\s+/g,"")},"setAccTitle"),F0=p(()=>dn,"getAccTitle"),A0=p(e=>{pn=gn(e).replace(/\n\s+/g,` +`)},"setAccDescription"),M0=p(()=>pn,"getAccDescription"),E0=p(e=>{fn=gn(e)},"setDiagramTitle"),$0=p(()=>fn,"getDiagramTitle"),Vl=N,O0=cn,mt=_t,Av=Lc,Mv=Gr,mn=p(e=>ye(e,mt()),"sanitizeText"),I0=T0,D0=p(()=>Rc,"getCommonDb"),Ro={},Po=p((e,t,r)=>{Ro[e]&&Vl.warn(`Diagram with id ${e} already registered. Overwriting.`),Ro[e]=t,r&&wc(e,r),_0(e,t.styles),t.injectUtils?.(Vl,O0,mt,mn,I0,D0(),()=>{})},"registerDiagram"),ma=p(e=>{if(e in Ro)return Ro[e];throw new R0(e)},"getDiagram"),R0=class extends Error{static{p(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}},P0={value:()=>{}};function Pc(){for(var e=0,t=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}To.prototype=Pc.prototype={constructor:To,on:function(e,t){var r=this._,i=N0(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var r=new Array(o),i=0,o,s;i=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Kl.hasOwnProperty(t)?{space:Kl[t],local:e}:e}function W0(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ya&&t.documentElement.namespaceURI===ya?t.createElement(e):t.createElementNS(r,e)}}function z0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Nc(e){var t=fs(e);return(t.local?z0:W0)(t)}function H0(){}function yn(e){return e==null?H0:function(){return this.querySelector(e)}}function Y0(e){typeof e!="function"&&(e=yn(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o=k&&(k=b+1);!(S=y[k])&&++k=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function gC(e){e||(e=mC);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;st?1:e>=t?0:NaN}function yC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function CC(){return Array.from(this)}function xC(){for(var e=this._groups,t=0,r=e.length;t1?this.each((t==null?AC:typeof t=="function"?EC:MC)(e,t,r??"")):Xr(this.node(),e)}function Xr(e,t){return e.style.getPropertyValue(t)||Yc(e).getComputedStyle(e,null).getPropertyValue(t)}function OC(e){return function(){delete this[e]}}function IC(e,t){return function(){this[e]=t}}function DC(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function RC(e,t){return arguments.length>1?this.each((t==null?OC:typeof t=="function"?DC:IC)(e,t)):this.node()[e]}function Uc(e){return e.trim().split(/^|\s+/)}function Cn(e){return e.classList||new jc(e)}function jc(e){this._node=e,this._names=Uc(e.getAttribute("class")||"")}jc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Gc(e,t){for(var r=Cn(e),i=-1,o=t.length;++i=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function ux(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?no(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?no(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bx.exec(e))?new te(t[1],t[2],t[3],1):(t=kx.exec(e))?new te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wx.exec(e))?no(t[1],t[2],t[3],t[4]):(t=Tx.exec(e))?no(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sx.exec(e))?oh(t[1],t[2]/100,t[3]/100,1):(t=_x.exec(e))?oh(t[1],t[2]/100,t[3]/100,t[4]):Ql.hasOwnProperty(e)?eh(Ql[e]):e==="transparent"?new te(NaN,NaN,NaN,0):null}function eh(e){return new te(e>>16&255,e>>8&255,e&255,1)}function no(e,t,r,i){return i<=0&&(e=t=r=NaN),new te(e,t,r,i)}function Lx(e){return e instanceof Gi||(e=Ii(e)),e?(e=e.rgb(),new te(e.r,e.g,e.b,e.opacity)):new te}function Ca(e,t,r,i){return arguments.length===1?Lx(e):new te(e,t,r,i??1)}function te(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}xn(te,Ca,Kc(Gi,{brighter(e){return e=e==null?qo:Math.pow(qo,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new te(mr(this.r),mr(this.g),mr(this.b),Wo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rh,formatHex:rh,formatHex8:Fx,formatRgb:ih,toString:ih}));function rh(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}`}function Fx(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}${fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function ih(){const e=Wo(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Wo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fr(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function oh(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,r,i)}function Qc(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof Gi||(e=Ii(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r0&&l<1?0:a,new fe(a,n,l,e.opacity)}function Ax(e,t,r,i){return arguments.length===1?Qc(e):new fe(e,t,r,i??1)}function fe(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}xn(fe,Ax,Kc(Gi,{brighter(e){return e=e==null?qo:Math.pow(qo,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new te(js(e>=240?e-240:e+120,o,i),js(e,o,i),js(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new fe(sh(this.h),lo(this.s),lo(this.l),Wo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wo(this.opacity);return`${e===1?"hsl(":"hsla("}${sh(this.h)}, ${lo(this.s)*100}%, ${lo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sh(e){return e=(e||0)%360,e<0?e+360:e}function lo(e){return Math.max(0,Math.min(1,e||0))}function js(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var bn=e=>()=>e;function Jc(e,t){return function(r){return e+r*t}}function Mx(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function Ev(e,t){var r=t-e;return r?Jc(e,r>180||r<-180?r-360*Math.round(r/360):r):bn(isNaN(e)?t:e)}function Ex(e){return(e=+e)==1?tu:function(t,r){return r-t?Mx(t,r,e):bn(isNaN(t)?r:t)}}function tu(e,t){var r=t-e;return r?Jc(e,r):bn(isNaN(e)?t:e)}var ah=(function e(t){var r=Ex(t);function i(o,s){var a=r((o=Ca(o)).r,(s=Ca(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=tu(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Ze(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var xa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gs=new RegExp(xa.source,"g");function $x(e){return function(){return e}}function Ox(e){return function(t){return e(t)+""}}function Ix(e,t){var r=xa.lastIndex=Gs.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=xa.exec(e))&&(o=Gs.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Ze(i,o)})),r=Gs.lastIndex;return r180?h+=360:h-c>180&&(c+=360),f.push({i:u.push(o(u)+"rotate(",null,i)-2,x:Ze(c,h)})):h&&u.push(o(u)+"rotate("+h+i)}function n(c,h,u,f){c!==h?f.push({i:u.push(o(u)+"skewX(",null,i)-2,x:Ze(c,h)}):h&&u.push(o(u)+"skewX("+h+i)}function l(c,h,u,f,d,g){if(c!==u||h!==f){var m=d.push(o(d)+"scale(",null,",",null,")");g.push({i:m-4,x:Ze(c,u)},{i:m-2,x:Ze(h,f)})}else(u!==1||f!==1)&&d.push(o(d)+"scale("+u+","+f+")")}return function(c,h){var u=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,u,f),a(c.rotate,h.rotate,u,f),n(c.skewX,h.skewX,u,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,u,f),c=h=null,function(d){for(var g=-1,m=f.length,y;++g=0&&e._call.call(void 0,t),e=e._next;--Vr}function lh(){xr=(Ho=Di.now())+ps,Vr=xi=0;try{Wx()}finally{Vr=0,Hx(),xr=0}}function zx(){var e=Di.now(),t=e-Ho;t>iu&&(ps-=t,Ho=e)}function Hx(){for(var e,t=zo,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:zo=r);bi=e,ka(i)}function ka(e){if(!Vr){xi&&(xi=clearTimeout(xi));var t=e-xr;t>24?(e<1/0&&(xi=setTimeout(lh,e-Di.now()-ps)),ci&&(ci=clearInterval(ci))):(ci||(Ho=Di.now(),ci=setInterval(zx,iu)),Vr=1,ou(lh))}}function hh(e,t,r){var i=new Yo;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var Yx=Pc("start","end","cancel","interrupt"),Ux=[],au=0,ch=1,wa=2,So=3,uh=4,Ta=5,_o=6;function gs(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;jx(e,r,{name:t,index:i,group:o,on:Yx,tween:Ux,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:au})}function wn(e,t){var r=xe(e,t);if(r.state>au)throw new Error("too late; already scheduled");return r}function $e(e,t){var r=xe(e,t);if(r.state>So)throw new Error("too late; already running");return r}function xe(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function jx(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=su(s,0,r.time);function s(c){r.state=ch,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,u,f,d;if(r.state!==ch)return l();for(h in i)if(d=i[h],d.name===r.name){if(d.state===So)return hh(a);d.state===uh?(d.state=_o,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[h]):+hwa&&i.state=0&&(t=t.slice(0,r)),!t||t==="start"})}function Tb(e,t,r){var i,o,s=wb(t)?wn:$e;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function Sb(e,t){var r=this._id;return arguments.length<2?xe(this.node(),r).on.on(e):this.each(Tb(r,e,t))}function _b(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Bb(){return this.on("end.remove",_b(this._id))}function vb(e){var t=this._name,r=this._id;typeof e!="function"&&(e=yn(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cu;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;ocr)if(!(Math.abs(u*l-c*h)>cr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let d=i-a,g=o-n,m=l*l+c*c,y=d*d+g*g,C=Math.sqrt(m),b=Math.sqrt(f),k=s*Math.tan((Sa-Math.acos((m+f-y)/(2*C*b)))/2),T=k/b,S=k/C;Math.abs(T-1)>cr&&this._append`L${t+T*h},${r+T*u}`,this._append`A${s},${s},0,0,${+(u*d>h*g)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,u=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>cr||Math.abs(this._y1-h)>cr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%_a+_a),f>Qb?this._append`A${i},${i},0,1,${u},${t-n},${r-l}A${i},${i},0,1,${u},${this._x1=c},${this._y1=h}`:f>cr&&this._append`A${i},${i},0,${+(f>=Sa)},${u},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function Or(e){return function(){return e}}const $v=Math.abs,Ov=Math.atan2,Iv=Math.cos,Dv=Math.max,Rv=Math.min,Pv=Math.sin,Nv=Math.sqrt,dh=1e-12,Sn=Math.PI,fh=Sn/2,qv=2*Sn;function Wv(e){return e>1?0:e<-1?Sn:Math.acos(e)}function zv(e){return e>=1?fh:e<=-1?-fh:Math.asin(e)}function e1(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new t1(t)}function r1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uu(e){this._context=e}uu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Fi(e){return new uu(e)}function i1(e){return e[0]}function o1(e){return e[1]}function s1(e,t){var r=Or(!0),i=null,o=Fi,s=null,a=e1(n);e=typeof e=="function"?e:e===void 0?i1:Or(e),t=typeof t=="function"?t:t===void 0?o1:Or(t);function n(l){var c,h=(l=r1(l)).length,u,f=!1,d;for(i==null&&(s=o(d=a())),c=0;c<=h;++c)!(c0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var l1=(function e(t){function r(i){return t===1?new ms(i):new yu(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function jo(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function _n(e,t){this._context=e,this._k=(1-t)/6}_n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Cu=(function e(t){function r(i){return new _n(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Bn(e,t){this._context=e,this._k=(1-t)/6}Bn.prototype={areaStart:er,areaEnd:er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var h1=(function e(t){function r(i){return new Bn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function vn(e,t){this._context=e,this._k=(1-t)/6}vn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var c1=(function e(t){function r(i){return new vn(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ln(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>dh){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>dh){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function xu(e,t){this._context=e,this._alpha=t}xu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ln(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var bu=(function e(t){function r(i){return t?new xu(i,t):new _n(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ku(e,t){this._context=e,this._alpha=t}ku.prototype={areaStart:er,areaEnd:er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ln(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var u1=(function e(t){function r(i){return t?new ku(i,t):new Bn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function wu(e,t){this._context=e,this._alpha=t}wu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ln(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var d1=(function e(t){function r(i){return t?new wu(i,t):new vn(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Tu(e){this._context=e}Tu.prototype={areaStart:er,areaEnd:er,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function f1(e){return new Tu(e)}function ph(e){return e<0?-1:1}function gh(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(ph(s)+ph(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function mh(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Xs(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Go(e){this._context=e}Go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xs(this,this._t0,mh(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Xs(this,mh(this,r=gh(this,e,t)),r);break;default:Xs(this,this._t0,r=gh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Su(e){this._context=new _u(e)}(Su.prototype=Object.create(Go.prototype)).point=function(e,t){Go.prototype.point.call(this,t,e)};function _u(e){this._context=e}_u.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Bu(e){return new Go(e)}function vu(e){return new Su(e)}function Lu(e){this._context=e}Lu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=yh(e),o=yh(t),s=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Au(e){return new ys(e,.5)}function Mu(e){return new ys(e,0)}function Eu(e){return new ys(e,1)}function ki(e,t,r){this.k=e,this.x=t,this.y=r}ki.prototype={constructor:ki,scale:function(e){return e===1?this:new ki(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ki(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};ki.prototype;var p1=p(e=>{const{securityLevel:t}=mt();let r=ht("body");if(t==="sandbox"){const s=ht(`#i${e}`).node()?.contentDocument??document;r=ht(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Fn(e){return typeof e>"u"||e===null}p(Fn,"isNothing");function $u(e){return typeof e=="object"&&e!==null}p($u,"isObject");function Ou(e){return Array.isArray(e)?e:Fn(e)?[]:[e]}p(Ou,"toArray");function Iu(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;rn&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(Bo,"getLine");function vo(e,t){return Ot.repeat(" ",t-e.length)+e}p(vo,"padStart");function Pu(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,u=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=Bo(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),u),n=Ot.repeat(" ",t.indent)+vo((e.line-l+1).toString(),h)+" | "+c.str+` +`+n;for(c=Bo(e.buffer,i[a],o[a],e.position,u),n+=Ot.repeat(" ",t.indent)+vo((e.line+1).toString(),h)+" | "+c.str+` +`,n+=Ot.repeat("-",t.indent+h+3+c.pos)+`^ +`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=Bo(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),u),n+=Ot.repeat(" ",t.indent)+vo((e.line+l+1).toString(),h)+" | "+c.str+` +`;return n.replace(/\n$/,"")}p(Pu,"makeSnippet");var k1=Pu,w1=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],T1=["scalar","sequence","mapping"];function Nu(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(Nu,"compileStyleAliases");function qu(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(w1.indexOf(r)===-1)throw new Jt('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Nu(t.styleAliases||null),T1.indexOf(this.kind)===-1)throw new Jt('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(qu,"Type$1");var Ht=qu;function va(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(va,"compileList");function Wu(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),E1=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function td(e){return!(e===null||!E1.test(e)||e[e.length-1]==="_")}p(td,"resolveYamlFloat");function ed(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(ed,"constructYamlFloat");var $1=/^[-+]?[0-9]+e/;function rd(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ot.isNegativeZero(e))return"-0.0";return r=e.toString(10),$1.test(r)?r.replace("e",".e"):r}p(rd,"representYamlFloat");function id(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ot.isNegativeZero(e))}p(id,"isFloat");var O1=new Ht("tag:yaml.org,2002:float",{kind:"scalar",resolve:td,construct:ed,predicate:id,represent:rd,defaultStyle:"lowercase"}),od=L1.extend({implicit:[F1,A1,M1,O1]}),I1=od,sd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ad=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function nd(e){return e===null?!1:sd.exec(e)!==null||ad.exec(e)!==null}p(nd,"resolveYamlTimestamp");function ld(e){var t,r,i,o,s,a,n,l=0,c=null,h,u,f;if(t=sd.exec(e),t===null&&(t=ad.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],u=+(t[11]||0),c=(h*60+u)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(ld,"constructYamlTimestamp");function hd(e){return e.toISOString()}p(hd,"representYamlTimestamp");var D1=new Ht("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:nd,construct:ld,instanceOf:Date,represent:hd});function cd(e){return e==="<<"||e===null}p(cd,"resolveYamlMerge");var R1=new Ht("tag:yaml.org,2002:merge",{kind:"scalar",resolve:cd}),Mn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function ud(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Mn;for(r=0;r64)){if(t<0)return!1;i+=6}return i%8===0}p(ud,"resolveYamlBinary");function dd(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Mn,a=0,n=[];for(t=0;t>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(dd,"constructYamlBinary");function fd(e){var t="",r=0,i,o,s=e.length,a=Mn;for(i=0;i>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(fd,"representYamlBinary");function pd(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(pd,"isBinary");var P1=new Ht("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ud,construct:dd,predicate:pd,represent:fd}),N1=Object.prototype.hasOwnProperty,q1=Object.prototype.toString;function gd(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r>10)+55296,(e-65536&1023)+56320)}p(Fd,"charFromCodepoint");function En(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(En,"setProperty");var Ad=new Array(256),Md=new Array(256);for(lr=0;lr<256;lr++)Ad[lr]=Fa(lr)?1:0,Md[lr]=Fa(lr);var lr;function Ed(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kd,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p(Ed,"State$1");function $n(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=k1(r),new Jt(t,r)}p($n,"generateError");function J(e,t){throw $n(e,t)}p(J,"throwError");function Ri(e,t){e.onWarning&&e.onWarning.call(null,$n(e,t))}p(Ri,"throwWarning");var xh={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&J(t,"duplication of %YAML directive"),i.length!==1&&J(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&J(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&J(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Ri(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&J(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Sd.test(o)||J(t,"ill-formed tag handle (first argument) of the TAG directive"),rr.call(t.tagMap,o)&&J(t,'there is a previously declared suffix for "'+o+'" tag handle'),_d.test(s)||J(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{J(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function We(e,t,r,i){var o,s,a,n;if(t1&&(e.result+=Ot.repeat(` +`,t-1))}p(xs,"writeFoldedLines");function $d(e,t,r){var i,o,s,a,n,l,c,h,u=e.kind,f=e.result,d;if(d=e.input.charCodeAt(e.position),Gt(d)||pr(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(o=e.input.charCodeAt(e.position+1),Gt(o)||r&&pr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;d!==0;){if(d===58){if(o=e.input.charCodeAt(e.position+1),Gt(o)||r&&pr(o))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),Gt(i))break}else{if(e.position===e.lineStart&&Xi(e)||r&&pr(d))break;if(ge(d))if(l=e.line,c=e.lineStart,h=e.lineIndent,Ft(e,!1,-1),e.lineIndent>=t){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(We(e,s,a,!1),xs(e,e.line-l),s=a=e.position,n=!1),tr(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return We(e,s,a,!1),e.result?!0:(e.kind=u,e.result=f,!1)}p($d,"readPlainScalar");function Od(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(We(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else ge(r)?(We(e,i,o,!0),xs(e,Ft(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Xi(e)?J(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);J(e,"unexpected end of the stream within a single quoted scalar")}p(Od,"readSingleQuotedScalar");function Id(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return We(e,r,e.position,!0),e.position++,!0;if(n===92){if(We(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),ge(n))Ft(e,!1,t);else if(n<256&&Ad[n])e.result+=Md[n],e.position++;else if((a=vd(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=Bd(n))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=Fd(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else ge(n)?(We(e,r,i,!0),xs(e,Ft(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Xi(e)?J(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}J(e,"unexpected end of the stream within a double quoted scalar")}p(Id,"readDoubleQuotedScalar");function Dd(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,u,f,d,g=Object.create(null),m,y,C,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,d=!1,n=[];else if(b===123)h=125,d=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),b=e.input.charCodeAt(++e.position);b!==0;){if(Ft(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=a,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=n,!0;r?b===44&&J(e,"expected the node content, but found ','"):J(e,"missed comma between flow collection entries"),y=m=C=null,u=f=!1,b===63&&(c=e.input.charCodeAt(e.position+1),Gt(c)&&(u=f=!0,e.position++,Ft(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,br(e,t,Vo,!1,!0),y=e.tag,m=e.result,Ft(e,!0,t),b=e.input.charCodeAt(e.position),(f||e.line===i)&&b===58&&(u=!0,b=e.input.charCodeAt(++e.position),Ft(e,!0,t),br(e,t,Vo,!1,!0),C=e.result),d?gr(e,n,g,y,m,C,i,o,s):u?n.push(gr(e,null,g,y,m,C,i,o,s)):n.push(m),Ft(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}J(e,"unexpected end of the stream within a flow collection")}p(Dd,"readFlowCollection");function Rd(e,t){var r,i,o=Vs,s=!1,a=!1,n=t,l=0,c=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Vs===o?o=u===43?Ch:j1:J(e,"repeat of a chomping mode identifier");else if((h=Ld(u))>=0)h===0?J(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?J(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(tr(u)){do u=e.input.charCodeAt(++e.position);while(tr(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ge(u)&&u!==0)}for(;u!==0;){for(Cs(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!a||e.lineIndentn&&(n=e.lineIndent),ge(u)){l++;continue}if(e.lineIndentt)&&l!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(a=e.line,n=e.lineStart,l=e.position),br(e,t,Zo,!0,o)&&(y?g=e.result:m=e.result),y||(gr(e,u,f,d,g,m,a,n,l),d=g=m=null),Ft(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)J(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u"),e.result!==null&&g.kind!==e.kind&&J(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):J(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(br,"composeNode");function zd(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ft(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Gt(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&J(e,"directive name must not be less than one character in length");a!==0;){for(;tr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!ge(a));break}if(ge(a))break;for(r=e.position;a!==0&&!Gt(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Cs(e),rr.call(xh,i)?xh[i](e,i,o):Ri(e,'unknown document directive "'+i+'"')}if(Ft(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ft(e,!0,-1)):s&&J(e,"directives end mark is expected"),br(e,e.lineIndent-1,Zo,!1,!0),Ft(e,!0,-1),e.checkLineBreaks&&X1.test(e.input.slice(t,e.position))&&Ri(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xi(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ft(e,!0,-1));return}if(e.position"u"&&(r=t,t=null);var i=On(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o=55296&&r<=56319&&t+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(Wr,"codePointAt");function Dn(e){var t=/^\n* /;return t.test(e)}p(Dn,"needIndentIndicator");var of=1,Da=2,sf=3,af=4,Pr=5;function nf(e,t,r,i,o,s,a,n){var l,c=0,h=null,u=!1,f=!1,d=i!==-1,g=-1,m=ef(Wr(e,0))&&rf(Wr(e,e.length-1));if(t||a)for(l=0;l=65536?l+=2:l++){if(c=Wr(e,l),!Kr(c))return Pr;m=m&&Ia(c,h,n),h=c}else{for(l=0;l=65536?l+=2:l++){if(c=Wr(e,l),c===Pi)u=!0,d&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Kr(c))return Pr;m=m&&Ia(c,h,n),h=c}f=f||d&&l-g-1>i&&e[g+1]!==" "}return!u&&!f?m&&!a&&!o(e)?of:s===Ni?Pr:Da:r>9&&Dn(e)?Pr:a?s===Ni?Pr:Da:f?af:sf}p(nf,"chooseScalarStyle");function lf(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===Ni?'""':"''";if(!e.noCompatMode&&(gk.indexOf(t)!==-1||mk.test(t)))return e.quotingType===Ni?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return tf(e,c)}switch(p(l,"testAmbiguity"),nf(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case of:return t;case Da:return"'"+t.replace(/'/g,"''")+"'";case sf:return"|"+Ra(t,e.indent)+Pa($a(t,s));case af:return">"+Ra(t,e.indent)+Pa($a(hf(t,a),s));case Pr:return'"'+cf(t)+'"';default:throw new Jt("impossible error: invalid scalar style")}})()}p(lf,"writeScalar");function Ra(e,t){var r=Dn(e)?String(t):"",i=e[e.length-1]===` +`,o=i&&(e[e.length-2]===` +`||e===` +`),s=o?"+":i?"":"-";return r+s+` +`}p(Ra,"blockHeader");function Pa(e){return e[e.length-1]===` +`?e.slice(0,-1):e}p(Pa,"dropEndingNewline");function hf(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(` +`);return c=c!==-1?c:e.length,r.lastIndex=c,Na(e.slice(0,c),t)})(),o=e[0]===` +`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?` +`:"")+Na(l,t),o=s}return i}p(hf,"foldString");function Na(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=` +`+e.slice(o,s),o=s+1),a=n;return l+=` +`,e.length-o>t&&a>o?l+=e.slice(o,a)+` +`+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(Na,"foldLine");function cf(e){for(var t="",r=0,i,o=0;o=65536?o+=2:o++)r=Wr(e,o),i=Yt[r],!i&&Kr(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Qd(r);return t}p(cf,"escapeString");function uf(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s"u"&&Ae(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(uf,"writeFlowSequence");function qa(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a"u"&&Ae(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Qo(e,t)),e.dump&&Pi===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(qa,"writeBlockSequence");function df(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ae(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(df,"writeFlowMapping");function ff(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,u,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Jt("sortKeys must be a boolean or a function");for(n=0,l=a.length;n1024,u&&(e.dump&&Pi===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=Qo(e,t)),Ae(e,t+1,h,!0,u)&&(e.dump&&Pi===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(ff,"writeBlockMapping");function Wa(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(Wa,"detectType");function Ae(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Wa(e,r,!1)||Wa(e,r,!0);var n=Yd.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",u,f;if(h&&(u=e.duplicates.indexOf(r),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(o=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(ff(e,t,e.dump,o),f&&(e.dump="&ref_"+u+e.dump)):(df(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?qa(e,t-1,e.dump,o):qa(e,t,e.dump,o),f&&(e.dump="&ref_"+u+e.dump)):(uf(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&lf(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Jt("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(Ae,"writeNode");function pf(e,t){var r=[],i=[],o,s;for(Jo(e,r,i),o=0,s=i.length;o{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),zt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},bh={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function wi(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=St(e),t=St(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(wi,"calculateDeltaAndAngle");var St=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),wk=p(e=>({x:p(function(t,r,i){let o=0;const s=St(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(zt,e.arrowTypeEnd)){const{angle:d,deltaX:g}=wi(i[i.length-1],i[i.length-2]);o=zt[e.arrowTypeEnd]*Math.cos(d)*(g>=0?1:-1)}const a=Math.abs(St(t).x-St(i[i.length-1]).x),n=Math.abs(St(t).y-St(i[i.length-1]).y),l=Math.abs(St(t).x-St(i[0]).x),c=Math.abs(St(t).y-St(i[0]).y),h=zt[e.arrowTypeStart],u=zt[e.arrowTypeEnd],f=1;if(a0&&n0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(zt,e.arrowTypeEnd)){const{angle:d,deltaY:g}=wi(i[i.length-1],i[i.length-2]);o=zt[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(g>=0?1:-1)}const a=Math.abs(St(t).y-St(i[i.length-1]).y),n=Math.abs(St(t).x-St(i[i.length-1]).x),l=Math.abs(St(t).y-St(i[0]).y),c=Math.abs(St(t).x-St(i[0]).x),h=zt[e.arrowTypeStart],u=zt[e.arrowTypeEnd],f=1;if(a0&&n0&&c-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return c;var f=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var d=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return d;if(f==="http:"||f==="https:"){if(!i(d))return e.BLANK_URL;var g=new URL(d);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return d}return co}var _k=Sk();function Zs(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Bk(){}function gf(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Rn(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const vk="[object RegExp]",mf="[object String]",yf="[object Number]",Cf="[object Boolean]",xf="[object Arguments]",Lk="[object Symbol]",Fk="[object Date]",Ak="[object Map]",Mk="[object Set]",Ek="[object Array]",$k="[object ArrayBuffer]",Ok="[object Object]",Ik="[object DataView]",Dk="[object Uint8Array]",Rk="[object Uint8ClampedArray]",Pk="[object Uint16Array]",Nk="[object Uint32Array]",qk="[object Int8Array]",Wk="[object Int16Array]",zk="[object Int32Array]",Hk="[object Float32Array]",Yk="[object Float64Array]",Th=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Pn(e){return typeof Th.Buffer<"u"&&Th.Buffer.isBuffer(e)}function Uk(e){return Number.isSafeInteger(e)&&e>=0}function bf(e){return e!=null&&typeof e!="function"&&Uk(e.length)}function jk(e){return e==="__proto__"}function Nn(e){return e==null||typeof e!="object"&&typeof e!="function"}function qn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Gk(e,t){return zr(e,void 0,e,new Map,t)}function zr(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(Nn(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n{if(typeof e=="object"){if(Rn(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),ce(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case yf:case mf:case Cf:{const a=new e.constructor(e?.valueOf());return ce(a,e),a}case xf:{const a={};return ce(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Sh(e){return Vk(e)}function za(e){return e!==null&&typeof e=="object"&&Rn(e)==="[object Arguments]"}function Ha(e){return typeof e=="object"&&e!==null}function Zk(e){return Ha(e)&&bf(e)}function Vi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Vi.Cache||Map),r}Vi.Cache=Map;function Lo(e){return qn(e)}function Kk(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Qk(e){if(Nn(e))return e;if(Array.isArray(e)||qn(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function Jk(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;sr!=="constructor").length===0:t.length===0}return!0}var e2="​",r2={curveBasis:Ba,curveBasisClosed:a1,curveBasisOpen:n1,curveBumpX:fu,curveBumpY:pu,curveBundle:l1,curveCardinalClosed:h1,curveCardinalOpen:c1,curveCardinal:Cu,curveCatmullRomClosed:u1,curveCatmullRomOpen:d1,curveCatmullRom:bu,curveLinear:Fi,curveLinearClosed:f1,curveMonotoneX:Bu,curveMonotoneY:vu,curveNatural:Fu,curveStep:Au,curveStepAfter:Eu,curveStepBefore:Mu},i2=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,o2=p(function(e,t){const r=kf(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Oo(a),i=$t(i,[...a])}else i=r.args;if(!i)return;let o=un(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),kf=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${i2.source})(?=[}][%]{2}).* +`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),N.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=vi.exec(e))!==null;)if(i.index===vi.lastIndex&&vi.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return N.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),s2=p(function(e){return e.replace(vi,"")},"removeDirectives"),a2=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Wn(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return r2[r]??t}p(Wn,"interpolateToCurve");function wf(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?_k.sanitizeUrl(r):r}p(wf,"formatUrl");var n2=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a{r+=zn(o,t),t=o});const i=r/2;return Hn(e,i)}p(Tf,"traverseEdge");function Sf(e){return e.length===1?e[0]:Tf(e)}p(Sf,"calcLabelPosition");var Bh=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Hn=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=zn(o,r);if(s===0)return r;if(s=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Bh((1-a)*r.x+a*o.x,5),y:Bh((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),l2=p((e,t,r)=>{N.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Hn(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function _f(e,t,r){const i=structuredClone(r);N.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=Hn(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(_f,"calcTerminalLabelPosition");function Bf(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(Bf,"getStylesFromArray");var vh=0,h2=p(()=>(vh++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vh),"generateId");function vf(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;ovf(e.length),"random"),u2=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),d2=p(function(e,t){const r=t.text.replace(Ui.lineBreakRegex," "),[,i]=bs(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),f2=Vi((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
      "},r),Ui.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=He(`${a} `,r),c=He(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:d}=p2(a,t,"-",r);o.push(s,...f),s=d}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),p2=Vi((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(He(c,i)>=t){const u=l+1,f=o.length===u,d=`${c}${r}`;s.push(f?c:d),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Lf(e,t){return Yn(e,t).height}p(Lf,"calculateTextHeight");function He(e,t){return Yn(e,t).width}p(He,"calculateTextWidth");var Yn=Vi((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=bs(r),a=["sans-serif",i],n=e.split(Ui.lineBreakRegex),l=[],c=ht("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let d=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=u2();y.text=m||e2;const C=d2(h,y).style("font-size",s).style("font-weight",o).style("font-family",f),b=(C._groups||C)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),d=Math.round(b.height),g.height+=d,g.lineHeight=Math.round(Math.max(g.lineHeight,d))}l.push(g)}h.remove();const u=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[u]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),g2=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{p(this,"InitIDGenerator")}},uo,m2=p(function(e){return uo=uo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),uo.innerHTML=e,unescape(uo.textContent)},"entityDecode");function Un(e){return"str"in e}p(Un,"isDetailedError");var y2=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),bs=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function jn(e,t){return t2({},e,t)}p(jn,"cleanAndMerge");var pe={assignWithDepth:$t,wrapLabel:f2,calculateTextHeight:Lf,calculateTextWidth:He,calculateTextDimensions:Yn,cleanAndMerge:jn,detectInit:o2,detectDirective:kf,isSubstringInArray:a2,interpolateToCurve:Wn,calcLabelPosition:Sf,calcCardinalityPosition:l2,calcTerminalLabelPosition:_f,formatUrl:wf,getStylesFromArray:Bf,generateId:h2,random:c2,runFunc:n2,entityDecode:m2,insertTitle:y2,isLabelCoordinateInPath:Ff,parseFontSize:bs,InitIDGenerator:g2},C2=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),kr=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Hv=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Dt(e){return e??null}p(Dt,"handleUndefinedAttr");function Ff(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(Ff,"isLabelCoordinateInPath");var Gn=p(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function Af(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=mt().fontSize?mt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=_c.fontSize]=bs(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(Af,"configureLabelImages");var x2=p(e=>{const{handDrawnSeed:t}=mt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),ti=p(e=>{const t=b2([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),b2=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Mf=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Z=p(e=>{const{stylesArray:t}=ti(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Mf(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),V=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=mt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=ti(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:k2(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),k2=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const w2=Object.freeze({left:0,top:0,width:16,height:16}),ts=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ef=Object.freeze({...w2,...ts}),T2=Object.freeze({...Ef,body:"",hidden:!1}),S2=Object.freeze({width:null,height:null}),_2=Object.freeze({...S2,...ts}),B2=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Ks(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Ks(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Ks(n,r)?n:null}return null},Ks=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function v2(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Lh(e,t){const r=v2(e,t);for(const i in T2)i in ts?i in e&&!(i in r)&&(r[i]=ts[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function L2(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function Fh(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=Lh(i[n]||o[n],s)}return a(t),r.forEach(a),Lh(e,s)}function F2(e,t){if(e.icons[t])return Fh(e,t,[]);const r=L2(e,[t])[t];return r?Fh(e,t,r):null}const A2=/(-?[0-9.]*[0-9]+[0-9.]*)/g,M2=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ah(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(A2);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=M2.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function E2(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function $2(e,t){return e?""+e+""+t:t}function O2(e,t,r){const i=E2(e);return $2(i.defs,t+i.content+r)}const I2=e=>e==="unset"||e==="undefined"||e==="none";function D2(e,t){const r={...Ef,...e},i={..._2,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],C=m.hFlip,b=m.vFlip;let k=m.rotate;C?b?k+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):b&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let T;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:T=o.height/2+o.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:T=o.width/2+o.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}k%2===1&&(o.left!==o.top&&(T=o.left,o.left=o.top,o.top=T),o.width!==o.height&&(T=o.width,o.width=o.height,o.height=T)),y.length&&(s=O2(s,'',""))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,u;a===null?(u=n===null?"1em":n==="auto"?c:n,h=Ah(u,l/c)):(h=a==="auto"?l:a,u=n===null?Ah(h,c/l):n==="auto"?c:n);const f={},d=(m,y)=>{I2(y)||(f[m]=y.toString())};d("width",h),d("height",u);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const R2=/\sid="(\S+)"/g,Mh=new Map;function P2(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Mh.get(e)||0;return Mh.set(e,t+1),t?`${e}${t}`:e}function N2(e){const t=[];let r;for(;r=R2.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=P2(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function q2(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'"+e+""}function Xn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sr=Xn();function $f(e){Sr=e}var Ai={exec:()=>null};function yt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Xt.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var W2=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
      /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},z2=/^(?:[ \t]*(?:\n|$))+/,H2=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Y2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vn=/(?:[*+-]|\d{1,9}[.)])/,Of=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,If=yt(Of).replace(/bull/g,Vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),j2=yt(Of).replace(/bull/g,Vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,G2=/^[^\n]+/,Kn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,X2=yt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Kn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),V2=yt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vn).getRegex(),ks="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Qn=/|$))/,Z2=yt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Qn).replace("tag",ks).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Df=yt(Zn).replace("hr",Zi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex(),K2=yt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Df).getRegex(),Jn={blockquote:K2,code:H2,def:X2,fences:Y2,heading:U2,hr:Zi,html:Z2,lheading:If,list:V2,newline:z2,paragraph:Df,table:Ai,text:G2},Eh=yt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex(),Q2={...Jn,lheading:j2,table:Eh,paragraph:yt(Zn).replace("hr",Zi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Eh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ks).getRegex()},J2={...Jn,html:yt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ai,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:yt(Zn).replace("hr",Zi).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",If).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ew=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rf=/^( {2,}|\\)\n(?!\s*$)/,rw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",W2?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,nw=yt(qf,"u").replace(/punct/g,ws).getRegex(),lw=yt(qf,"u").replace(/punct/g,Nf).getRegex(),Wf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hw=yt(Wf,"gu").replace(/notPunctSpace/g,Pf).replace(/punctSpace/g,tl).replace(/punct/g,ws).getRegex(),cw=yt(Wf,"gu").replace(/notPunctSpace/g,sw).replace(/punctSpace/g,ow).replace(/punct/g,Nf).getRegex(),uw=yt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pf).replace(/punctSpace/g,tl).replace(/punct/g,ws).getRegex(),dw=yt(/\\(punct)/,"gu").replace(/punct/g,ws).getRegex(),fw=yt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pw=yt(Qn).replace("(?:-->|$)","-->").getRegex(),gw=yt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",pw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),es=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,mw=yt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",es).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zf=yt(/^!?\[(label)\]\[(ref)\]/).replace("label",es).replace("ref",Kn).getRegex(),Hf=yt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Kn).getRegex(),yw=yt("reflink|nolink(?!\\()","g").replace("reflink",zf).replace("nolink",Hf).getRegex(),$h=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,el={_backpedal:Ai,anyPunctuation:dw,autolink:fw,blockSkip:aw,br:Rf,code:ew,del:Ai,emStrongLDelim:nw,emStrongRDelimAst:hw,emStrongRDelimUnd:uw,escape:tw,link:mw,nolink:Hf,punctuation:iw,reflink:zf,reflinkSearch:yw,tag:gw,text:rw,url:Ai},Cw={...el,link:yt(/^!?\[(label)\]\((.*?)\)/).replace("label",es).getRegex(),reflink:yt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",es).getRegex()},Ya={...el,emStrongRDelimAst:cw,emStrongLDelim:lw,url:yt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$h).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:yt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Oh=e=>bw[e];function _e(e,t){if(t){if(Xt.escapeTest.test(e))return e.replace(Xt.escapeReplace,Oh)}else if(Xt.escapeTestNoEncode.test(e))return e.replace(Xt.escapeReplaceNoEncode,Oh);return e}function Ih(e){try{e=encodeURI(e).replace(Xt.percentDecode,"%")}catch{return null}return e}function Dh(e,t){let r=e.replace(Xt.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(Xt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Rh(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function ww(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(` +`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(` +`)}var rs=class{options;rules;lexer;constructor(t){this.options=t||Sr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:fi(i,` +`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=ww(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=fi(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:fi(r[0],` +`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=fi(r[0],` +`).split(` +`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",u="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),d=t.split(` +`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,u=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(d)&&(h+=d+` +`,t=t.substring(d.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),T=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let M=t.split(` +`,1)[0],v;if(d=M,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),v=d):v=d.replace(this.rules.other.tabCharGlobal," "),T.test(d)||S.test(d)||_.test(d)||b.test(d)||k.test(d))break;if(v.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=` +`+v.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||S.test(f)||k.test(f))break;u+=` +`+d}!g&&!d.trim()&&(g=!0),h+=M+` +`,t=t.substring(M.length+1),f=v.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,C;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(C=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:C,loose:!1,text:u,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;cf.type==="space"),u=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=u}if(s.loose)for(let c=0;c({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=fi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=kw(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),Rh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Rh(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let u=[...o[0]][0].length,f=t.slice(0,s+o.index+u+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},ue=class Ua{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Sr,this.options.tokenizer=this.options.tokenizer||new rs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Xt,block:fo.normal,inline:di.normal};this.options.pedantic?(r.block=fo.pedantic,r.inline=di.pedantic):this.options.gfm&&(r.block=fo.gfm,this.options.breaks?r.inline=di.breaks:r.inline=di.gfm),this.tokenizer.rules=r}static get rules(){return{block:fo,inline:di}}static lex(t,r){return new Ua(r).lex(t)}static lexInline(t,r){return new Ua(r).inlineTokens(t)}lex(t){t=t.replace(Xt.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let r=0;r(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=` +`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),f;this.options.extensions.startInline.forEach(d=>{f=d.call({lexer:this},u),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},is=class{options;parser;constructor(t){this.options=t||Sr}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(Xt.notSpaceStart)?.[0],s=t.replace(Xt.endingNewline,"")+` +`;return o?'
      '+(i?s:_e(s,!0))+`
      +`:"
      "+(i?s:_e(s,!0))+`
      +`}blockquote({tokens:t}){return`
      +${this.parser.parse(t)}
      +`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} +`}hr(t){return`
      +`}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n +`+o+" +`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+_e(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
    3. ${r}
    4. +`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

      ${this.parser.parseInline(t)}

      +`}table(t){let r="",i="";for(let s=0;s${o}`),` + +`+r+` +`+o+`
      +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${_e(t,!0)}`}br(t){return"
      "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=Ih(t);if(s===null)return o;t=s;let a='
      ",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=Ih(t);if(s===null)return _e(i);t=s;let a=`${i}{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new is(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new rs(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Ti;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];Ti.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&Ti.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let u=l.call(s,h);return c.call(s,u)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ue.lex(t,r??this.defaults)}parser(t,r){return de.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?ue.lex:ue.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?de.parse:de.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?ue.lex:ue.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?de.parse:de.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let o="

      An error occurred:

      "+_e(i.message+"",!0)+"
      ";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},wr=new Tw;function xt(e,t){return wr.parse(e,t)}xt.options=xt.setOptions=function(e){return wr.setOptions(e),xt.defaults=wr.defaults,$f(xt.defaults),xt};xt.getDefaults=Xn;xt.defaults=Sr;xt.use=function(...e){return wr.use(...e),xt.defaults=wr.defaults,$f(xt.defaults),xt};xt.walkTokens=function(e,t){return wr.walkTokens(e,t)};xt.parseInline=wr.parseInline;xt.Parser=de;xt.parser=de.parse;xt.Renderer=is;xt.TextRenderer=rl;xt.Lexer=ue;xt.lexer=ue.lex;xt.Tokenizer=rs;xt.Hooks=Ti;xt.parse=xt;xt.options;xt.setOptions;xt.use;xt.walkTokens;xt.parseInline;de.parse;ue.lex;function Yf(e){for(var t=[],r=1;r?',height:80,width:80},Ga=new Map,Uf=new Map,_w=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(N.debug("Registering icon pack:",t.name),"loader"in t)Uf.set(t.name,t.loader);else if("icons"in t)Ga.set(t.name,t.icons);else throw N.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),jf=p(async(e,t)=>{const r=B2(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Ga.get(i);if(!o){const a=Uf.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Ga.set(i,o)}catch(n){throw N.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=F2(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),Bw=p(async e=>{try{return await jf(e),!0}catch{return!1}},"isIconAvailable"),Ki=p(async(e,t,r)=>{let i;try{i=await jf(e,t?.fallbackPrefix)}catch(a){N.error(a),i=Sw}const o=D2(i,t),s=q2(N2(o.body),{...o.attributes,...r});return ye(s,_t())},"getIconSVG");function Gf(e,{markdownAutoWrap:t}){const i=e.replace(//g,` +`).replace(/\n{2,}/g,` +`);return Yf(i)}p(Gf,"preprocessMarkdown");function Xf(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Xf,"nonMarkdownToLines");function Vf(e,t={}){const r=Gf(e,t),i=xt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(` +`).forEach((h,u)=>{u!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(Vf,"markdownToLines");function Zf(e){return e?`

      ${e.replace(/\\n|\n/g,"
      ")}

      `:""}p(Zf,"nonMarkdownToHTML");function Kf(e,{markdownAutoWrap:t}={}){const r=xt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"
      ").replace(/ /g," "):o.text.replace(/\n */g,"
      "):o.type==="strong"?`${o.tokens?.map(i).join("")}`:o.type==="em"?`${o.tokens?.map(i).join("")}`:o.type==="paragraph"?`

      ${o.tokens?.map(i).join("")}

      `:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(N.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(Kf,"markdownToHTML");function Qf(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Qf,"splitTextToChars");function Jf(e,t){const r=Qf(t.content);return il(e,[],r,t.type)}p(Jf,"splitWordToFitWidth");function il(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?il(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(il,"splitWordToFitWidthRecursion");function tp(e,t){if(e.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return os(e,t)}p(tp,"splitLineToFitWidth");function os(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return os(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Jf(t,s);r.push([n]),l.content&&e.unshift(l)}return os(e,t,r)}p(os,"splitLineToFitWidthRecursion");function Xa(e,t){t&&e.attr("style",t)}p(Xa,"applyStyle");var Ph=16384;async function ep(e,t,r,i,o=!1,s=_t()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Ph)}px`),a.attr("height",`${Math.min(10*r,Ph)}px`);const n=a.append("xhtml:div"),l=Ei(t.label)?await Ic(t.label.replace(Ui.lineBreakRegex,` +`),s):ye(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),Xa(h,t.labelStyle),h.attr("class",`${c} ${i}`),Xa(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let u=n.node().getBoundingClientRect();return u.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),u=n.node().getBoundingClientRect()),a.node()}p(ep,"addHtmlSpan");function Ts(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(Ts,"createTspan");function rp(e,t,r){const i=e.append("text"),o=Ts(i,1,t);Ss(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(rp,"computeWidthOfText");function vw(e,t,r){const i=e.append("text"),o=Ts(i,1,t);Ss(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(vw,"computeDimensionOfText");function ip(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const u=p(d=>rp(a,1.1,d)<=e,"checkWidth"),f=u(h)?[h]:tp(h,u);for(const d of f){const g=Ts(l,c,1.1,o);Ss(g,d),c++}}if(i){const h=l.node().getBBox(),u=2;return n.attr("x",h.x-u).attr("y",h.y-u).attr("width",h.width+2*u).attr("height",h.height+2*u),a.node()}else return l.node()}p(ip,"createFormattedText");function Va(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(Va,"decodeHTMLEntities");function Ss(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(Va(r.content)):o.text(" "+Va(r.content))})}p(Ss,"updateTextContentAndStyles");async function op(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await Bw(n)?await Ki(n,void 0,{class:"label-icon"}):``})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(op,"replaceIconSubstring");var je=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(N.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const u=a?Kf(t,h):Zf(t),f=await op(kr(u),h),d=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Ei(t)?d:f,labelStyle:r.replace("fill:","color:")};return await ep(e,g,l,o,c,h)}else{const u=kr(t.replace(//g,"
      ")),f=a?Vf(u.replace("
      ","
      "),h):Xf(u),d=ip(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(d).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ht(d).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ht(d).select("text").attr("style",m)}return i?ht(d).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ht(d).selectAll("tspan.text-outer-tspan").classed("row",!0),d}},"createText");function Qs(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function Lw(e,t){return e[0]===t[0]&&e[1]===t[1]}function Fw(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Qs(c,n,o);const l=(function(c,h,u){const f=[];for(const b of c){const k=[...b];Lw(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const d=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return d;let m=[],y=g[0].ymin,C=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(u!==1||C%h==0)&&m.length>1)for(let b=0;b=m.length)break;const T=m[b].edge,S=m[k].edge;d.push([[Math.round(T.x),y],[Math.round(S.x),y]])}y+=u,m.forEach((b=>{b.edge.x=b.edge.x+u*b.edge.islope})),C++}return d})(a,s,i);if(o){for(const c of a)Qs(c,n,-o);(function(c,h,u){const f=[];c.forEach((d=>f.push(...d))),Qs(f,h,u)})(l,n,-o)}return l}function Qi(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),Fw(e,o,i,s||1)}let ol=class{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Qi(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}};function _s(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class Aw extends ol{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Qi(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)_s([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}let Mw=class extends ol{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}},Ew=class{constructor(t){this.helper=t}fillPolygons(t,r){const i=Qi(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=_s(n),c=l/o,h=Math.ceil(c)-1,u=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,d=Math.min(n[0][1],n[1][1]);for(let g=0;g{const n=_s(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],u=a[1];h[0]>u[0]&&(h=a[1],u=a[0]);const f=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let d=0;d{const a=_s(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let u=0;uh%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function ap(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let u=0,f=0;r==="C"||r==="S"?(u=i+(i-n),f=o+(o-l)):(u=i,f=o),t.push({key:"C",data:[u,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[u,f]=h;let d=0,g=0;r==="Q"||r==="T"?(d=i+(i-n),g=o+(o-l)):(d=i,g=o);const m=i+2*(d-i)/3,y=o+2*(g-o)/3,C=u+2*(d-u)/3,b=f+2*(g-f)/3;t.push({key:"C",data:[m,y,C,b,u,f]}),n=d,l=g,i=u,o=f;break}case"Q":{const[u,f,d,g]=h,m=i+2*(u-i)/3,y=o+2*(f-o)/3,C=d+2*(u-d)/3,b=g+2*(f-g)/3;t.push({key:"C",data:[m,y,C,b,d,g]}),n=u,l=f,i=d,o=g;break}case"A":{const u=Math.abs(h[0]),f=Math.abs(h[1]),d=h[2],g=h[3],m=h[4],y=h[5],C=h[6];u===0||f===0?(t.push({key:"C",data:[i,o,y,C,y,C]}),i=y,o=C):(i!==y||o!==C)&&(np(i,o,y,C,u,f,d,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function pi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function np(e,t,r,i,o,s,a,n,l,c){const h=(u=a,Math.PI*u/180);var u;let f=[],d=0,g=0,m=0,y=0;if(c)[d,g,m,y]=c;else{[e,t]=pi(e,t,-h),[r,i]=pi(r,i,-h);const W=(e-r)/2,F=(t-i)/2;let A=W*W/(o*o)+F*F/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const L=o*o,E=s*s,D=L*E-L*F*F-E*W*W,z=L*F*F+E*W*W,Y=(n===l?-1:1)*Math.sqrt(Math.abs(D/z));m=Y*o*F/s+(e+r)/2,y=Y*-s*W/o+(t+i)/2,d=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),eg&&(d-=2*Math.PI),!l&&g>d&&(g-=2*Math.PI)}let C=g-d;if(Math.abs(C)>120*Math.PI/180){const W=g,F=r,A=i;g=l&&g>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,f=np(r=m+o*Math.cos(g),i=y+s*Math.sin(g),F,A,o,s,a,0,l,[g,W,m,y])}C=g-d;const b=Math.cos(d),k=Math.sin(d),T=Math.cos(g),S=Math.sin(g),_=Math.tan(C/4),M=4/3*o*_,v=4/3*s*_,q=[e,t],I=[e+M*k,t-v*b],R=[r+M*S,i-v*T],H=[r,i];if(I[0]=2*q[0]-I[0],I[1]=2*q[1]-I[1],c)return[I,R,H].concat(f);{f=[I,R,H].concat(f);const W=[];for(let F=0;F2){const o=[];for(let s=0;s2*Math.PI&&(d=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-d)/2),C=Uh(y,c,h,u,f,d,g,1,l);if(!l.disableMultiStroke){const b=Uh(y,c,h,u,f,d,g,1.5,l);C.push(...b)}return a&&(n?C.push(...ir(c,h,c+u*Math.cos(d),h+f*Math.sin(d),l),...ir(c,h,c+u*Math.cos(g),h+f*Math.sin(g),l)):C.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(d),h+f*Math.sin(d)]})),{type:"path",ops:C}}function zh(e,t){const r=ap(sp(sl(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...ir(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,u,f,d]=n;i.push(...Nw(l,c,h,u,f,d,s,t)),s=[f,d];break}case"Z":i.push(...ir(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function ea(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+it(o,t),i[0][1]+it(o,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const u=h/2,f=.2+.2*cp(o);let d=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;d=it(d,o,c),g=it(g,o,c);const m=[],y=()=>it(u,o,c),C=()=>it(h,o,c),b=o.preserveVertices;return a?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:it(h,o,c)),t+(b?0:it(h,o,c))]}),a?m.push({op:"bcurveTo",data:[d+e+(r-e)*f+y(),g+t+(i-t)*f+y(),d+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[d+e+(r-e)*f+C(),g+t+(i-t)*f+C(),d+e+2*(r-e)*f+C(),g+t+2*(i-t)*f+C(),r+(b?0:C()),i+(b?0:C())]}),m}function go(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+it(t,r),e[0][1]+it(t,r)]),i.push([e[0][0]+it(t,r),e[0][1]+it(t,r)]);for(let o=1;o3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],u=e[t+3],f=ur(l,c,.5),d=ur(c,h,.5),g=ur(h,u,.5),m=ur(f,d,.5),y=ur(d,g,.5),C=ur(m,y,.5);Qa([l,f,m,C],0,r,o),Qa([C,y,g,u],0,r,o)}var s,a;return o}function Ww(e,t){return ns(e,0,e.length,t)}function ns(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=u,c=h)}return Math.sqrt(l)>i?(ns(e,t,c+1,i,s),ns(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function ra(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s0?ns(i,0,i.length,r):i}const ee="none";class ls{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[lp(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=Pw(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(ea([c],a)):n.push(Ir([c],a))}return a.stroke!==ee&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=hp(i,o,a),c=Za(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Za(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Ir([c.estimatedPoints],a));return a.stroke!==ee&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Ao(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],u=Wh(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const d=Wh(t,r,i,o,s,a,!0,!1,f);d.type="fillPath",h.push(d)}else h.push((function(f,d,g,m,y,C,b){const k=f,T=d;let S=Math.abs(g/2),_=Math.abs(m/2);S+=it(.01*S,b),_+=it(.01*_,b);let M=y,v=C;for(;M<0;)M+=2*Math.PI,v+=2*Math.PI;v-M>2*Math.PI&&(M=0,v=2*Math.PI);const q=(v-M)/b.curveStepCount,I=[];for(let R=M;R<=v;R+=q)I.push([k+S*Math.cos(R),T+_*Math.sin(R)]);return I.push([k+S*Math.cos(v),T+_*Math.sin(v)]),I.push([k,T]),Ir([I],b)})(t,r,i,o,s,a,c));return c.stroke!==ee&&h.push(u),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=qh(t,i);if(i.fill&&i.fill!==ee)if(i.fillStyle==="solid"){const a=qh(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...ra(jh([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...ra(jh(c),10,(1+i.roughness)/2))}a.length&&o.push(Ir([a],i))}return i.stroke!==ee&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Ao(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(ea([t],i)):o.push(Ir([t],i))),i.stroke!==ee&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ee,a=i.stroke!==ee,n=!!(i.simplification&&i.simplification<1),l=(function(h,u,f){const d=ap(sp(sl(h))),g=[];let m=[],y=[0,0],C=[];const b=()=>{C.length>=4&&m.push(...ra(C,u)),C=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:S,data:_}of d)switch(S){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":b(),m.push([_[0],_[1]]);break;case"C":if(!C.length){const M=m.length?m[m.length-1]:y;C.push([M[0],M[1]])}C.push([_[0],_[1]]),C.push([_[2],_[3]]),C.push([_[4],_[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!f)return g;const T=[];for(const S of g){const _=Ww(S,f);_.length&&T.push(_)}return T})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=zh(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=zh(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(ea(l,i));else o.push(Ir(l,i));return a&&(n?l.forEach((h=>{o.push(Ao(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ee};break;case"fillPath":a={d:this.opsToPath(s),stroke:ee,strokeWidth:0,fill:i.fill||ee};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ee,strokeWidth:i,fill:ee}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class zw{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ls(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const mo="http://www.w3.org/2000/svg";class Hw{constructor(t,r){this.svg=t,this.gen=new ls(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(mo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(mo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(mo,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(mo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var X={canvas:(e,t)=>new zw(e,t),svg:(e,t)=>new Hw(e,t),generator:e=>new ls(e),newSeed:()=>ls.newSeed()},rt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ue(mt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Dt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await je(a,ye(kr(n),mt()),{useHtmlLabels:o,width:t.width||mt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},mt());let u=h.getBBox();const f=(t?.padding??0)/2;if(o){const d=h.children[0],g=ht(h);await Af(d,n),u=d.getBoundingClientRect(),g.attr("width",u.width),g.attr("height",u.height)}return o?a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):a.attr("transform","translate(0, "+-u.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:u,halfPadding:f,label:a}},"labelHelper"),ia=p(async(e,t,r)=>{const i=r.useHtmlLabels??Zt(mt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await je(o,ye(kr(t),mt()),{useHtmlLabels:i,width:r.width||mt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(Zt(mt())){const l=s.children[0],c=ht(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),K=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),et=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function ft(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(ft,"createPathFromPoints");function or(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,u=2*Math.PI/h,f=t+c/2;for(let d=0;d<=50;d++){const g=d/50,m=e+g*l,y=f+o*Math.sin(u*(m-e));a.push({x:m,y})}return a}p(or,"generateFullSineWavePoints");function Wi(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;ul.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(Ja,"mergePaths");var Yw=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),ei=Yw,Uw=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=mt(),n=Zt(a);return await je(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Ke=Uw,sr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),up=p(async(e,t)=>{N.info("Creating subgraph rect for ",t.id,t);const r=mt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Z(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=Zt(r),d=u.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await je(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await Ke(d,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(Zt(r)){const M=g.children[0],v=ht(g);m=M.getBoundingClientRect(),v.attr("width",m.width),v.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;N.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const M=X.svg(u),v=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),q=M.path(sr(b,k,y,C,0),v);T=u.insert(()=>(N.debug("Rough node insert CXC",q),q),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=u.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=Gn(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const M=d.select("span");M&&M.attr("style",n)}const _=T.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(M){return ei(t,M)},{cluster:u,labelBBox:m}},"rect"),jw=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return ei(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Gw=p(async(e,t)=>{const r=mt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const d=await Ke(u,t.label,t.labelStyle,void 0,!0);let g=d.getBBox();if(Zt(r)){const q=d.children[0],I=ht(d);g=q.getBoundingClientRect(),I.attr("width",g.width),I.attr("height",g.height)}const m=0*t.padding,y=m/2,C=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,k=t.height+m-g.height-6,T=t.x-C/2,S=t.y-b/2;t.width=C;const _=t.y-t.height/2-y+g.height+2;let M;if(t.look==="handDrawn"){const q=t.cssClasses.includes("statediagram-cluster-alt"),I=X.svg(c),R=t.rx||t.ry?I.path(sr(T,S,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):I.rectangle(T,S,C,b,{seed:o});M=c.insert(()=>R,":first-child");const H=I.rectangle(T,_,C,k,{fill:q?s:a,fillStyle:q?"hachure":"solid",stroke:l,seed:o});M=c.insert(()=>R,":first-child"),f=c.insert(()=>H)}else M=h.insert("rect",":first-child"),M.attr("class","outer").attr("x",T).attr("y",S).attr("width",C).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",T).attr("y",_).attr("width",C).attr("height",k);u.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(Zt(r)?0:3)})`);const v=M.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(q){return ei(t,q)},{cluster:c,labelBBox:g}},"roundedWithTitle"),Xw=p(async(e,t)=>{N.info("Creating subgraph rect for ",t.id,t);const r=mt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Z(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=Zt(r),d=u.insert("g").attr("class","cluster-label "),g=await je(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(Zt(r)){const M=g.children[0],v=ht(g);m=M.getBoundingClientRect(),v.attr("width",m.width),v.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;N.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const M=X.svg(u),v=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),q=M.path(sr(b,k,y,C,t.rx),v);T=u.insert(()=>(N.debug("Rough node insert CXC",q),q),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=u.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=Gn(r);if(d.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const M=d.select("span");M&&M.attr("style",n)}const _=T.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(M){return ei(t,M)},{cluster:u,labelBBox:m}},"kanbanSection"),Vw=p((e,t)=>{const r=mt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,u=t.x-c/2,f=t.y-h/2;t.width=c;let d;if(t.look==="handDrawn"){const y=X.svg(a).rectangle(u,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});d=a.insert(()=>y,":first-child")}else{d=n.insert("rect",":first-child");let m="outer";t.look,m="divider",d.attr("class",m).attr("x",u).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=d.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return ei(t,m)},{cluster:a,labelBBox:{}}},"divider"),Zw=up,Kw={rect:up,squareRect:Zw,roundedWithTitle:Gw,noteGroup:jw,divider:Vw,kanbanSection:Xw},dp=new Map,Qw=p(async(e,t)=>{const r=t.shape||"rect",i=await Kw[r](e,t);return dp.set(t.id,i),i},"insertCluster"),Jv=p(()=>{dp=new Map},"clear");function fp(e,t){return e.intersect(t)}p(fp,"intersectNode");var Jw=fp;function pp(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x0}p(tn,"sameSign");var eT=yp;function Cp(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h1&&s.sort(function(h,u){let f=h.x-r.x,d=h.y-r.y,g=Math.sqrt(f*f+d*d),m=u.x-r.x,y=u.y-r.y,C=Math.sqrt(m*m+y*y);return gh,":first-child");return u.attr("class","anchor").attr("style",Dt(n)),K(t,u),t.intersect=function(f){return N.info("Circle intersect",t,a,f),j.circle(t,a,f)},s}p(xp,"anchor");function en(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,f=(i-t)/2,d=u/o,g=f/s,m=Math.sqrt(d**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),C=l+y*s*Math.sin(h)*(a?-1:1),b=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-b)/s,(e-C)/o);let S=Math.atan2((i-b)/s,(r-C)/o)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const _=[];for(let M=0;M<20;M++){const v=M/19,q=k+v*S,I=C+o*Math.cos(q),R=b+s*Math.sin(q);_.push({x:I,y:R})}return _}p(en,"generateArcPoints");function bp(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(bp,"calculateArcSagitta");async function kp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(q=>q+a,"calcTotalHeight"),l=p(q=>{const I=q/2;return[I/(2.5+q/50),I]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await rt(e,t,et(t)),u=n(t?.height?t?.height:h.height),[f,d]=l(u),g=bp(u,f,d),y=(t?.width?t?.width:h.width)+s*2+g-g,C=u,{cssStyles:b}=t,k=[{x:y/2,y:-C/2},{x:-y/2,y:-C/2},...en(-y/2,-C/2,-y/2,C/2,f,d,!1),{x:y/2,y:C/2},...en(y/2,C/2,y/2,-C/2,f,d,!0)],T=X.svg(c),S=V(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=ft(k),M=T.path(_,S),v=c.insert(()=>M,":first-child");return v.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${f/2}, 0)`),K(t,v),t.intersect=function(q){return j.polygon(t,k,q)},c}p(kp,"bowTieRect");function Ge(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Ge,"insertPolygonShape");var yo=12;async function wp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+yo),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),u=0,f=c,d=-h,g=0,m=[{x:u+yo,y:d},{x:f,y:d},{x:f,y:g},{x:u,y:g},{x:u,y:d+yo},{x:u+yo,y:d}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=X.svg(n),k=V(t,{}),T=ft(m),S=b.path(T,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),C&&y.attr("style",C)}else y=Ge(n,c,h,m);return i&&y.attr("style",i),K(t,y),t.intersect=function(b){return j.polygon(t,m,b)},n}p(wp,"card");function Tp(e,t){const{nodeStyles:r}=Z(t);t.label="";const i=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=X.svg(i),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=ft(a),h=n.path(c,l),u=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return j.polygon(t,a,f)},i}p(Tp,"choice");async function al(e,t,r){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await rt(e,t,et(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=X.svg(s),g=V(t,{}),m=d.circle(0,0,h*2,g);u=s.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",Dt(f))}else u=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return K(t,u),t.calcIntersect=function(d,g){const m=d.width/2;return j.circle(d,m,g)},t.intersect=function(d){return N.info("Circle intersect",t,h,d),j.circle(t,h,d)},s}p(al,"circle");function Sp(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y} + M ${o.x},${o.y} L ${a.x},${a.y}`}p(Sp,"createLine");function _p(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=X.svg(o),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Sp(s),u=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>u),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),K(t,f),t.intersect=function(d){return N.info("crossedCircle intersect",t,{radius:s,point:d}),j.circle(t,s,d)},o}p(_p,"crossedCircle");function Pe(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${u}, 0)`),a.attr("transform",`translate(${-c/2+u-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,_),t.intersect=function(M){return j.polygon(t,g,M)},o}p(Bp,"curlyBraceLeft");function Ne(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-u}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,_),t.intersect=function(M){return j.polygon(t,g,M)},o}p(vp,"curlyBraceRight");function Pt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;uq,":first-child").attr("stroke-opacity",0),I.insert(()=>T,":first-child"),I.insert(()=>M,":first-child"),I.attr("class","text"),f&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(${u-u/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,I),t.intersect=function(R){return j.polygon(t,m,R)},o}p(Lp,"curlyBraces");async function Fp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await rt(e,t,et(t)),u=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),d=f/2,{cssStyles:g}=t,m=X.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=u,b=f,k=C-d,T=b/4,S=[{x:k,y:0},{x:T,y:0},{x:0,y:b/2},{x:T,y:b},{x:k,y:b},...Wi(-k,-b/2,d,50,270,90)],_=ft(S),M=m.path(_,y),v=c.insert(()=>M,":first-child");return v.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",i),v.attr("transform",`translate(${-u/2}, ${-f/2})`),K(t,v),t.intersect=function(q){return j.polygon(t,S,q)},c}p(Fp,"curvedTrapezoid");var iT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),oT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),sT=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Gh=8,Xh=8;async function Ap(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.widthS,":first-child"),g=n.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=iT(0,0,h,d,u,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Dt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(d/2+f)})`),K(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const C=j.rect(t,y),b=C.x-(t.x??0);if(u!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-b*b/(u*u));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),C.y+=k}return C},n}p(Ap,"cylinder");async function ri(e,t,r){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await rt(e,t,et(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let u,{rx:f,ry:d}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,d=r.ry),t.look==="handDrawn"){const m=X.svg(s),y=V(t,{}),C=f||d?m.path(sr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);u=s.insert(()=>C,":first-child"),u.attr("class","basic label-container").attr("style",Dt(g))}else u=s.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",o).attr("rx",Dt(f)).attr("ry",Dt(d)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return K(t,u),t.calcIntersect=function(m,y){return j.rect(m,y)},t.intersect=function(m){return j.rect(t,m)},s}p(ri,"drawRect");async function Mp(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await ri(e,t,l);if(t.look==="handDrawn"){const d=X.svg(c),g=V(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let C=null;if(y instanceof SVGGraphicsElement)C=y.getBBox();else return c;return c.insert(()=>d.line(C.x,C.y,C.x+C.width,C.y,g),".basic.label-container g.label"),c.insert(()=>d.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),u=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return u>0&&f>0&&h.attr("stroke-dasharray",`${u} ${f}`),c}p(Mp,"datastore");async function Ep(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=n.width+o,h=n.height+s,u=h*.2,f=-c/2,d=-h/2-u/2,{cssStyles:g}=t,m=X.svg(a),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:f,y:d+u},{x:-f,y:d+u},{x:-f,y:-d},{x:f,y:-d},{x:f,y:d},{x:-f,y:d},{x:-f,y:d+u}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${d+u+(t.padding??0)/2-(n.y-(n.top??0))})`),K(t,k),t.intersect=function(T){return j.rect(t,T)},a}p(Ep,"dividedRectangle");async function $p(e,t){const{labelStyles:r,nodeStyles:i}=Z(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=X.svg(n),g=V(t,{roughness:.2,strokeWidth:2.5}),m=V(t,{roughness:.2,strokeWidth:1.5}),y=d.circle(0,0,c*2,g),C=d.circle(0,0,h*2,m);u=n.insert("g",":first-child"),u.attr("class",Dt(t.cssClasses)).attr("style",Dt(f)),u.node()?.appendChild(y),u.node()?.appendChild(C)}else{u=n.insert("g",":first-child");const d=u.insert("circle",":first-child"),g=u.insert("circle");u.attr("class","basic label-container").attr("style",i),d.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return K(t,u),t.intersect=function(d){return N.info("DoubleCircle intersect",t,c,d),j.circle(t,c,d)},n}p($p,"doublecircle");function Op(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=X.svg(s),{nodeBorder:c}=r,h=V(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const u=l.circle(0,0,a*2,h),f=s.insert(()=>u,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),K(t,f),t.intersect=function(d){return N.info("filledCircle intersect",t,{radius:a,point:d}),j.circle(t,a,d)},s}p(Op,"filledCircle");var Vh=10,Zh=10;async function Ip(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.heightC,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return d&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=h,K(t,b),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return N.info("Triangle intersect",t,f,k),j.polygon(t,f,k)},a}p(Ip,"flippedTriangle");function Dp(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=Z(t);t.label="";const a=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,u=-1*c/2,f=X.svg(a),d=V(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const g=f.rectangle(h,u,l,c,d),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),K(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(C){return j.rect(t,C)},a}p(Dp,"forkJoin");async function Rp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),K(t,k),t.intersect=function(T){return N.info("Pill intersect",t,{radius:f,point:T}),j.polygon(t,y,T)},l}p(Rp,"halfRoundedRectangle");var aT=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Pp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:u}=await rt(e,t,et(t)),f=(t?.height?t?.height:u.height)+l,d=f/o,g=(t?.width?t?.width:u.width)+2*d+c,m=[{x:d,y:0},{x:g-d,y:0},{x:g,y:-f/2},{x:g-d,y:-f},{x:d,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=X.svg(h),k=V(t,{}),T=aT(0,0,g,f,d),S=b.path(T,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),C&&y.attr("style",C)}else y=Ge(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,K(t,y),t.intersect=function(b){return j.polygon(t,m,b)},h}p(Pp,"hexagon");async function Np(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await rt(e,t,et(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=X.svg(o),c=V(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],u=ft(h),f=l.path(u,c),d=o.insert(()=>f,":first-child");return d.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",i),d.attr("transform",`translate(${-s/2}, ${-a/2})`),K(t,d),t.intersect=function(g){return N.info("Pill intersect",t,{points:h}),j.polygon(t,h,g)},o}p(Np,"hourglass");async function qp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:u}=await rt(e,t,"icon-shape default"),f=t.pos==="t",d=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=ti(t),C=-g/2,b=-d/2,k=t.label?8:0,T=X.svg(c),S=V(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=T.rectangle(C,b,g,d,S),M=Math.max(g,h.width),v=d+h.height+k,q=T.rectangle(-M/2,-v/2,M,v,{...S,fill:"transparent",stroke:"none"}),I=c.insert(()=>_,":first-child"),R=c.insert(()=>q);if(t.icon){const H=c.append("g");H.html(`${await Ki(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const W=H.node().getBBox(),F=W.width,A=W.height,L=W.x,E=W.y;H.attr("transform",`translate(${-F/2-L},${f?h.height/2+k/2-A/2-E:-h.height/2-k/2-A/2-E})`),H.attr("style",`color: ${y.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-v/2:v/2-h.height})`),I.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),K(t,R),t.intersect=function(H){if(N.info("iconSquare intersect",t,H),!t.label)return j.rect(t,H);const W=t.x??0,F=t.y??0,A=t.height??0;let L=[];return f?L=[{x:W-h.width/2,y:F-A/2},{x:W+h.width/2,y:F-A/2},{x:W+h.width/2,y:F-A/2+h.height+k},{x:W+g/2,y:F-A/2+h.height+k},{x:W+g/2,y:F+A/2},{x:W-g/2,y:F+A/2},{x:W-g/2,y:F-A/2+h.height+k},{x:W-h.width/2,y:F-A/2+h.height+k}]:L=[{x:W-g/2,y:F-A/2},{x:W+g/2,y:F-A/2},{x:W+g/2,y:F-A/2+d},{x:W+h.width/2,y:F-A/2+d},{x:W+h.width/2/2,y:F+A/2},{x:W-h.width/2,y:F+A/2},{x:W-h.width/2,y:F-A/2+d},{x:W-g/2,y:F-A/2+d}],j.polygon(t,L,H)},c}p(qp,"icon");async function Wp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:u}=await rt(e,t,"icon-shape default"),f=20,d=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:C}=ti(t),b=X.svg(c),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=C.get("fill");k.stroke=T??y;const S=c.append("g");t.icon&&S.html(`${await Ki(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const _=S.node().getBBox(),M=_.width,v=_.height,q=_.x,I=_.y,R=Math.max(M,v)*Math.SQRT2+f*2,H=b.circle(0,0,R,k),W=Math.max(R,h.width),F=R+h.height+d,A=b.rectangle(-W/2,-F/2,W,F,{...k,fill:"transparent",stroke:"none"}),L=c.insert(()=>H,":first-child"),E=c.insert(()=>A);return S.attr("transform",`translate(${-M/2-q},${g?h.height/2+d/2-v/2-I:-h.height/2-d/2-v/2-I})`),S.attr("style",`color: ${C.get("stroke")??m};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-F/2:F/2-h.height})`),L.attr("transform",`translate(0,${g?h.height/2+d/2:-h.height/2-d/2})`),K(t,E),t.intersect=function(D){return N.info("iconSquare intersect",t,D),j.rect(t,D)},c}p(Wp,"iconCircle");async function zp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:f}=await rt(e,t,"icon-shape default"),d=t.pos==="t",g=n+u*2,m=n+u*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=ti(t),k=-m/2,T=-g/2,S=t.label?8:0,_=X.svg(c),M=V(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");const v=b.get("fill");M.stroke=v??C;const q=_.path(sr(k,T,m,g,5),M),I=Math.max(m,h.width),R=g+h.height+S,H=_.rectangle(-I/2,-R/2,I,R,{...M,fill:"transparent",stroke:"none"}),W=c.insert(()=>q,":first-child").attr("class","icon-shape2"),F=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`${await Ki(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=A.node().getBBox(),E=L.width,D=L.height,z=L.x,Y=L.y;A.attr("transform",`translate(${-E/2-z},${d?h.height/2+S/2-D/2-Y:-h.height/2-S/2-D/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-R/2:R/2-h.height})`),W.attr("transform",`translate(0,${d?h.height/2+S/2:-h.height/2-S/2})`),K(t,F),t.intersect=function(A){if(N.info("iconSquare intersect",t,A),!t.label)return j.rect(t,A);const L=t.x??0,E=t.y??0,D=t.height??0;let z=[];return d?z=[{x:L-h.width/2,y:E-D/2},{x:L+h.width/2,y:E-D/2},{x:L+h.width/2,y:E-D/2+h.height+S},{x:L+m/2,y:E-D/2+h.height+S},{x:L+m/2,y:E+D/2},{x:L-m/2,y:E+D/2},{x:L-m/2,y:E-D/2+h.height+S},{x:L-h.width/2,y:E-D/2+h.height+S}]:z=[{x:L-m/2,y:E-D/2},{x:L+m/2,y:E-D/2},{x:L+m/2,y:E-D/2+g},{x:L+h.width/2,y:E-D/2+g},{x:L+h.width/2/2,y:E+D/2},{x:L-h.width/2,y:E+D/2},{x:L-h.width/2,y:E-D/2+g},{x:L-m/2,y:E-D/2+g}],j.polygon(t,z,A)},c}p(zp,"iconRounded");async function Hp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Z(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:f}=await rt(e,t,"icon-shape default"),d=t.pos==="t",g=n+u*2,m=n+u*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=ti(t),k=-m/2,T=-g/2,S=t.label?8:0,_=X.svg(c),M=V(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");const v=b.get("fill");M.stroke=v??C;const q=_.path(sr(k,T,m,g,.1),M),I=Math.max(m,h.width),R=g+h.height+S,H=_.rectangle(-I/2,-R/2,I,R,{...M,fill:"transparent",stroke:"none"}),W=c.insert(()=>q,":first-child"),F=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`${await Ki(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const L=A.node().getBBox(),E=L.width,D=L.height,z=L.x,Y=L.y;A.attr("transform",`translate(${-E/2-z},${d?h.height/2+S/2-D/2-Y:-h.height/2-S/2-D/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-R/2:R/2-h.height})`),W.attr("transform",`translate(0,${d?h.height/2+S/2:-h.height/2-S/2})`),K(t,F),t.intersect=function(A){if(N.info("iconSquare intersect",t,A),!t.label)return j.rect(t,A);const L=t.x??0,E=t.y??0,D=t.height??0;let z=[];return d?z=[{x:L-h.width/2,y:E-D/2},{x:L+h.width/2,y:E-D/2},{x:L+h.width/2,y:E-D/2+h.height+S},{x:L+m/2,y:E-D/2+h.height+S},{x:L+m/2,y:E+D/2},{x:L-m/2,y:E+D/2},{x:L-m/2,y:E-D/2+h.height+S},{x:L-h.width/2,y:E-D/2+h.height+S}]:z=[{x:L-m/2,y:E-D/2},{x:L+m/2,y:E-D/2},{x:L+m/2,y:E-D/2+g},{x:L+h.width/2,y:E-D/2+g},{x:L+h.width/2/2,y:E+D/2},{x:L-h.width/2,y:E+D/2},{x:L-h.width/2,y:E-D/2+g},{x:L-m/2,y:E-D/2+g}],j.polygon(t,z,A)},c}p(Hp,"iconSquare");async function Yp(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=Z(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:u,bbox:f,label:d}=await rt(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,C=t.label?8:0,b=X.svg(u),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=b.rectangle(m,y,c,h,k),S=Math.max(c,f.width),_=h+f.height+C,M=b.rectangle(-S/2,-_/2,S,_,{...k,fill:"none",stroke:"none"}),v=u.insert(()=>T,":first-child"),q=u.insert(()=>M);if(t.img){const I=u.append("image");I.attr("href",t.img),I.attr("width",c),I.attr("height",h),I.attr("preserveAspectRatio","none"),I.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-C/2:h/2-f.height/2+C/2})`),v.attr("transform",`translate(0,${g?f.height/2+C/2:-f.height/2-C/2})`),K(t,q),t.intersect=function(I){if(N.info("iconSquare intersect",t,I),!t.label)return j.rect(t,I);const R=t.x??0,H=t.y??0,W=t.height??0;let F=[];return g?F=[{x:R-f.width/2,y:H-W/2},{x:R+f.width/2,y:H-W/2},{x:R+f.width/2,y:H-W/2+f.height+C},{x:R+c/2,y:H-W/2+f.height+C},{x:R+c/2,y:H+W/2},{x:R-c/2,y:H+W/2},{x:R-c/2,y:H-W/2+f.height+C},{x:R-f.width/2,y:H-W/2+f.height+C}]:F=[{x:R-c/2,y:H-W/2},{x:R+c/2,y:H-W/2},{x:R+c/2,y:H-W/2+h},{x:R+f.width/2,y:H-W/2+h},{x:R+f.width/2/2,y:H+W/2},{x:R-f.width/2,y:H+W/2},{x:R-f.width/2,y:H-W/2+h},{x:R-c/2,y:H-W/2+h}],j.polygon(t,F,I)},u}p(Yp,"imageSquare");async function Up(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),u=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(u),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),d&&f.attr("style",d)}else f=Ge(n,c,h,u);return i&&f.attr("style",i),t.width=c,t.height=h,K(t,f),t.intersect=function(g){return j.polygon(t,u,g)},n}p(Up,"inv_trapezoid");async function jp(e,t){const{shapeSvg:r,bbox:i,label:o}=await rt(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),K(t,s),t.intersect=function(l){return j.rect(t,l)},r}p(jp,"labelRect");async function Gp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,u=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(u),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),d&&f.attr("style",d)}else f=Ge(n,h,c,u);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,u,g)},n}p(Gp,"lean_left");async function Xp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,u=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(u),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),d&&f.attr("style",d)}else f=Ge(n,h,c,u);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,u,g)},n}p(Xp,"lean_right");function Vp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",et(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=X.svg(o),u=V(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=ft(c),d=h.path(f,u),g=o.insert(()=>d,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),K(t,g),t.intersect=function(m){return N.info("lightningBolt intersect",t,m),j.polygon(t,c,m)},o}p(Vp,"lightningBolt");var nT=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),lT=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),hT=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Kh=10,Qh=10;async function Zp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.width_,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const C=nT(0,0,h,d,u,f,g);m=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Dt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(d/2+f)})`),K(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(C){const b=j.rect(t,C),k=b.x-(t.x??0);if(u!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let T=f*f*(1-k*k/(u*u));T>0&&(T=Math.sqrt(T)),T=f-T,C.y-(t.y??0)>0&&(T=-T),b.y+=T}return b},n}p(Zp,"linedCylinder");async function Kp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const T=t.width;t.width=(T??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,u=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?u/4:u/8,d=u+f,{cssStyles:g}=t,m=X.svg(n),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:-h/2-h/2*.1,y:-d/2},{x:-h/2-h/2*.1,y:d/2},...or(-h/2-h/2*.1,d/2,h/2+h/2*.1,d/2,f,.8),{x:h/2+h/2*.1,y:-d/2},{x:-h/2-h/2*.1,y:-d/2},{x:-h/2,y:-d/2},{x:-h/2,y:d/2*1.1},{x:-h/2,y:-d/2}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-u/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),K(t,k),t.intersect=function(T){return j.polygon(t,C,T)},n}p(Kp,"linedWaveEdgedRect");async function Qp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await rt(e,t,et(t)),u=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,d=u-2*n,g=f-2*n,m=-d/2,y=-g/2,{cssStyles:C}=t,b=X.svg(l),k=V(t,{}),T=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+d-n,y:y+g+n},{x:m+d-n,y:y+g},{x:m+d,y:y+g},{x:m+d,y:y+g-n},{x:m+d+n,y:y+g-n},{x:m+d+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+d-n,y:y+n},{x:m+d-n,y:y+g},{x:m+d,y:y+g},{x:m+d,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=ft(T);let M=b.path(_,k);const v=ft(S);let q=b.path(v,k);t.look!=="handDrawn"&&(M=Ja(M),q=Ja(q));const I=l.insert("g",":first-child");return I.insert(()=>M),I.insert(()=>q),I.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),K(t,I),t.intersect=function(R){return j.polygon(t,T,R)},l}p(Qp,"multiRect");async function Jp(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await rt(e,t,et(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const u=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,d=t.look==="neo"?f/4:f/8,g=f+(h?d/2:-d/2),m=-u/2,y=-g/2,C=10,{cssStyles:b}=t,k=or(m-C,y+g+C,m+u-C,y+g+C,d,.8),T=k?.[k.length-1],S=[{x:m-C,y:y+C},{x:m-C,y:y+g+C},...k,{x:m+u-C,y:T.y-C},{x:m+u,y:T.y-C},{x:m+u,y:T.y-2*C},{x:m+u+C,y:T.y-2*C},{x:m+u+C,y:y-C},{x:m+C,y:y-C},{x:m+C,y},{x:m,y},{x:m,y:y+C}],_=[{x:m,y:y+C},{x:m+u-C,y:y+C},{x:m+u-C,y:T.y-C},{x:m+u,y:T.y-C},{x:m+u,y},{x:m,y}],M=X.svg(o),v=V(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const q=ft(S),I=M.path(q,v),R=ft(_),H=M.path(R,v),W=o.insert(()=>I,":first-child");return W.insert(()=>H),W.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",i),W.attr("transform",`translate(0,${-d/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-d/2-(s.y-(s.top??0))})`),K(t,W),t.intersect=function(F){return j.polygon(t,S,F)},o}p(Jp,"multiWaveEdgedRectangle");async function tg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i,t.useHtmlLabels||Zt(_t())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),u=-c/2,f=-h/2,{cssStyles:d}=t,g=X.svg(a),m=V(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(u,f,c,h,m),C=a.insert(()=>y,":first-child");return C.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,C),t.intersect=function(b){return j.rect(t,b)},a}p(tg,"note");var cT=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function eg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await rt(e,t,et(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=X.svg(o),g=V(t,{}),m=cT(0,0,l),y=d.path(m,g);u=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&u.attr("style",f)}else u=Ge(o,l,l,h),u.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&u.attr("style",i),K(t,u),t.calcIntersect=function(d,g){const m=d.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],C=j.polygon(d,y,g);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(d){return this.calcIntersect(t,d)},o}p(eg,"question");async function rg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),u=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,d=-u/2,g=d/2,m=[{x:f+g,y:d},{x:f,y:0},{x:f+g,y:-d},{x:-f,y:-d},{x:-f,y:d}],{cssStyles:y}=t,C=X.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=ft(m),T=C.path(k,b),S=n.insert(()=>T,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),K(t,S),t.intersect=function(_){return j.polygon(t,m,_)},n}p(rg,"rect_left_inv_arrow");async function ig(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await Ke(n,c,t.labelStyle,!0,!0);let u={width:0,height:0};if(Zt(mt())){const v=h.children[0],q=ht(h);u=v.getBoundingClientRect(),q.attr("width",u.width),q.attr("height",u.height)}N.info("Text 2",l);const f=l||[],d=h.getBBox(),g=await Ke(n,Array.isArray(f)?f.join("
      "):f,t.labelStyle,!0,!0),m=g.children[0],y=ht(g);u=m.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height);const C=(t.padding||0)/2;ht(g).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+C+5)+")"),ht(h).attr("transform","translate( "+(u.width(N.debug("Rough node insert CXC",I),R),":first-child"),_=s.insert(()=>(N.debug("Rough node insert CXC",I),I),":first-child")}else _=a.insert("rect",":first-child"),M=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-u.width/2-C).attr("y",-u.height/2-C).attr("width",u.width+(t.padding||0)).attr("height",u.height+(t.padding||0)),M.attr("class","divider").attr("x1",-u.width/2-C).attr("x2",u.width/2+C).attr("y1",-u.height/2-C+d.height+C).attr("y2",-u.height/2-C+d.height+C);return K(t,_),t.intersect=function(v){return j.rect(t,v)},s}p(ig,"rectWithTitle");async function og(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ri(e,t,o)}p(og,"roundedRect");var hr=8;async function sg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?hr:hr*2),h=(t?.height??n.height)+s*2,u=c-hr,f=h,d=hr-c/2,g=-h/2,{cssStyles:m}=t,y=X.svg(a),C=V(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:d,y:g},{x:d+u,y:g},{x:d+u,y:g+f},{x:d-hr,y:g+f},{x:d-hr,y:g},{x:d,y:g},{x:d,y:g+f}],k=y.polygon(b.map(S=>[S.x,S.y]),C),T=a.insert(()=>k,":first-child");return T.attr("class","basic label-container outer-path").attr("style",Dt(m)),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),l.attr("transform",`translate(${hr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,T),t.intersect=function(S){return j.rect(t,S)},a}p(sg,"shadedProcess");async function ag(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=(t?.width?t?.width:l.width)+s*2,u=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,d=u/1.5,g=-f/2,m=-d/2,{cssStyles:y}=t,C=X.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=[{x:g,y:m},{x:g,y:m+d},{x:g+f,y:m+d},{x:g+f,y:m-d/2}],T=ft(k),S=C.path(T,b),_=n.insert(()=>S,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${d/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-d/4+(t.padding??0)-(l.y-(l.top??0))})`),K(t,_),t.intersect=function(M){return j.polygon(t,k,M)},n}p(ag,"slopedRect");async function ng(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return ri(e,t,s)}p(ng,"squareRect");async function lg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),u=c/2,{cssStyles:f}=t,d=X.svg(n),g=V(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+u,y:-c/2},{x:h/2-u,y:-c/2},...Wi(-h/2+u,0,u,50,90,270),{x:h/2-u,y:c/2},...Wi(h/2-u,0,u,50,270,450)],y=ft(m),C=d.path(y,g),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),K(t,b),t.intersect=function(k){return j.polygon(t,m,k)},n}p(lg,"stadium");async function hg(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return ri(e,t,r)}p(hg,"state");function cg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),u=X.svg(h),f=V(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const d=u.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=u.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),C=h.insert(()=>d,":first-child");if(C.insert(()=>y),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",k=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${k})`)}return K(t,C),t.intersect=function(b){return j.circle(t,(t.width??0)/2,b)},h}p(cg,"stateEnd");function ug(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=X.svg(s).circle(0,0,t.width,x2(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return K(t,a),t.intersect=function(n){return j.circle(t,(t.width??7)/2,n)},s}p(ug,"stateStart");var Dr=8;async function dg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width??l.width)+2*Dr+s,h=(t?.height??l.height)+a,u=c-2*Dr,f=h,d=-c/2,g=-h/2,m=[{x:0,y:0},{x:u,y:0},{x:u,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:u+8,y:0},{x:u+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=X.svg(n),C=V(t,{}),b=y.rectangle(d,g,u+16,f,C),k=y.line(d+Dr,g,d+Dr,g+f,C),T=y.line(d+Dr+u,g,d+Dr+u,g+f,C);n.insert(()=>k,":first-child"),n.insert(()=>T,":first-child");const S=n.insert(()=>b,":first-child"),{cssStyles:_}=t;S.attr("class","basic label-container").attr("style",Dt(_)),K(t,S)}else{const y=Ge(n,u,f,m);i&&y.attr("style",i),K(t,y)}return t.intersect=function(y){return j.polygon(t,m,y)},n}p(dg,"subroutine");var oa=.2;async function fg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-oa*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height?t?.height:l.height)+a*2,h=oa*c,u=oa*c,d=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-d/2,y=-g/2,{cssStyles:C}=t,b=X.svg(n),k=V(t,{}),T=[{x:m-h/2,y},{x:m+d+h/2,y},{x:m+d+h/2,y:y+g},{x:m-h/2,y:y+g}],S=[{x:m+d-h/2,y:y+g},{x:m+d+h/2,y:y+g},{x:m+d+h/2,y:y+g-u}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=ft(T),M=b.path(_,k),v=ft(S),q=b.path(v,{...k,fillStyle:"solid"}),I=n.insert(()=>q,":first-child");return I.insert(()=>M,":first-child"),I.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),K(t,I),t.intersect=function(R){return j.polygon(t,T,R)},n}p(fg,"taggedRect");async function pg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await rt(e,t,et(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,u=.2*l,f=l+c,{cssStyles:d}=t,g=X.svg(o),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...or(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],C=-n/2+n/2*.1,b=-f/2-u*.4,k=[{x:C+n-h,y:(b+l)*1.3},{x:C+n,y:b+l-u},{x:C+n,y:(b+l)*.9},...or(C+n,(b+l)*1.25,C+n-h,(b+l)*1.3,-l*.02,.5)],T=ft(y),S=g.path(T,m),_=ft(k),M=g.path(_,{...m,fillStyle:"solid"}),v=o.insert(()=>M,":first-child");return v.insert(()=>S,":first-child"),v.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),K(t,v),t.intersect=function(q){return j.polygon(t,y,q)},o}p(pg,"taggedWaveEdgedRectangle");async function gg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await rt(e,t,et(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),K(t,h),t.intersect=function(u){return j.rect(t,u)},o}p(gg,"text");var uT=p((e,t,r,i,o,s)=>`M${e},${t} + a${o},${s} 0,0,1 0,${-i} + l${r},0 + a${o},${s} 0,0,1 0,${i} + M${r},${-i} + a${o},${s} 0,0,0 0,${i} + l${-r},0`,"createCylinderPathD"),dT=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),fT=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Jh=5,tc=10;async function mg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.heightk,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),d&&g.attr("style",d)}else{const m=uT(0,0,f,c,u,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Dt(d)).attr("style",i),g.attr("class","basic label-container outer-path"),d&&g.selectAll("path").attr("style",d),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-u-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),K(t,g),t.intersect=function(m){const y=j.rect(t,m),C=y.y-(t.y??0);if(h!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let b=u*u*(1-C*C/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(mg,"tiltedCylinder");async function yg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,u=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=X.svg(n),m=V(t,{}),y=ft(u),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),d&&f.attr("style",d)}else f=Ge(n,h,c,u);return i&&f.attr("style",i),t.width=h,t.height=c,K(t,f),t.intersect=function(g){return j.polygon(t,u,g)},n}p(yg,"trapezoid");async function Cg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),K(t,k),t.intersect=function(T){return j.polygon(t,y,T)},c}p(Cg,"trapezoidalPentagon");var ec=10,rc=10;async function xg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.widthb,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=u,K(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(T){return N.info("Triangle intersect",t,d,T),j.polygon(t,d,T)},a}p(xg,"triangle");async function bg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await rt(e,t,et(t)),u=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,d=t.look==="neo"?f/4:f/8,g=f+(n?d:-d),{cssStyles:m}=t,C=14-u,b=C>0?C/2:0,k=X.svg(l),T=V(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const S=[{x:-u/2-b,y:g/2},...or(-u/2-b,g/2,u/2+b,g/2,d,.8),{x:u/2+b,y:-g/2},{x:-u/2-b,y:-g/2}],_=ft(S),M=k.path(_,T),v=l.insert(()=>M,":first-child");return v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-d/2})`),h.attr("transform",`translate(${-u/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-d-(c.y-(c.top??0))})`),K(t,v),t.intersect=function(q){return j.polygon(t,S,q)},l}p(bg,"waveEdgedRectangle");async function kg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const T=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-T*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await rt(e,t,et(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,u=h/8,f=h+u*2,{cssStyles:d}=t,g=X.svg(n),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...or(-c/2,f/2,c/2,f/2,u,1),{x:c/2,y:-f/2},...or(c/2,-f/2,-c/2,-f/2,u,-1)],C=ft(y),b=g.path(C,m),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),K(t,k),t.intersect=function(T){return j.polygon(t,y,T)},n}p(kg,"waveRectangle");var Bt=10;async function wg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Bt,10),t.height=Math.max((t?.height??0)-s*2-Bt,10));const{shapeSvg:a,bbox:n,label:l}=await rt(e,t,et(t)),c=(t?.width?t?.width:n.width)+o*2+Bt,h=(t?.height?t?.height:n.height)+s*2+Bt,u=c-Bt,f=h-Bt,d=-u/2,g=-f/2,{cssStyles:m}=t,y=X.svg(a),C=V(t,{}),b=[{x:d-Bt,y:g-Bt},{x:d-Bt,y:g+f},{x:d+u,y:g+f},{x:d+u,y:g-Bt}],k=`M${d-Bt},${g-Bt} L${d+u},${g-Bt} L${d+u},${g+f} L${d-Bt},${g+f} L${d-Bt},${g-Bt} + M${d-Bt},${g} L${d+u},${g} + M${d},${g-Bt} L${d},${g+f}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=y.path(k,C),S=a.insert(()=>T,":first-child");return S.attr("transform",`translate(${Bt/2}, ${Bt/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Bt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Bt/2-(n.y-(n.top??0))})`),K(t,S),t.intersect=function(_){return j.polygon(t,b,_)},a}p(wg,"windowPane");var ic=new Set(["redux-color","redux-dark-color"]),pT=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function nl(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=_t(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:G}=_t(),{background:ct}=G,st={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ct}`]};await nl(e,st)}const c=_t();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,u=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:d,nodeStyles:g}=Z(t);if(r.attributes.length===0&&t.label){const G={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};He(t.label,c)+G.labelPaddingX*20){const G=C.width+h*2-(S+_+M+v);S+=G/R,_+=G/R,M>0&&(M+=G/R),v>0&&(v+=G/R)}const W=S+_+M+v,F=X.svg(y),A=V(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let L=0;T.length>0&&(L=T.reduce((G,ct)=>G+(ct?.rowHeight??0),0));const E=Math.max(H.width+h*2,t?.width||0,W),D=Math.max((L??0)+C.height,t?.height||0),z=-E/2,Y=-D/2;if(y.selectAll("g:not(:first-child)").each((G,ct,st)=>{const bt=ht(st[ct]),kt=bt.attr("transform");let wt=0,ne=0;if(kt){const _r=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(kt);_r&&(wt=parseFloat(_r[1]),ne=parseFloat(_r[2]),bt.attr("class").includes("attribute-name")?wt+=S:bt.attr("class").includes("attribute-keys")?wt+=S+_:bt.attr("class").includes("attribute-comment")&&(wt+=S+_+M))}bt.attr("transform",`translate(${z+h/2+wt}, ${ne+Y+C.height+u/2})`)}),y.select(".name").attr("transform","translate("+-C.width/2+", "+(Y+u/2)+")"),i!=null&&ic.has(i)){const G=r.colorIndex??0;y.attr("data-color-id",`color-${G%l.length}`)}const lt=F.rectangle(z,Y,E,D,A),pt=y.insert(()=>lt,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[G,ct]of T.entries()){const bt=(G+1)%2===0&&ct.yOffset!==0,kt=F.rectangle(z,C.height+Y+ct?.yOffset,E,ct?.rowHeight,{...A,fill:bt?s:a,stroke:n});y.insert(()=>kt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${bt?"even":"odd"}`)}const ut=1e-4;let tt=qr(z,C.height+Y,E+z,C.height+Y,ut),gt=F.polygon(tt.map(G=>[G.x,G.y]),A);if(y.insert(()=>gt).attr("class","divider"),tt=qr(S+z,C.height+Y,S+z,D+Y,ut),gt=F.polygon(tt.map(G=>[G.x,G.y]),A),y.insert(()=>gt).attr("class","divider"),q){const G=S+_+z;tt=qr(G,C.height+Y,G,D+Y,ut),gt=F.polygon(tt.map(ct=>[ct.x,ct.y]),A),y.insert(()=>gt).attr("class","divider")}if(I){const G=S+_+M+z;tt=qr(G,C.height+Y,G,D+Y,ut),gt=F.polygon(tt.map(ct=>[ct.x,ct.y]),A),y.insert(()=>gt).attr("class","divider")}for(const G of k){const ct=C.height+Y+G;tt=qr(z,ct,E+z,ct,ut),gt=F.polygon(tt.map(st=>[st.x,st.y]),A),y.insert(()=>gt).attr("class","divider")}if(K(t,pt),g&&t.look!=="handDrawn")if(i!=null&&pT.has(i))y.selectAll("path").attr("style",g);else{const ct=g.split(";")?.filter(st=>st.includes("stroke"))?.map(st=>`${st}`).join("; ");y.selectAll("path").attr("style",ct??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(G){return j.rect(t,G)},y}p(nl,"erBox");async function Nr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Gl(t)&&(t=Gl(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await je(n,t,{width:He(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Ue(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const u=ht(l);c=h.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}return c}p(Nr,"addText");function qr(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(qr,"lineToPolygon");async function Tg(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",et(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,u=0,f=0,d=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Si(n,{text:`«${b}»`},0),u=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Si(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await Si(c,b,m,[b.parseClassifier()]);m+=k+s}d=c.node().getBBox().height,d<=0&&(d=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const k=await Si(h,b,y,[b.parseClassifier()]);y+=k+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${u})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${u+f+o*2})`),C=a.node().getBBox(),h.attr("transform",`translate(0, ${u+f+(d?d+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}p(Tg,"textHelper");async function Si(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=_t();let a="useHtmlLabels"in t?t.useHtmlLabels:Ue(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Ei(n)&&(a=!0);const l=await je(o,mn(kr(n)),{width:He(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const u=l.children[0],f=ht(l);h=u.innerHTML.split("
      ").length,u.innerHTML.includes("")&&(h+=u.innerHTML.split("").length-1);const d=u.getElementsByTagName("img");if(d){const g=n.replace(/]*>/g,"").trim()==="";await Promise.all([...d].map(m=>new Promise(y=>{function C(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,T=parseInt(b,10)*5+"px";m.style.minWidth=T,m.style.maxWidth=T}else m.style.width="100%";y(m)}p(C,"setupImage"),setTimeout(()=>{m.complete&&C()}),m.addEventListener("error",C),m.addEventListener("load",C)})))}c=u.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ht(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const u=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(u.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(u.textContent=u.textContent[0]+" "+u.textContent.substring(1))),u.textContent==="undefined"&&(u.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(Si,"addText");async function Sg(e,t){const r=mt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ue(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Tg(e,t,r,n,a),{labelStyles:u,nodeStyles:f}=Z(t);t.labelStyle=u,t.cssStyles=l.styles||"";const d=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=d.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=X.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Math.max(t.width??0,h.width);let b=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=a:l.members.length>0&&l.methods.length===0&&(b+=a*2);const T=-C/2,S=-b/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const M=m.rectangle(T-s,S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),C+2*s,b+2*s+_,y),v=c.insert(()=>M,":first-child");v.attr("class","basic label-container outer-path");const q=v.node().getBBox(),I=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,R=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,H=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,W=(I+R+S+s-(S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((F,A,L)=>{const E=ht(L[A]),D=E.attr("transform");let z=0;if(D){const ut=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);ut&&(z=parseFloat(ut[2]))}let Y=z+S+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(E.attr("class").includes("methods-group")){const pt=Math.max(H,a/2);k?Y=Math.max(W,I+R+pt+S+a*2+s)+a*2:Y=I+R+pt+S+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?Y=z-a:Y=z),n||(Y-=4);let lt=T;(E.attr("class").includes("label-group")||E.attr("class").includes("annotation-group"))&&(lt=-E.node()?.getBBox().width/2||0,c.selectAll("text").each(function(pt,ut,tt){window.getComputedStyle(tt[ut]).textAnchor==="middle"&&(lt=0)})),E.attr("transform",`translate(${lt}, ${Y})`)}),l.members.length>0||l.methods.length>0||g){const F=I+R+S+s,A=m.line(q.x,F,q.x+q.width,F+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",d)}if(g||l.members.length>0||l.methods.length>0){const F=I+R+H+S+a*2+s,A=m.line(q.x,k?Math.max(W,F):F,q.x+q.width,(k?Math.max(W,F):F)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",d)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",d),v.select(":nth-child(2)").attr("style",d),c.selectAll(".divider").select("path").attr("style",d),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",d),!n){const F=RegExp(/color\s*:\s*([^;]*)/),A=F.exec(d);if(A){const L=A[0].replace("color","fill");c.selectAll("tspan").attr("style",L)}else if(u){const L=F.exec(u);if(L){const E=L[0].replace("color","fill");c.selectAll("tspan").attr("style",E)}}}return K(t,v),t.intersect=function(F){return j.rect(t,F)},c}p(Sg,"classBox");async function _g(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=et(t),{themeVariables:h}=mt(),{borderColorArray:u,requirementEdgeLabelBackground:f}=h,d=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Be(d,`<<${o.type}>>`,0,t.labelStyle):g=await Be(d,"<<Element>>",0,t.labelStyle);let m=g;const y=await Be(d,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const q=await Be(d,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=q;const I=await Be(d,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=I;const R=await Be(d,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=R,await Be(d,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const q=await Be(d,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=q,await Be(d,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const C=(d.node()?.getBBox().width??200)+a,b=(d.node()?.getBBox().height??200)+a,k=-C/2,T=-b/2,S=X.svg(d),_=V(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const M=S.rectangle(k,T,C,b,_),v=d.insert(()=>M,":first-child");if(v.attr("class","basic label-container outer-path").attr("style",i),u?.length){const q=t.colorIndex??0;d.attr("data-color-id",`color-${q%u.length}`)}if(d.selectAll(".label").each((q,I,R)=>{const H=ht(R[I]),W=H.attr("transform");let F=0,A=0;if(W){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(W);z&&(F=parseFloat(z[1]),A=parseFloat(z[2]))}const L=A-b/2;let E=k+a/2;(I===0||I===1)&&(E=F),H.attr("transform",`translate(${E}, ${L+a})`)}),m>g+y+n){const q=T+g+y+n;let I;if(t.look==="neo"){const W=[[k,q],[k+C,q],[k+C,q+.001],[k,q+.001]];I=S.polygon(W,_)}else I=S.line(k,q,k+C,q,_);d.insert(()=>I).attr("class","divider")}return K(t,v),t.intersect=function(q){return j.rect(t,q)},i&&t.look!=="handDrawn"&&(f||u?.length)&&d.selectAll("path").attr("style",i),d}p(_g,"requirementBox");async function Be(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=mt(),a=s.htmlLabels??!0,n=await je(o,mn(kr(t)),{width:He(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=ht(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Be,"addText");var gT=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Bg(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=Z(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await rt(e,t,et(t)),h=t.padding||10;let u="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(u=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await ia(f,"ticket"in t&&t.ticket||"",d):{label:g,bbox:m}=await ia(n,"ticket"in t&&t.ticket||"",d);const{label:y,bbox:C}=await ia(n,"assigned"in t&&t.assigned||"",d);t.width=a;const b=10,k=t?.width||0,T=Math.max(m.height,C.height)/2,S=Math.max(l.height+b*2,t?.height||0)+T,_=-k/2,M=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-C.width-2*s)+", "+(-T+l.height/2)+")");let v;const{rx:q,ry:I}=t,{cssStyles:R}=t;if(t.look==="handDrawn"){const H=X.svg(n),W=V(t,{}),F=q||I?H.path(sr(_,M,k,S,q||0),W):H.rectangle(_,M,k,S,W);v=n.insert(()=>F,":first-child"),v.attr("class","basic label-container").attr("style",R||null)}else{v=n.insert("rect",":first-child"),v.attr("class","basic label-container __APA__").attr("style",o).attr("rx",q??5).attr("ry",I??5).attr("x",_).attr("y",M).attr("width",k).attr("height",S);const H="priority"in t&&t.priority;if(H){const W=n.append("line"),F=_+2,A=M+Math.floor((q??0)/2),L=M+S-Math.floor((q??0)/2);W.attr("x1",F).attr("y1",A).attr("x2",F).attr("y2",L).attr("stroke-width","4").attr("stroke",gT(H))}}return K(t,v),t.height=S,t.intersect=function(H){return j.rect(t,H)},n}p(Bg,"kanbanItem");async function vg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:u}=t,f=s.width+20,d=s.height+20,g=Math.max(l,f),m=Math.max(c,d);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const C=`M0 0 + a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},${m*.1} + + a${h},${h} 1 0,0 ${g*.15},${m*.33} + a${h*.8},${h*.8} 1 0,0 0,${m*.34} + a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} + + a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} + + a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} + a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} + a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} + H0 V0 Z`;if(t.look==="handDrawn"){const b=X.svg(o),k=V(t,{}),T=b.path(C,k);y=o.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Dt(u))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),K(t,y),t.calcIntersect=function(b,k){return j.rect(b,k)},t.intersect=function(b){return N.info("Bang intersect",t,b),j.rect(t,b)},o}p(vg,"bang");async function Lg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,u=.25*l,f=.35*l,d=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 + a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} + a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} + a${u},${u} 1 0,1 ${l*.35},${l*.2} + + a${h},${h} 1 0,1 ${l*.15},${c*.35} + a${d},${d} 1 0,1 ${-1*l*.15},${c*.65} + + a${u},${h} 1 0,1 ${-1*l*.25},${l*.15} + a${f},${f} 1 0,1 ${-1*l*.5},0 + a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} + + a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} + a${d},${d} 1 0,1 ${l*.1},${-1*c*.65} + H0 V0 Z`;if(t.look==="handDrawn"){const C=X.svg(o),b=V(t,{}),k=C.path(y,b);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Dt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),K(t,m),t.calcIntersect=function(C,b){return j.rect(C,b)},t.intersect=function(C){return N.info("Cloud intersect",t,C),j.rect(t,C)},o}p(Lg,"cloud");async function Fg(e,t){const{labelStyles:r,nodeStyles:i}=Z(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await rt(e,t,et(t)),l=s.width+8*a,c=s.height+2*a,h=5,u=t.look==="neo"?` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-h} + H${-l/2} + Z + `:` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-2*h} + q0,${h} ${-h},${h} + h${-(l-2*h)} + q${-h},0 ${-h},${-h} + Z + `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),K(t,f),t.calcIntersect=function(d,g){return j.rect(d,g)},t.intersect=function(d){return j.rect(t,d)},o}p(Fg,"defaultMindmapNode");async function Ag(e,t){const r={padding:t.padding??0};return al(e,t,r)}p(Ag,"mindmapCircle");var mT=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ng},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:og},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:lg},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:dg},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Ap},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Mp},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:al},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:vg},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Lg},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:eg},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Pp},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Xp},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Gp},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:yg},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Up},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:$p},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:gg},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:wp},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:sg},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ug},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:cg},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Dp},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Np},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Bp},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:vp},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Lp},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Vp},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:bg},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Rp},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:mg},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Zp},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Fp},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Ep},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:xg},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:wg},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Op},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Cg},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Ip},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ag},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Jp},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Qp},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:kp},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:_p},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:pg},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:fg},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:kg},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:rg},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Kp}],yT=p(()=>{const t=[...Object.entries({state:hg,choice:Tp,note:tg,rectWithTitle:ig,labelRect:jp,iconSquare:Hp,iconCircle:Wp,icon:qp,iconRounded:zp,imageSquare:Yp,anchor:xp,kanbanItem:Bg,mindmapCircle:Ag,defaultMindmapNode:Fg,classBox:Sg,erBox:nl,requirementBox:_g}),...mT.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Mg=yT();function CT(e){return e in Mg}p(CT,"isValidShape");var Bs=new Map;async function Eg(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Mg[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Dt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Bs.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Eg,"insertNode");var tL=p((e,t)=>{Bs.set(t.id,e)},"setNodeElem"),eL=p(()=>{Bs.clear()},"clear"),rL=p(e=>{const t=Bs.get(e.id);N.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),xT=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&oc(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&oc(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),bT={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},kT=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],oc=p((e,t,r,i,o,s,a=!1,n)=>{const l=bT[r],c=l&&kT.includes(l.type);if(!l){N.warn(`Unknown arrow type: ${r}`);return}const h=l.type,d=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${d}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(d);if(y){const C=y.cloneNode(!0);C.id=m,C.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${d})`)},"addEdgeMarker"),wT=p(e=>typeof e=="string"?e:mt()?.flowchart?.curve,"resolveEdgeCurveType"),hs=new Map,Nt=new Map,iL=p(()=>{hs.clear(),Nt.clear()},"clear"),mi=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),TT=p(async(e,t)=>{const r=mt();let i=Zt(r);const{labelStyles:o}=Z(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await je(e,t.label,{style:mi(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),N.info("abc82",t,t.labelType);let h=c.getBBox(),u=h;if(i){const d=c.children[0],g=ht(c);h=d.getBoundingClientRect(),u=h,g.attr("width",h.width),g.attr("height",h.height)}else{const d=ht(c).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",ui(u,i)),hs.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await Ke(g,t.startLabelLeft,mi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),Nt.get(t.id)||Nt.set(t.id,{}),Nt.get(t.id).startLeft=d,_i(f,t.startLabelLeft)}if(t.startLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await Ke(g,t.startLabelRight,mi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),Nt.get(t.id)||Nt.set(t.id,{}),Nt.get(t.id).startRight=d,_i(f,t.startLabelRight)}if(t.endLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await Ke(d,t.endLabelLeft,mi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),Nt.get(t.id)||Nt.set(t.id,{}),Nt.get(t.id).endLeft=d,_i(f,t.endLabelLeft)}if(t.endLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),g=d.insert("g").attr("class","inner"),m=await Ke(d,t.endLabelRight,mi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ht(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",ui(y,i)),Nt.get(t.id)||Nt.set(t.id,{}),Nt.get(t.id).endRight=d,_i(f,t.endLabelRight)}return c},"insertEdgeLabel");function _i(e,t){Zt(mt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(_i,"setTerminalWidth");var ST=p((e,t)=>{N.debug("Moving label abc88 ",e.id,e.label,hs.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=mt(),{subGraphTitleTotalMargin:o}=Gn(i);if(e.label){const s=hs.get(e.id);let a=e.x,n=e.y;if(r){const l=pe.calcLabelPosition(r);N.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Nt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=pe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Nt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=pe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Nt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=pe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Nt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=pe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),_T=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),BT=p((e,t,r)=>{N.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(r)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.xMath.abs(i-t.x)*l){let u=r.y{N.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(N.info("abc88 checking point",s,t),!_T(t,s)&&!o){const a=BT(t,i,s);N.debug("abc88 inside",s,i,a),N.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?N.warn("abc88 no intersect",a,r):r.push(a),o=!0}else N.warn("abc88 outside",s,i),i=s,o||r.push(s)}),N.debug("returning points",r),r},"cutPathAtIntersect");function $g(e){const t=[],r=[];for(let i=1;i5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p($g,"extractCornerPoints");var ac=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),vT=p(function(e){const{cornerPointPositions:t}=$g(e),r=[];for(let i=0;i10&&Math.abs(s.y-o.y)>=10){N.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const d=5;a.x===n.x?f={x:c<0?n.x-d+u:n.x+d-u,y:h<0?n.y-u:n.y+u}:f={x:c<0?n.x-u:n.x+u,y:h<0?n.y-d+u:n.y+d-u}}else N.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),LT=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),FT=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=mt();let c=t.points,h=!1;const u=o;var f=s;const d=[];for(const E in t.cssCompiledStyles)Mf(E)||d.push(t.cssCompiledStyles[E]);N.debug("UIO intersect check",t.points,f.x,u.x),f.intersect&&u.intersect&&!n&&(c=c.slice(1,t.points.length-1),c.unshift(u.intersect(c[0])),N.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(N.info("to cluster abc88",r.get(t.toCluster)),c=sc(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(N.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=sc(c.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let m=c.filter(E=>!Number.isNaN(E.y));const y=wT(t.curve);y!=="rounded"&&(m=vT(m));let C=Fi;switch(y){case"linear":C=Fi;break;case"basis":C=Ba;break;case"cardinal":C=Cu;break;case"bumpX":C=fu;break;case"bumpY":C=pu;break;case"catmullRom":C=bu;break;case"monotoneX":C=Bu;break;case"monotoneY":C=vu;break;case"natural":C=Fu;break;case"step":C=Au;break;case"stepAfter":C=Eu;break;case"stepBefore":C=Mu;break;case"rounded":C=Fi;break;default:C=Ba}const{x:b,y:k}=wk(t),T=s1().x(b).y(k).curve(C);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let _,M=y==="rounded"?Og(Ig(m,t),5):T(m);const v=Array.isArray(t.style)?t.style:[t.style];let q=v.find(E=>E?.startsWith("stroke:")),I="";t.animate&&(I="edge-animation-fast"),t.animation&&(I="edge-animation-"+t.animation);let R=!1;if(t.look==="handDrawn"){const E=X.svg(e);Object.assign([],m);const D=E.path(M,{roughness:.3,seed:l});S+=" transition",_=ht(D).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",v?v.reduce((Y,lt)=>Y+";"+lt,""):"");let z=_.attr("d");_.attr("d",z),e.node().appendChild(_.node())}else{const E=d.join(";"),D=v?v.reduce((tt,gt)=>tt+gt+";",""):"",z=(E?E+";"+D+";":D)+";"+(v?v.reduce((tt,gt)=>tt+";"+gt,""):"");_=e.append("path").attr("d",M).attr("id",`${a}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",z),q=z.match(/stroke:([^;]+)/)?.[1],R=t.animate===!0||!!t.animation||E.includes("animation");const Y=_.node(),lt=typeof Y.getTotalLength=="function"?Y.getTotalLength():0,pt=bh[t.arrowTypeStart]||0,ut=bh[t.arrowTypeEnd]||0;if(t.look==="neo"&&!R){const gt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?LT(lt,pt,ut):`0 ${pt} ${lt-pt-ut} ${ut}`}; stroke-dashoffset: 0;`;_.attr("style",gt+_.attr("style"))}}_.attr("data-edge",!0),_.attr("data-et","edge"),_.attr("data-id",t.id),_.attr("data-points",g),_.attr("data-look",Dt(t.look)),t.showPoints&&m.forEach(E=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",E.x).attr("cy",E.y)});let H="";(mt().flowchart.arrowMarkerAbsolute||mt().state.arrowMarkerAbsolute)&&(H=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,H=H.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),N.info("arrowTypeStart",t.arrowTypeStart),N.info("arrowTypeEnd",t.arrowTypeEnd);const W=!R&&t?.look==="neo";xT(_,t,H,a,i,W,q);const F=Math.floor(c.length/2),A=c[F];pe.isLabelCoordinateInPath(A,_.attr("d"))||(h=!0);let L={};return h&&(L.updatedPath=c),L.originalPath=t.points,L},"insertEdge");function Og(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s({...o}));if(e.length>=2&&zt[t.arrowTypeStart]){const o=zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=rn(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&zt[t.arrowTypeEnd]){const o=zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=rn(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(Ig,"applyMarkerOffsetsToPoints");var AT=p((e,t,r,i)=>{t.forEach(o=>{JT[o](e,r,i)})},"insertMarkers"),MT=p((e,t,r)=>{N.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),ET=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),$T=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),OT=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),IT=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),DT=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),RT=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),PT=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),NT=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),qT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),WT=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),zT=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),HT=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),YT=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),UT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),jT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),GT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),XT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),VT=p((e,t,r)=>{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").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`)},"requirement_arrow"),ZT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`).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"),KT=p((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"),QT=p((e,t,r)=>{const i=_t(),{themeVariables:o}=i,{strokeWidth:s}=o,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",`${s}`)},"requirement_contains_neo"),JT={extension:MT,composition:ET,aggregation:$T,dependency:OT,lollipop:IT,point:DT,circle:RT,cross:PT,barb:NT,barbNeo:qT,only_one:WT,zero_or_one:zT,one_or_more:HT,zero_or_more:YT,only_one_neo:UT,zero_or_one_neo:jT,one_or_more_neo:GT,zero_or_more_neo:XT,requirement_arrow:VT,requirement_contains:KT,requirement_arrow_neo:ZT,requirement_contains_neo:QT},tS=AT,eS={common:Ui,getConfig:_t,insertCluster:Qw,insertEdge:FT,insertEdgeLabel:TT,insertMarkers:tS,insertNode:Eg,interpolateToCurve:Wn,labelHelper:rt,log:N,positionEdgeLabel:ST},zi={},Dg=p(e=>{for(const t of e)zi[t.name]=t},"registerLayoutLoaders"),rS=p(()=>{Dg([{name:"dagre",loader:p(async()=>await import("./dagre-BM42HDAG-DLMfLCoV.js"),"loader")},{name:"cose-bilkent",loader:p(async()=>await import("./cose-bilkent-S5V4N54A-Bi19n8m-.js"),"loader")}])},"registerDefaultLayoutLoaders");rS();var oL=p(async(e,t)=>{if(!(e.layoutAlgorithm in zi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const u=h.domId||h.id;h.domId=`${e.diagramId}-${u}`}const r=zi[e.layoutAlgorithm],i=await r.loader(),{theme:o,themeVariables:s}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=s,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",`${o?.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",`${o?.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,eS,{algorithm:r.algorithm})},"render"),sL=p((e="",{fallback:t="dagre"}={})=>{if(e in zi)return e;if(t in zi)return N.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"),ll="comm",Rg="rule",Pg="decl",iS="@media",oS="@import",sS="@supports",aS="@namespace",on="@keyframes",Ng="@layer",nS="@scope",lS=Math.abs,Mi=String.fromCharCode;function qg(e){return e.trim()}function sn(e,t,r){return e.replace(t,r)}function Ur(e,t){return e.charCodeAt(t)|0}function Qr(e,t,r){return e.slice(t,r)}function ve(e){return e.length}function Wg(e){return e.length}function Co(e,t){return t.push(e),e}var vs=1,Jr=1,zg=0,ae=0,At=0,ii="";function hl(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:vs,column:Jr,length:a,return:"",siblings:n}}function hS(){return At}function cS(){return At=ae>0?Ur(ii,--ae):0,Jr--,At===10&&(Jr=1,vs--),At}function me(){return At=ae2||Hi(At)>3?"":" "}function pS(e,t){for(;--t&&me()&&!(At<48||At>102||At>57&&At<65||At>70&&At<97););return Ls(e,Eo()+(t<6&&Qe()==32&&me()==32))}function an(e){for(;me();)switch(At){case e:return ae;case 34:case 39:e!==34&&e!==39&&an(At);break;case 40:e===41&&an(e);break;case 92:me();break}return ae}function gS(e,t){for(;me()&&e+At!==57;)if(e+At===84&&Qe()===47)break;return"/*"+Ls(t,ae-1)+"*"+Mi(e===47?e:me())}function mS(e){for(;!Hi(Qe());)me();return Ls(e,ae)}function yS(e){return dS($o("",null,null,null,[""],e=uS(e),0,[0],e))}function $o(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,u=a,f=0,d=0,g=0,m=1,y=1,C=1,b=0,k=0,T="",S=o,_=s,M=i,v=T;y;)switch(g=k,k=me()){case 40:g!=108&&Ur(v,u-1)==58?(b++,v+="("):v+=sa(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=sa(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Mi(k);break}v+=fS(g);break;case 92:v+=pS(Eo()-1,7);continue;case 47:switch(Qe()){case 42:case 47:Co(CS(gS(me(),Eo()),t,r,l),l),(Hi(g||1)==5||Hi(Qe()||1)==5)&&ve(v)&&Qr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*m:n[c++]=ve(v)*C;case 125*m:case 59:case 0:if(b>0&&k){v+=Mi(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(v=sn(v,/\f/g,"")),d>0&&(ve(v)-u||m===0)&&Co(d>32?lc(v+";",i,r,u-1,l):lc(sn(v," ","")+";",i,r,u-2,l),l);break;case 59:v+=";";default:if(Co(M=nc(v,t,r,c,h,o,n,T,S=[],_=[],u,s),s),k===123)if(h===0)$o(v,t,M,M,S,s,u,n,_);else{switch(f){case 99:if(Ur(v,3)===110)break;case 108:if(Ur(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?$o(e,M,M,i&&Co(nc(e,M,M,0,0,o,n,T,o,S=[],u,_),_),o,_,u,n,i?S:_):$o(v,M,M,M,[""],_,0,n,_)}}c=h=d=0,m=C=1,T=v="",u=a;break;case 58:u=1+ve(v),d=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&cS()==125)continue}switch(v+=Mi(k),k*m){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(ve(v)-1)*C,C=1;break;case 64:Qe()===45&&(v+=sa(me())),f=Qe(),h=u=ve(T=v+=mS(Eo())),k++;break;case 45:g===45&&ve(v)==2&&(m=0)}}return s}function nc(e,t,r,i,o,s,a,n,l,c,h,u){for(var f=o-1,d=o===0?s:[""],g=Wg(d),m=0,y=0,C=0;m0?d[b]+" "+k:sn(k,/&\f/g,d[b])))&&(l[C++]=T);return hl(e,t,r,o===0?Rg:n,l,c,h,u)}function CS(e,t,r,i){return hl(e,t,r,ll,Mi(hS()),Qr(e,2,-2),0,i)}function lc(e,t,r,i,o){return hl(e,t,r,Pg,Qr(e,0,i),Qr(e,i+1,-1),i,o)}function nn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),wS=p(async()=>{const{diagram:e}=await import("./c4Diagram-AAUBKEIU-DtzacMnD.js");return{id:Hg,diagram:e}},"loader"),TS={id:Hg,detector:kS,loader:wS},SS=TS,Yg="flowchart",_S=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),BS=p(async()=>{const{diagram:e}=await import("./flowDiagram-I6XJVG4X-DkYNQv0R.js");return{id:Yg,diagram:e}},"loader"),vS={id:Yg,detector:_S,loader:BS},LS=vS,Ug="flowchart-v2",FS=p((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"),AS=p(async()=>{const{diagram:e}=await import("./flowDiagram-I6XJVG4X-DkYNQv0R.js");return{id:Ug,diagram:e}},"loader"),MS={id:Ug,detector:FS,loader:AS},ES=MS,jg="er",$S=p(e=>/^\s*erDiagram/.test(e),"detector"),OS=p(async()=>{const{diagram:e}=await import("./erDiagram-TEJ5UH35-yd6SOv_7.js");return{id:jg,diagram:e}},"loader"),IS={id:jg,detector:$S,loader:OS},DS=IS,Gg="gitGraph",RS=p(e=>/^\s*gitGraph/.test(e),"detector"),PS=p(async()=>{const{diagram:e}=await import("./gitGraphDiagram-PVQCEYII-DMbTATyw.js");return{id:Gg,diagram:e}},"loader"),NS={id:Gg,detector:RS,loader:PS},qS=NS,Xg="gantt",WS=p(e=>/^\s*gantt/.test(e),"detector"),zS=p(async()=>{const{diagram:e}=await import("./ganttDiagram-6RSMTGT7-Cg1TQBc0.js");return{id:Xg,diagram:e}},"loader"),HS={id:Xg,detector:WS,loader:zS},YS=HS,Vg="info",US=p(e=>/^\s*info/.test(e),"detector"),jS=p(async()=>{const{diagram:e}=await import("./infoDiagram-5YYISTIA-2JF3XEdD.js");return{id:Vg,diagram:e}},"loader"),GS={id:Vg,detector:US,loader:jS},Zg="pie",XS=p(e=>/^\s*pie/.test(e),"detector"),VS=p(async()=>{const{diagram:e}=await import("./pieDiagram-4H26LBE5-BkwDAvbt.js");return{id:Zg,diagram:e}},"loader"),ZS={id:Zg,detector:XS,loader:VS},Kg="quadrantChart",KS=p(e=>/^\s*quadrantChart/.test(e),"detector"),QS=p(async()=>{const{diagram:e}=await import("./quadrantDiagram-W4KKPZXB-BmT_qM09.js");return{id:Kg,diagram:e}},"loader"),JS={id:Kg,detector:KS,loader:QS},t_=JS,Qg="xychart",e_=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),r_=p(async()=>{const{diagram:e}=await import("./xychartDiagram-2RQKCTM6-Db_VoDBV.js");return{id:Qg,diagram:e}},"loader"),i_={id:Qg,detector:e_,loader:r_},o_=i_,Jg="requirement",s_=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),a_=p(async()=>{const{diagram:e}=await import("./requirementDiagram-4Y6WPE33-CZrxH1Y2.js");return{id:Jg,diagram:e}},"loader"),n_={id:Jg,detector:s_,loader:a_},l_=n_,tm="sequence",h_=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),c_=p(async()=>{const{diagram:e}=await import("./sequenceDiagram-3UESZ5HK-VAxffBe7.js");return{id:tm,diagram:e}},"loader"),u_={id:tm,detector:h_,loader:c_},d_=u_,em="class",f_=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),p_=p(async()=>{const{diagram:e}=await import("./classDiagram-4FO5ZUOK-B1ZO8EbE.js");return{id:em,diagram:e}},"loader"),g_={id:em,detector:f_,loader:p_},m_=g_,rm="classDiagram",y_=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),C_=p(async()=>{const{diagram:e}=await import("./classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js");return{id:rm,diagram:e}},"loader"),x_={id:rm,detector:y_,loader:C_},b_=x_,im="state",k_=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),w_=p(async()=>{const{diagram:e}=await import("./stateDiagram-AJRCARHV-nDExQydZ.js");return{id:im,diagram:e}},"loader"),T_={id:im,detector:k_,loader:w_},S_=T_,om="stateDiagram",__=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),B_=p(async()=>{const{diagram:e}=await import("./stateDiagram-v2-BHNVJYJU-BzwD_BIl.js");return{id:om,diagram:e}},"loader"),v_={id:om,detector:__,loader:B_},L_=v_,sm="journey",F_=p(e=>/^\s*journey/.test(e),"detector"),A_=p(async()=>{const{diagram:e}=await import("./journeyDiagram-JHISSGLW-yctdo4bX.js");return{id:sm,diagram:e}},"loader"),M_={id:sm,detector:F_,loader:A_},E_=M_,$_=p((e,t,r)=>{N.debug(`rendering svg for syntax error +`);const i=p1(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Dc(i,100,512,!0),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),am={draw:$_},O_=am,I_={db:{},renderer:am,parser:{parse:p(()=>{},"parse")}},D_=I_,nm="flowchart-elk",R_=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),P_=p(async()=>{const{diagram:e}=await import("./flowDiagram-I6XJVG4X-DkYNQv0R.js");return{id:nm,diagram:e}},"loader"),N_={id:nm,detector:R_,loader:P_},q_=N_,lm="timeline",W_=p(e=>/^\s*timeline/.test(e),"detector"),z_=p(async()=>{const{diagram:e}=await import("./timeline-definition-PNZ67QCA-DsVZdrZa.js");return{id:lm,diagram:e}},"loader"),H_={id:lm,detector:W_,loader:z_},Y_=H_,hm="mindmap",U_=p(e=>/^\s*mindmap/.test(e),"detector"),j_=p(async()=>{const{diagram:e}=await import("./mindmap-definition-RKZ34NQL-BmJZpjh6.js");return{id:hm,diagram:e}},"loader"),G_={id:hm,detector:U_,loader:j_},X_=G_,cm="kanban",V_=p(e=>/^\s*kanban/.test(e),"detector"),Z_=p(async()=>{const{diagram:e}=await import("./kanban-definition-UN3LZRKU-CxBCv27E.js");return{id:cm,diagram:e}},"loader"),K_={id:cm,detector:V_,loader:Z_},Q_=K_,um="sankey",J_=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),tB=p(async()=>{const{diagram:e}=await import("./sankeyDiagram-5OEKKPKP-De_o7hDr.js");return{id:um,diagram:e}},"loader"),eB={id:um,detector:J_,loader:tB},rB=eB,dm="packet",iB=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),oB=p(async()=>{const{diagram:e}=await import("./diagram-LMA3HP47-He5zlyMt.js");return{id:dm,diagram:e}},"loader"),sB={id:dm,detector:iB,loader:oB},fm="radar",aB=p(e=>/^\s*radar-beta/.test(e),"detector"),nB=p(async()=>{const{diagram:e}=await import("./diagram-2AECGRRQ-DQTst0OH.js");return{id:fm,diagram:e}},"loader"),lB={id:fm,detector:aB,loader:nB},pm="block",hB=p(e=>/^\s*block(-beta)?/.test(e),"detector"),cB=p(async()=>{const{diagram:e}=await import("./blockDiagram-GPEHLZMM-CAtDjkJt.js");return{id:pm,diagram:e}},"loader"),uB={id:pm,detector:hB,loader:cB},dB=uB,gm="treeView",fB=p(e=>/^\s*treeView-beta/.test(e),"detector"),pB=p(async()=>{const{diagram:e}=await import("./diagram-5GNKFQAL-DoE6q7H1.js");return{id:gm,diagram:e}},"loader"),gB={id:gm,detector:fB,loader:pB},mB=gB,mm="architecture",yB=p(e=>/^\s*architecture/.test(e),"detector"),CB=p(async()=>{const{diagram:e}=await import("./architectureDiagram-3BPJPVTR-CQ09RrbH.js");return{id:mm,diagram:e}},"loader"),xB={id:mm,detector:yB,loader:CB},bB=xB,ym="eventmodeling",kB=p(e=>/^\s*eventmodeling/.test(e),"detector"),wB=p(async()=>{const{diagram:e}=await import("./diagram-KO2AKTUF-CFQs13i5.js");return{id:ym,diagram:e}},"loader"),TB={id:ym,detector:kB,loader:wB},SB=TB,Cm="ishikawa",_B=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),BB=p(async()=>{const{diagram:e}=await import("./ishikawaDiagram-YF4QCWOH-C5OstRVV.js");return{id:Cm,diagram:e}},"loader"),vB={id:Cm,detector:_B,loader:BB},xm="venn",LB=p(e=>/^\s*venn-beta/.test(e),"detector"),FB=p(async()=>{const{diagram:e}=await import("./vennDiagram-CIIHVFJN-BBHQmCFf.js");return{id:xm,diagram:e}},"loader"),AB={id:xm,detector:LB,loader:FB},MB=AB,bm="treemap",EB=p(e=>/^\s*treemap/.test(e),"detector"),$B=p(async()=>{const{diagram:e}=await import("./diagram-OG6HWLK6-DRyxjFMa.js");return{id:bm,diagram:e}},"loader"),OB={id:bm,detector:EB,loader:$B},km="wardley-beta",IB=p(e=>/^\s*wardley-beta/i.test(e),"detector"),DB=p(async()=>{const{diagram:e}=await import("./wardleyDiagram-YWT4CUSO-DCiyDQNB.js");return{id:km,diagram:e}},"loader"),RB={id:km,detector:IB,loader:DB},PB=RB,hc=!1,Fs=p(()=>{hc||(hc=!0,Po("error",D_,e=>e.toLowerCase().trim()==="error"),Po("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ua(q_,X_,bB),ua(SS,Q_,b_,m_,DS,YS,GS,ZS,l_,d_,ES,LS,Y_,qS,L_,S_,E_,t_,rB,sB,o_,dB,SB,mB,lB,vB,OB,MB,PB))},"addDiagrams"),NB=p(async()=>{N.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(yr).map(async([r,{detector:i,loader:o}])=>{if(o)try{ma(r)}catch{try{const{diagram:s,id:a}=await o();Po(a,s,i)}catch(s){throw N.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete yr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){N.error(`Failed to load ${t.length} external diagrams`);for(const r of t)N.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),qB="graphics-document document";function wm(e,t){e.attr("role",qB),t!==""&&e.attr("aria-roledescription",t)}p(wm,"setA11yDiagramInfo");function Tm(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(Tm,"addSVGa11yTitleDescription");var ln=class Sm{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{p(this,"Diagram")}static async fromText(t,r={}){const i=_t(),o=un(t,i);t=C2(t)+` +`;try{ma(o)}catch{const c=Oy(o);if(!c)throw new kc(`Diagram ${o} not found.`);const{id:h,diagram:u}=await c();Po(h,u)}const{db:s,parser:a,renderer:n,init:l}=ma(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Sm(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},cc=[],WB=p(()=>{cc.forEach(e=>{e()}),cc=[]},"attachFunctions"),zB=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function _m(e){const t=e.match(bc);if(!t)return{text:e,metadata:{}};let r=kk(t[1],{schema:bk})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}p(_m,"extractFrontMatter");var HB=p(e=>e.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),YB=p(e=>{const{text:t,metadata:r}=_m(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),UB=p(e=>{const t=pe.detectInit(e)??{},r=pe.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:s2(e),directive:t}},"processDirectives");function cl(e){const t=HB(e),r=YB(t),i=UB(r.text),o=jn(r.config,i.directive);return e=zB(i.text),{code:e,title:r.title,config:o}}p(cl,"preprocessDiagram");function Bm(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(Bm,"toBase64");var jB=5e4,GB="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",XB="sandbox",VB="loose",ZB="http://www.w3.org/2000/svg",KB="http://www.w3.org/1999/xlink",QB="http://www.w3.org/1999/xhtml",JB="100%",tv="100%",ev="border:0;margin:0;",rv="margin:0",iv="allow-top-navigation-by-user-activation allow-popups",ov='The "iframe" tag is not supported by your browser.',sv=["foreignobject"],av=["dominant-baseline"];function ul(e){const t=cl(e);return Do(),n0(t.config??{}),t}p(ul,"processAndSetConfigs");async function vm(e,t){Fs();try{const{code:r,config:i}=ul(e);return{diagramType:(await Fm(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(vm,"parse");var uc=p((e,t,r=[])=>{const i=Bc(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),nv=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=Zt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{_h(l.styles)||n.forEach(c=>{r.insertRule(uc(l.id,c,l.styles),r.cssRules.length)}),_h(l.textStyles)||r.insertRule(uc(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=ga(o)+` +`}else i+=`${e.themeCSS} +`;return i+ga(r)},"createCssStyles"),lv=p((e,t)=>nn(yS(`${e}{${t}}`),bS([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===on)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[iS,sS,Ng,nS,"@container","@starting-style"],on].includes(i.type)||(N.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=ll))},"addNamespace"),xS])),"compileCSS"),hv=p((e,t,r,i)=>{const o=nv(e,r),s=B0(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return lv(i,s)},"createUserStyles"),cv=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=kr(i),i=i.replace(/
      /g,"
      "),i},"cleanUpSvgCode"),uv=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":tv,i=Bm(`${e}`);return``},"putIntoIFrame"),dc=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",ZB);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function hn(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(hn,"sandboxedIframe");var dv=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),fv=p(async function(e,t,r){Fs();const i=ul(t);t=i.code;const o=_t();N.debug(o),t.length>(o?.maxTextSize??jB)&&(t=GB);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const W=ht(f?n:c).node();W&&"remove"in W&&W.remove()},"removeTempElements");let u=ht(document.body);const f=o.securityLevel===XB,d=o.securityLevel===VB,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const H=hn(ht(r),a);u=ht(H.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=ht(r);dc(u,e,l,`font-family: ${g}`,KB)}else{if(dv(document,e,l,a),f){const H=hn(ht(document.body),a);u=ht(H.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=ht("body");dc(u,e,l)}let m,y;try{m=await ln.fromText(t,{title:i.title})}catch(H){if(o.suppressErrorRendering)throw h(),H;m=await ln.fromText("error"),y=H}const C=u.select(c).node(),b=m.type,k=C.firstChild,T=k.firstChild,S=m.renderer.getClasses?.(t,m),_=hv(o,b,S,s),M=document.createElement("style");M.innerHTML=_,k.insertBefore(M,T);try{await m.renderer.draw(t,e,"11.15.0",m)}catch(H){throw o.suppressErrorRendering?h():O_.draw(t,e,"11.15.0"),H}const v=u.select(`${c} svg`),q=m.db.getAccTitle?.(),I=m.db.getAccDescription?.();Am(b,v,q,I),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",QB);let R=u.select(c).node().innerHTML;if(N.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),R=cv(R,f,Ue(o.arrowMarkerAbsolute)),f){const H=u.select(c+" svg").node();R=uv(R,H)}else d||(R=jr.sanitize(R,{ADD_TAGS:sv,ADD_ATTR:av,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(WB(),y)throw y;return h(),{diagramType:b,svg:R,bindFunctions:m.db.bindFunctions}},"render");function Lm(e={}){const t=$t({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),s0(t),t?.theme&&t.theme in qe?t.themeVariables=qe[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=qe.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?o0(t):vc();cn(r.logLevel),Fs()}p(Lm,"initialize");var Fm=p((e,t={})=>{const{code:r}=cl(e);return ln.fromText(r,t)},"getDiagramFromText");function Am(e,t,r,i){wm(t,e),Tm(t,r,i,t.attr("id"))}p(Am,"addA11yInfo");var Tr=Object.freeze({render:fv,parse:vm,getDiagramFromText:Fm,initialize:Lm,getConfig:_t,setConfig:Lc,getSiteConfig:vc,updateSiteConfig:a0,reset:p(()=>{Do()},"reset"),globalReset:p(()=>{Do(Gr)},"globalReset"),defaultConfig:Gr});cn(_t().logLevel);Do(_t());var pv=p((e,t,r)=>{N.warn(e),Un(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Mm=p(async function(e={querySelector:".mermaid"}){try{await gv(e)}catch(t){if(Un(t)&&N.error(t.str),Ye.parseError&&Ye.parseError(t),!e.suppressErrors)throw N.error("Use the suppressErrors option to suppress these errors"),t}},"run"),gv=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Tr.getConfig();N.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");N.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(N.debug("Start On Load: "+i?.startOnLoad),Tr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new pe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(N.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Yf(pe.entityDecode(a)).trim().replace(//gi,"
      ");const h=pe.detectInit(a);h&&N.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:f}=await Im(c,a,l);l.innerHTML=u,e&&await e(c),f&&f(l)}catch(u){pv(u,n,Ye.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Em=p(function(e){Tr.initialize(e)},"initialize"),mv=p(async function(e,t,r){N.warn("mermaid.init is deprecated. Please use run instead."),e&&Em(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Mm(i)},"init"),yv=p(async(e,{lazyLoad:t=!0}={})=>{Fs(),ua(...e),t===!1&&await NB()},"registerExternalDiagrams"),$m=p(function(){if(Ye.startOnLoad){const{startOnLoad:e}=Tr.getConfig();e&&Ye.run().catch(t=>N.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",$m,!1);var Cv=p(function(e){Ye.parseError=e},"setParseErrorHandler"),cs=[],aa=!1,Om=p(async()=>{if(!aa){for(aa=!0;cs.length>0;){const e=cs.shift();if(e)try{await e()}catch(t){N.error("Error executing queue",t)}}aa=!1}},"executeQueue"),xv=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Tr.parse(e,t).then(n=>{s(n),r(n)},n=>{N.error("Error parsing",n),Ye.parseError?.(n),a(n),i(n)})}),"performCall");cs.push(o),Om().catch(i)}),"parse"),Im=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Tr.render(e,t,r).then(l=>{a(l),i(l)},l=>{N.error("Error parsing",l),Ye.parseError?.(l),n(l),o(l)})}),"performCall");cs.push(s),Om().catch(o)}),"render"),bv=p(()=>Object.keys(yr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ye={startOnLoad:!0,mermaidAPI:Tr,parse:xv,render:Im,init:mv,run:Mm,registerExternalDiagrams:yv,registerLayoutLoaders:Dg,initialize:Em,parseError:void 0,contentLoaded:$m,setParseErrorHandler:Cv,detectType:un,registerIconPacks:_w,getRegisteredDiagramsMetadata:bv},fc=Ye;/*! Check if previously processed *//*! + * Wait for document loaded before starting the execution + */function kv(e){var t;for(const r of e.split(/\r?\n/)){const i=r.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function wv(e,t){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(e.slice(Math.max(0,t-12),t))}function Dm(e){return e.includes("->")||e.includes("-->")||e.includes("->>")||e.includes("-->>")||e.includes("-x")||e.includes("--x")||e.includes("-)")||e.includes("--)")||e.includes("-+")||e.includes("--+")}function Tv(e){const t=e.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(t)||(function(r){const i=r.split(";",1)[0],o=i.indexOf(":");return o>0&&Dm(i.slice(0,o))})(t)}function Sv(e){if(!e.includes(";"))return e;const t=e.indexOf(":");if(t===-1||!(function(s,a){const n=s.slice(0,a);return/^\s*Note\b/i.test(n)||Dm(n)})(e,t))return e;const r=e.slice(0,t+1),i=e.slice(t+1),o=(function(s){let a="",n=!1;for(let l=0;lnew Promise((i,o)=>{var s=l=>{try{n(r.next(l))}catch(c){o(c)}},a=l=>{try{n(r.throw(l))}catch(c){o(c)}},n=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,a);n((r=r.apply(e,t)).next())}),la,xo,vv=(la={"workers/mermaidParser.worker.js"(e){function t(r,i){return na(this,null,function*(){var o,s;const a=(function(l,c){const h=`%%{init: {"theme": "${c==="dark"?"dark":"default"}"}}%% +`;return l.trimStart().startsWith("%%{")?l:h+l})(r,i),n=fc;if(typeof n.parse=="function"){try{yield(o=n.parse)==null?void 0:o.call(n,a)}catch(l){const c=_v(a);if(c===a)throw l;yield(s=n.parse)==null?void 0:s.call(n,c)}return!0}throw new Error("mermaid.parse not available in worker")})}fc.initialize({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}}),self.onmessage=r=>na(null,null,function*(){var i;const o=r.data,s=n=>self.postMessage(n),a=o.id;try{if(o.action==="canParse")return void s({id:a,ok:!0,result:yield t(o.payload.code,o.payload.theme)});if(o.action==="findPrefix")return void s({id:a,ok:!0,result:yield(function(n,l){return na(this,null,function*(){const c=n.split(` +`),h=(function(y){const C=/^(?:graph|flowchart|flowchart\s+tb|flowchart\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\b/;for(let b=0;b= 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()+` +`+i+"^"},"showPosition"),test_match:l(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;ri[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var i=this.next();return i||this.lex()},"lex"),begin:l(function(i){this.conditionStack.push(i)},"begin"),popState:l(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:l(function(i){this.begin(i)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D})();j.lexer=te;function P(){this.yy={}}return l(P,"Parser"),P.prototype=j,j.Parser=P,new P})();Y.parser=Y;var be=Y,ke=12,N={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Se=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{l(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let n=this.nodes.length-1;n>=0;n--)if(this.nodes[n].level0?this.nodes[0]:null}addNode(e,n,g,a){C.info("addNode",e,n,g,a);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);const h=B();let f=h.mindmap?.padding??G.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}const m={id:this.count++,nodeId:F(n,h),level:e,descr:F(g,h),type:a,children:[],width:h.mindmap?.maxNodeWidth??G.mindmap.maxNodeWidth,padding:f,isRoot:t},_=this.getParent(e);if(_)_.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,n){switch(C.debug("In get type",e,n),e){case"[":return this.nodeType.RECT;case"(":return n===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,n){this.elements[e]=n}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const n=B(),g=this.nodes[this.nodes.length-1];e.icon&&(g.icon=F(e.icon,n)),e.class&&(g.class=F(e.class,n))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,n){if(e.level===0?e.section=void 0:e.section=n,e.children)for(const[g,a]of e.children.entries()){const t=e.level===0?g%(ke-1):n;this.assignSections(a,t)}}flattenNodes(e,n){const g=B(),a=["mindmap-node"];e.isRoot===!0?a.push("section-root","section--1"):e.section!==void 0&&a.push(`section-${e.section}`),e.class&&a.push(e.class);const t=a.join(" "),h=l(m=>{const T=(g.theme?.toLowerCase()??"").includes("redux");switch(m){case N.CIRCLE:return"mindmapCircle";case N.RECT:return"rect";case N.ROUNDED_RECT:return"rounded";case N.CLOUD:return"cloud";case N.BANG:return"bang";case N.HEXAGON:return"hexagon";case N.DEFAULT:return T?"rounded":"defaultMindmapNode";case N.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:h(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:g.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(f),e.children)for(const m of e.children)this.flattenNodes(m,n)}generateEdges(e,n){if(!e.children)return;const g=B();for(const a of e.children){let t="edge";a.section!==void 0&&(t+=` section-edge-${a.section}`);const h=e.level+1;t+=` edge-depth-${h}`;const f={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:g.look,classes:t,depth:e.level,section:a.section};n.push(f),this.generateEdges(a,n)}}getData(){const e=this.getMindmap(),n=B(),a=de().layout!==void 0,t=n;if(a||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};C.debug("getData: mindmapRoot",e,n),this.assignSections(e);const h=[],f=[];this.flattenNodes(e,h),this.generateEdges(e,f),C.debug(`getData: processed ${h.length} nodes and ${f.length} edges`);const m=new Map;for(const _ of h)m.set(_.id,{shape:_.shape,width:_.width,height:_.height,padding:_.padding});return{nodes:h,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+Ee()}}getLogger(){return C}},xe=l(async(e,n,g,a)=>{C.debug(`Rendering mindmap diagram +`+e);const t=a.db,h=t.getData(),f=oe(n,h.config.securityLevel);if(h.type=a.type,h.layoutAlgorithm=ce(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=n,!t.getMindmap())return;h.nodes.forEach(d=>{d.shape==="rounded"?(d.radius=15,d.taper=15,d.stroke="none",d.width=0,d.padding=15):d.shape==="circle"?d.padding=10:d.shape==="rect"?(d.width=0,d.padding=10):d.shape==="hexagon"&&(d.width=0,d.height=0)}),await le(h,f);const{themeVariables:_}=he(),{useGradient:T,gradientStart:I,gradientStop:w}=_;if(T&&I&&w){const d=f.attr("id"),R=f.append("defs").append("linearGradient").attr("id",`${d}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",I).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",w).attr("stop-opacity",1)}ae(f,h.config.mindmap?.padding??G.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??G.mindmap.useMaxWidth)},"draw"),Ne={draw:xe},De=l(e=>{const{theme:n,look:g}=e;let a="";for(let t=0;t{let a="";for(let t=0;t{const{theme:n}=e,g=e.svgId,a=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${g}-drop-shadow)`):"none";return` + .edge { + stroke-width: 3; + } + ${De(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .section-root span { + color: ${n?.includes("redux")?e.nodeBorder:e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + [data-look="neo"].mindmap-node { + filter: ${a}; + } + [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { + fill: ${n?.includes("redux")?e.mainBkg:e.git0}; + } + [data-look="neo"].mindmap-node.section-root .text-inner-tspan { + fill: ${n?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:0)]}; + } + ${e.useGradient&&g&&e.mainBkg?Le(e.THEME_COLOR_LIMIT,g,e.mainBkg):""} +`},"getStyles"),Te=ve,Re={get db(){return new Se},renderer:Ne,parser:be,styles:Te};export{Re as diagram}; diff --git a/apps/kimi-code/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js b/apps/kimi-code/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js new file mode 100644 index 0000000000..64a4f6f63c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js @@ -0,0 +1,96 @@ +import{g as oe}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as ae}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as l,l as C,o as ce,r as le,D as he,G,c as B,i as F,b3 as de,V as ge,W as ue,X as pe}from"./mermaidParser.worker-Dx4jPi9z.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,X,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 z="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?z="Parse error on line "+(M+1)+`: +`+y.showPosition()+` +Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":z="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(z,{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]]),X=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof X<"u")return X;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()+` +`+i+"^"},"showPosition"),test_match:l(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;ri[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var i=this.next();return i||this.lex()},"lex"),begin:l(function(i){this.conditionStack.push(i)},"begin"),popState:l(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:l(function(i){this.begin(i)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D})();j.lexer=te;function P(){this.yy={}}return l(P,"Parser"),P.prototype=j,j.Parser=P,new P})();Y.parser=Y;var be=Y,ke=12,N={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Se=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{l(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let n=this.nodes.length-1;n>=0;n--)if(this.nodes[n].level0?this.nodes[0]:null}addNode(e,n,g,a){C.info("addNode",e,n,g,a);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);const h=B();let f=h.mindmap?.padding??G.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}const m={id:this.count++,nodeId:F(n,h),level:e,descr:F(g,h),type:a,children:[],width:h.mindmap?.maxNodeWidth??G.mindmap.maxNodeWidth,padding:f,isRoot:t},_=this.getParent(e);if(_)_.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,n){switch(C.debug("In get type",e,n),e){case"[":return this.nodeType.RECT;case"(":return n===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,n){this.elements[e]=n}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const n=B(),g=this.nodes[this.nodes.length-1];e.icon&&(g.icon=F(e.icon,n)),e.class&&(g.class=F(e.class,n))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,n){if(e.level===0?e.section=void 0:e.section=n,e.children)for(const[g,a]of e.children.entries()){const t=e.level===0?g%(ke-1):n;this.assignSections(a,t)}}flattenNodes(e,n){const g=B(),a=["mindmap-node"];e.isRoot===!0?a.push("section-root","section--1"):e.section!==void 0&&a.push(`section-${e.section}`),e.class&&a.push(e.class);const t=a.join(" "),h=l(m=>{const T=(g.theme?.toLowerCase()??"").includes("redux");switch(m){case N.CIRCLE:return"mindmapCircle";case N.RECT:return"rect";case N.ROUNDED_RECT:return"rounded";case N.CLOUD:return"cloud";case N.BANG:return"bang";case N.HEXAGON:return"hexagon";case N.DEFAULT:return T?"rounded":"defaultMindmapNode";case N.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:h(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:g.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(f),e.children)for(const m of e.children)this.flattenNodes(m,n)}generateEdges(e,n){if(!e.children)return;const g=B();for(const a of e.children){let t="edge";a.section!==void 0&&(t+=` section-edge-${a.section}`);const h=e.level+1;t+=` edge-depth-${h}`;const f={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:g.look,classes:t,depth:e.level,section:a.section};n.push(f),this.generateEdges(a,n)}}getData(){const e=this.getMindmap(),n=B(),a=de().layout!==void 0,t=n;if(a||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};C.debug("getData: mindmapRoot",e,n),this.assignSections(e);const h=[],f=[];this.flattenNodes(e,h),this.generateEdges(e,f),C.debug(`getData: processed ${h.length} nodes and ${f.length} edges`);const m=new Map;for(const _ of h)m.set(_.id,{shape:_.shape,width:_.width,height:_.height,padding:_.padding});return{nodes:h,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+Ee()}}getLogger(){return C}},xe=l(async(e,n,g,a)=>{C.debug(`Rendering mindmap diagram +`+e);const t=a.db,h=t.getData(),f=oe(n,h.config.securityLevel);if(h.type=a.type,h.layoutAlgorithm=ce(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=n,!t.getMindmap())return;h.nodes.forEach(d=>{d.shape==="rounded"?(d.radius=15,d.taper=15,d.stroke="none",d.width=0,d.padding=15):d.shape==="circle"?d.padding=10:d.shape==="rect"?(d.width=0,d.padding=10):d.shape==="hexagon"&&(d.width=0,d.height=0)}),await le(h,f);const{themeVariables:_}=he(),{useGradient:T,gradientStart:I,gradientStop:w}=_;if(T&&I&&w){const d=f.attr("id"),R=f.append("defs").append("linearGradient").attr("id",`${d}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",I).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",w).attr("stop-opacity",1)}ae(f,h.config.mindmap?.padding??G.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??G.mindmap.useMaxWidth)},"draw"),Ne={draw:xe},De=l(e=>{const{theme:n,look:g}=e;let a="";for(let t=0;t{let a="";for(let t=0;t{const{theme:n}=e,g=e.svgId,a=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${g}-drop-shadow)`):"none";return` + .edge { + stroke-width: 3; + } + ${De(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .section-root span { + color: ${n?.includes("redux")?e.nodeBorder:e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + [data-look="neo"].mindmap-node { + filter: ${a}; + } + [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { + fill: ${n?.includes("redux")?e.mainBkg:e.git0}; + } + [data-look="neo"].mindmap-node.section-root .text-inner-tspan { + fill: ${n?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:0)]}; + } + ${e.useGradient&&g&&e.mainBkg?Le(e.THEME_COLOR_LIMIT,g,e.mainBkg):""} +`},"getStyles"),Te=ve,we={get db(){return new Se},renderer:Ne,parser:be,styles:Te};export{we as diagram}; diff --git a/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js b/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js new file mode 100644 index 0000000000..c16411eea4 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js @@ -0,0 +1,30 @@ +import{ab as S,a3 as R,b2 as K,g as Q,s as Y,a as tt,b as et,q as at,p as nt,_ as d,l as z,c as rt,F as it,I as st,N as ot,e as lt,z as ct,G as ut}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as dt}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as pt}from"./wardley-L42UT6IY-BJFn8eDD.js";import{d as P}from"./arc-Doj0wRZ0.js";import{o as gt}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function ft(t,a){return at?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(R),p=S(0);function o(e){var r,l=(e=K(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=D*(w<0?-1:1),u;for(r=0;r0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),r=0,h=v?(w-l*$)/v:0;r0?u*h:0)+$,i[g]={data:e[g],index:r,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:S(+e),o):p},o}var vt=ut.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=new Map,W=F.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Ct=d(t=>{W=t},"setShowData"),Dt=d(()=>W,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:nt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:Q,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(async t=>{const a=await pt("pie",t);z.debug(a),$t(a,_)},"parse")},bt=d(t=>` + .pieCircle{ + stroke: ${t.pieStrokeColor}; + stroke-width : ${t.pieStrokeWidth}; + opacity : ${t.pieOpacity}; + } + .pieOuterCircle{ + stroke: ${t.pieOuterStrokeColor}; + stroke-width: ${t.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${t.pieTitleTextSize}; + fill: ${t.pieTitleTextColor}; + font-family: ${t.fontFamily}; + } + .slice { + font-family: ${t.fontFamily}; + fill: ${t.pieSectionTextColor}; + font-size:${t.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${t.pieLegendTextColor}; + font-family: ${t.fontFamily}; + font-size: ${t.pieLegendTextSize}; + } +`,"getStyles"),kt=bt,Et=d(t=>{const a=[...t.values()].reduce((s,p)=>s+p,0),f=[...t.entries()].map(([s,p])=>({label:s,value:p})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Mt=d((t,a,f,y)=>{z.debug(`rendering pie chart +`+t);const s=y.db,p=rt(),o=it(s.getConfig(),p.pie),e=40,r=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=p;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,D=P().innerRadius(0).outerRadius(m),$=P().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Et(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(n=>{b+=n});const G=A.filter(n=>(n.data.value/b*100).toFixed(0)!=="0"),k=gt(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",n=>k(n.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(n=>(n.data.value/b*100).toFixed(0)+"%").attr("transform",n=>"translate("+$.centroid(n)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([n,M])=>({label:n,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(n,M)=>{const O=r+l,Z=O*N.length/2,H=12*r,J=M*O-Z;return"translate("+H+","+J+")"});E.append("rect").attr("width",r).attr("height",r).style("fill",n=>k(n.label)).style("stroke",n=>k(n.label)),E.append("text").attr("x",r+l).attr("y",r-l).text(n=>s.getShowData()?`${n.label} [${n.value}]`:n.label);const U=Math.max(...E.selectAll("text").nodes().map(n=>n?.getBoundingClientRect().width??0)),j=h+e+r+l+U,L=V.node()?.getBoundingClientRect().width??0,q=h/2-L/2,X=h/2+L/2,B=Math.min(0,q),I=Math.max(j,X)-B;v.attr("viewBox",`${B} 0 ${I} ${g}`),lt(v,g,I,o.useMaxWidth)},"draw"),Rt={draw:Mt},It={parser:Tt,db:_,renderer:Rt,styles:kt};export{It as diagram}; diff --git a/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-DA34Bt67.js b/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-DA34Bt67.js new file mode 100644 index 0000000000..e673f01a1e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/pieDiagram-4H26LBE5-DA34Bt67.js @@ -0,0 +1,30 @@ +import{Y as S,a1 as R,b2 as J,g as K,s as Q,a as tt,b as et,q as at,p as rt,_ as p,l as z,c as nt,F as it,I as st,N as ot,e as lt,z as ct,G as ut}from"./mermaid.core-zKrc8Ye9.js";import{p as pt}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{p as dt}from"./wardley-L42UT6IY-gSV1j6uw.js";import{d as P}from"./arc-DtCnpCZe.js";import{o as gt}from"./ordinal-Cboi1Yqb.js";import"./index-DtRfJ0vw.js";import"./init-Gi6I4Gst.js";function ft(t,a){return at?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(R),d=S(0);function o(e){var n,l=(e=J(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,d.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n0?u*h:0)+$,i[g]={data:e[g],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(d=typeof e=="function"?e:S(+e),o):d},o}var vt=ut.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,xt=structuredClone(vt),St=p(()=>structuredClone(xt),"getConfig"),yt=p(()=>{T=new Map,W=F.showData,ct()},"clear"),wt=p(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=p(()=>T,"getSections"),Ct=p(t=>{W=t},"setShowData"),Dt=p(()=>W,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:rt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Q,getAccDescription:K,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=p((t,a)=>{pt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:p(async t=>{const a=await dt("pie",t);z.debug(a),$t(a,_)},"parse")},bt=p(t=>` + .pieCircle{ + stroke: ${t.pieStrokeColor}; + stroke-width : ${t.pieStrokeWidth}; + opacity : ${t.pieOpacity}; + } + .pieOuterCircle{ + stroke: ${t.pieOuterStrokeColor}; + stroke-width: ${t.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${t.pieTitleTextSize}; + fill: ${t.pieTitleTextColor}; + font-family: ${t.fontFamily}; + } + .slice { + font-family: ${t.fontFamily}; + fill: ${t.pieSectionTextColor}; + font-size:${t.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${t.pieLegendTextColor}; + font-family: ${t.fontFamily}; + font-size: ${t.pieLegendTextSize}; + } +`,"getStyles"),kt=bt,Et=p(t=>{const a=[...t.values()].reduce((s,d)=>s+d,0),f=[...t.entries()].map(([s,d])=>({label:s,value:d})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Mt=p((t,a,f,y)=>{z.debug(`rendering pie chart +`+t);const s=y.db,d=nt(),o=it(s.getConfig(),d.pie),e=40,n=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=d;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,D=P().innerRadius(0).outerRadius(m),$=P().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Et(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(r=>{b+=r});const G=A.filter(r=>(r.data.value/b*100).toFixed(0)!=="0"),k=gt(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",r=>k(r.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(r=>(r.data.value/b*100).toFixed(0)+"%").attr("transform",r=>"translate("+$.centroid(r)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([r,M])=>({label:r,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(r,M)=>{const O=n+l,Y=O*N.length/2,Z=12*n,H=M*O-Y;return"translate("+Z+","+H+")"});E.append("rect").attr("width",n).attr("height",n).style("fill",r=>k(r.label)).style("stroke",r=>k(r.label)),E.append("text").attr("x",n+l).attr("y",n-l).text(r=>s.getShowData()?`${r.label} [${r.value}]`:r.label);const U=Math.max(...E.selectAll("text").nodes().map(r=>r?.getBoundingClientRect().width??0)),j=h+e+n+l+U,L=V.node()?.getBoundingClientRect().width??0,q=h/2-L/2,X=h/2+L/2,B=Math.min(0,q),I=Math.max(j,X)-B;v.attr("viewBox",`${B} 0 ${I} ${g}`),lt(v,g,I,o.useMaxWidth)},"draw"),Rt={draw:Mt},Ot={parser:Tt,db:_,renderer:Rt,styles:kt};export{Ot as diagram}; diff --git a/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js b/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js new file mode 100644 index 0000000000..22bcfe5294 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js @@ -0,0 +1,7 @@ +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,d as vt,e as Pe,z as ve,G as z,i as Ce,K as Le}from"./mermaidParser.worker-Dx4jPi9z.js";import{l as te}from"./linear-3mB6q2-g.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CCNgq9ws.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],H=[1,63],X=[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],Ht=[1,73],Xt=[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:H,10:y,12:T,13:q,14:g,15:k,18:X,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:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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:H,10:y,12:T,13:q,14:g,15:k,18:X,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:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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:Ht,12:Xt,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:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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()+` +`+l+"^"},"showPosition"),test_match:r(function(s,l){var u,d,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),d=s[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in A)this[e]=A[e];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),e=0;el[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(s=this.test_match(u,A[e]),s!==!1)return s;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(s=this.test_match(l,A[d]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){var l=this.next();return l||this.lex()},"lex"),begin:r(function(l){this.conditionStack.push(l)},"begin"),popState:r(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:r(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:r(function(l){this.begin(l)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(l,u,d,A){switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();_t.lexer=ye;function ft(){this.yy={}}return r(ft,"Parser"),ft.prototype=_t,_t.Parser=ft,new ft})();Ct.parser=Ct;var Ee=Ct,I=Le(),De=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{r(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,qt.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){qt.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){qt.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){const o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,S={top:f?c:0},m=this.config.quadrantPadding+h.left,b=this.config.quadrantPadding+x.top+S.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,T=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-S.top,q=y/2,g=T/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:S,quadrantSpace:{quadrantLeft:m,quadrantTop:b,quadrantWidth:y,quadrantHalfWidth:q,quadrantHeight:T,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){const{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:S,quadrantTop:m,quadrantWidth:b}=o,y=!!this.data.xAxisRightText,T=!!this.data.yAxisTopText,q=[];return this.data.xAxisLeftText&&a&&q.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&q.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+S+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&q.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+h-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&q.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+_-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),q}getQuadrants(t){const{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x,width:o,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(const h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){const{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=te().domain([0,1]).range([f,x+f]),h=te().domain([0,1]).range([p+o,o]);return this.data.points.map(S=>{const m=this.classes.get(S.className);return m&&(S={...m,...S}),{x:_(S.x),y:h(S.y),fill:S.color??this.themeConfig.quadrantPointFill,radius:S.radius??this.config.pointRadius,text:{text:S.text,fill:this.themeConfig.quadrantPointTextFill,x:_(S.x),y:h(S.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:S.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:S.strokeWidth??"0px"}})}getBorders(t){const a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},Tt=class extends Error{static{r(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Lt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}r(Lt,"validateHexCode");function ie(t){return!/^\d+$/.test(t)}r(ie,"validateNumber");function ae(t){return!/^\d+px$/.test(t)}r(ae,"validateSizeInPixels");var ze=Et();function O(t){return Ce(t.trim(),ze)}r(O,"textSanitizer");var V=new De;function ne(t){V.setData({quadrant1Text:O(t.text)})}r(ne,"setQuadrant1Text");function se(t){V.setData({quadrant2Text:O(t.text)})}r(se,"setQuadrant2Text");function re(t){V.setData({quadrant3Text:O(t.text)})}r(re,"setQuadrant3Text");function oe(t){V.setData({quadrant4Text:O(t.text)})}r(oe,"setQuadrant4Text");function le(t){V.setData({xAxisLeftText:O(t.text)})}r(le,"setXAxisLeftText");function he(t){V.setData({xAxisRightText:O(t.text)})}r(he,"setXAxisRightText");function ce(t){V.setData({yAxisTopText:O(t.text)})}r(ce,"setYAxisTopText");function de(t){V.setData({yAxisBottomText:O(t.text)})}r(de,"setYAxisBottomText");function mt(t){const a={};for(const p of t){const[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(ie(o))throw new Tt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Lt(o))throw new Tt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Lt(o))throw new Tt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(ae(o))throw new Tt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}r(mt,"parseStyles");function ue(t,a,p,f,o){const x=mt(o);V.addPoints([{x:p,y:f,text:O(t.text),className:a,...x}])}r(ue,"addPoint");function xe(t,a){V.addClass(t,mt(a))}r(xe,"addClass");function fe(t){V.setConfig({chartWidth:t})}r(fe,"setWidth");function ge(t){V.setConfig({chartHeight:t})}r(ge,"setHeight");function pe(){const t=Et(),{themeVariables:a,quadrantChart:p}=t;return p&&V.setConfig(p),V.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),V.setData({titleText:ee()}),V.build()}r(pe,"getQuadrantData");var Ve=r(function(){V.clear(),ve()},"clear"),Ie={setWidth:fe,setHeight:ge,setQuadrant1Text:ne,setQuadrant2Text:se,setQuadrant3Text:re,setQuadrant4Text:oe,setXAxisLeftText:le,setXAxisRightText:he,setYAxisTopText:ce,setYAxisBottomText:de,parseStyles:mt,addPoint:ue,addClass:xe,getQuadrantData:pe,clear:Ve,setAccTitle:Fe,getAccTitle:ke,setDiagramTitle:Ae,getDiagramTitle:ee,getAccDescription:_e,setAccDescription:Se},we=r((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}r(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}r(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}r(_,"getTransformation");const h=Et();qt.debug(`Rendering quadrant chart +`+t);const c=h.securityLevel;let S;c==="sandbox"&&(S=vt("#i"+a));const b=(c==="sandbox"?vt(S.nodes()[0].contentDocument.body):vt("body")).select(`[id="${a}"]`),y=b.append("g").attr("class","main"),T=h.quadrantChart?.chartWidth??500,q=h.quadrantChart?.chartHeight??500;Pe(b,q,T,h.quadrantChart?.useMaxWidth??!0),b.attr("viewBox","0 0 "+T+" "+q),f.db.setHeight(q),f.db.setWidth(T);const g=f.db.getQuadrantData(),k=y.append("g").attr("class","quadrants"),ct=y.append("g").attr("class","border"),dt=y.append("g").attr("class","data-points"),ut=y.append("g").attr("class","labels"),xt=y.append("g").attr("class","title");g.title&&xt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&ct.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ot=k.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),ut.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));const lt=dt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),Be={draw:we},Qe={parser:Ee,db:Ie,renderer:Be,styles:r(()=>"","styles")};export{Qe as diagram}; diff --git a/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-DToe-wqP.js b/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-DToe-wqP.js new file mode 100644 index 0000000000..01a90eb164 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/quadrantDiagram-W4KKPZXB-DToe-wqP.js @@ -0,0 +1,7 @@ +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,d as vt,e as Pe,z as ve,G as z,i as Ce,K as Le}from"./mermaid.core-zKrc8Ye9.js";import{l as te}from"./linear-JZGc9yht.js";import"./index-DtRfJ0vw.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],H=[1,63],X=[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],Ht=[1,73],Xt=[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:H,10:y,12:T,13:q,14:g,15:k,18:X,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:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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:H,10:y,12:T,13:q,14:g,15:k,18:X,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:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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:Ht,12:Xt,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:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,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()+` +`+l+"^"},"showPosition"),test_match:r(function(s,l){var u,d,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),d=s[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in A)this[e]=A[e];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),e=0;el[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(s=this.test_match(u,A[e]),s!==!1)return s;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(s=this.test_match(l,A[d]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){var l=this.next();return l||this.lex()},"lex"),begin:r(function(l){this.conditionStack.push(l)},"begin"),popState:r(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:r(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:r(function(l){this.begin(l)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(l,u,d,A){switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();_t.lexer=ye;function ft(){this.yy={}}return r(ft,"Parser"),ft.prototype=_t,_t.Parser=ft,new ft})();Ct.parser=Ct;var Ee=Ct,I=Le(),De=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{r(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,qt.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){qt.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){qt.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){const o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,S={top:f?c:0},m=this.config.quadrantPadding+h.left,b=this.config.quadrantPadding+x.top+S.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,T=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-S.top,q=y/2,g=T/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:S,quadrantSpace:{quadrantLeft:m,quadrantTop:b,quadrantWidth:y,quadrantHalfWidth:q,quadrantHeight:T,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){const{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:S,quadrantTop:m,quadrantWidth:b}=o,y=!!this.data.xAxisRightText,T=!!this.data.yAxisTopText,q=[];return this.data.xAxisLeftText&&a&&q.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&q.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+S+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&q.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+h-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&q.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+_-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),q}getQuadrants(t){const{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x,width:o,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(const h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){const{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=te().domain([0,1]).range([f,x+f]),h=te().domain([0,1]).range([p+o,o]);return this.data.points.map(S=>{const m=this.classes.get(S.className);return m&&(S={...m,...S}),{x:_(S.x),y:h(S.y),fill:S.color??this.themeConfig.quadrantPointFill,radius:S.radius??this.config.pointRadius,text:{text:S.text,fill:this.themeConfig.quadrantPointTextFill,x:_(S.x),y:h(S.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:S.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:S.strokeWidth??"0px"}})}getBorders(t){const a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},Tt=class extends Error{static{r(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Lt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}r(Lt,"validateHexCode");function ie(t){return!/^\d+$/.test(t)}r(ie,"validateNumber");function ae(t){return!/^\d+px$/.test(t)}r(ae,"validateSizeInPixels");var ze=Et();function O(t){return Ce(t.trim(),ze)}r(O,"textSanitizer");var V=new De;function ne(t){V.setData({quadrant1Text:O(t.text)})}r(ne,"setQuadrant1Text");function se(t){V.setData({quadrant2Text:O(t.text)})}r(se,"setQuadrant2Text");function re(t){V.setData({quadrant3Text:O(t.text)})}r(re,"setQuadrant3Text");function oe(t){V.setData({quadrant4Text:O(t.text)})}r(oe,"setQuadrant4Text");function le(t){V.setData({xAxisLeftText:O(t.text)})}r(le,"setXAxisLeftText");function he(t){V.setData({xAxisRightText:O(t.text)})}r(he,"setXAxisRightText");function ce(t){V.setData({yAxisTopText:O(t.text)})}r(ce,"setYAxisTopText");function de(t){V.setData({yAxisBottomText:O(t.text)})}r(de,"setYAxisBottomText");function mt(t){const a={};for(const p of t){const[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(ie(o))throw new Tt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Lt(o))throw new Tt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Lt(o))throw new Tt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(ae(o))throw new Tt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}r(mt,"parseStyles");function ue(t,a,p,f,o){const x=mt(o);V.addPoints([{x:p,y:f,text:O(t.text),className:a,...x}])}r(ue,"addPoint");function xe(t,a){V.addClass(t,mt(a))}r(xe,"addClass");function fe(t){V.setConfig({chartWidth:t})}r(fe,"setWidth");function ge(t){V.setConfig({chartHeight:t})}r(ge,"setHeight");function pe(){const t=Et(),{themeVariables:a,quadrantChart:p}=t;return p&&V.setConfig(p),V.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),V.setData({titleText:ee()}),V.build()}r(pe,"getQuadrantData");var Ve=r(function(){V.clear(),ve()},"clear"),Ie={setWidth:fe,setHeight:ge,setQuadrant1Text:ne,setQuadrant2Text:se,setQuadrant3Text:re,setQuadrant4Text:oe,setXAxisLeftText:le,setXAxisRightText:he,setYAxisTopText:ce,setYAxisBottomText:de,parseStyles:mt,addPoint:ue,addClass:xe,getQuadrantData:pe,clear:Ve,setAccTitle:Fe,getAccTitle:ke,setDiagramTitle:Ae,getDiagramTitle:ee,getAccDescription:_e,setAccDescription:Se},we=r((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}r(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}r(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}r(_,"getTransformation");const h=Et();qt.debug(`Rendering quadrant chart +`+t);const c=h.securityLevel;let S;c==="sandbox"&&(S=vt("#i"+a));const b=(c==="sandbox"?vt(S.nodes()[0].contentDocument.body):vt("body")).select(`[id="${a}"]`),y=b.append("g").attr("class","main"),T=h.quadrantChart?.chartWidth??500,q=h.quadrantChart?.chartHeight??500;Pe(b,q,T,h.quadrantChart?.useMaxWidth??!0),b.attr("viewBox","0 0 "+T+" "+q),f.db.setHeight(q),f.db.setWidth(T);const g=f.db.getQuadrantData(),k=y.append("g").attr("class","quadrants"),ct=y.append("g").attr("class","border"),dt=y.append("g").attr("class","data-points"),ut=y.append("g").attr("class","labels"),xt=y.append("g").attr("class","title");g.title&&xt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&ct.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ot=k.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),ut.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));const lt=dt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),Be={draw:we},Oe={parser:Ee,db:Ie,renderer:Be,styles:r(()=>"","styles")};export{Oe as diagram}; diff --git a/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js b/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js new file mode 100644 index 0000000000..38499218b9 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js @@ -0,0 +1,84 @@ +import{g as ze}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as Ge}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as h,D 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,z as it,C as rt,o as nt,r as at,u as lt}from"./mermaidParser.worker-Dx4jPi9z.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[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:h(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:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].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[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-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[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);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[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,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(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",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){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(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=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,G,N,Ie,J={},ge,F,Ue,ye;;){if(G=c[c.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:c.push(b),m.push(y.yytext),t.push(y.yylloc),c.push(N[1]),b=null,Fe=y.yyleng,l=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,[l,Fe,Re,z.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(c=c.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:h(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:h(function(r,a){return this.yy=a||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:h(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.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),r},"input"),unput:h(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;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),c.length-1&&(this.yylineno-=c.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:c?(c.length===s.length?this.yylloc.first_column:0)+s[s.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(r){this.unput(this.match.slice(r))},"less"),pastInput:h(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:h(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:h(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:h(function(r,a){var c,s,m;if(this.options.backtrack_lexer&&(m={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(m.yylloc.range=this.yylloc.range.slice(0))),s=r[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in m)this[t]=m[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,c,s;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),t=0;ta[0].length)){if(a=c,s=t,this.options.backtrack_lexer){if(r=this.test_match(c,m[t]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,m[s]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var a=this.next();return a||this.lex()},"lex"),begin:h(function(a){this.conditionStack.push(a)},"begin"),popState:h(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:h(function(a){this.begin(a)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(a,c,s,m){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return c.yytext=c.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();_e.lexer=Qe;function pe(){this.yy={}}return h(pe,"Parser"),pe.prototype=_e,_e.Parser=pe,new pe})();qe.parser=qe;var ct=qe,ot=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Xe,this.getAccTitle=Je,this.setAccDescription=Ze,this.getAccDescription=et,this.setDiagramTitle=tt,this.getDiagramTitle=st,this.getConfig=h(()=>Te().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{h(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,u){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),Ne.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,u,o){this.relations.push({type:e,src:u,dst:o})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,it()}setCssStyle(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(!u||!n)return;for(const i of u)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(n)for(const i of u){n.classes.push(i);const f=this.classes.get(i)?.styles;f&&n.cssStyles.push(...f)}}}defineClass(e,u){for(const o of e){let n=this.classes.get(o);n===void 0&&(n={id:o,styles:[],textStyles:[]},this.classes.set(o,n)),u&&u.forEach(function(i){if(/color/.exec(i)){const f=i.replace("fill","bgFill");n.textStyles.push(f)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))}),this.elements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))})}}getClasses(){return this.classes}getData(){const e=Te(),u=[],o=[];for(const n of this.requirements.values()){const i=n;i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.shape="requirementBox",i.look=e.look,i.colorIndex=u.length,u.push(i)}for(const n of this.elements.values()){const i=n;i.shape="requirementBox",i.look=e.look,i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.colorIndex=u.length,u.push(i)}for(const n of this.relations){let i=0;const f=n.type===this.Relationships.CONTAINS,_={id:`${n.src}-${n.dst}-${i}`,start:this.requirements.get(n.src)?.name??this.elements.get(n.src)?.name,end:this.requirements.get(n.dst)?.name??this.elements.get(n.dst)?.name,label:`<<${n.type}>>`,classes:"relationshipLine",style:["fill:none",f?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:f?"normal":"dashed",arrowTypeStart:f?"requirement_contains":"",arrowTypeEnd:f?"":"requirement_arrow",look:e.look,labelType:"markdown"};o.push(_),i++}return{nodes:u,edges:o,other:{},config:e,direction:this.getDirection()}}},ht=h(e=>{const u=Ye(),{themeVariables:o,look:n}=u,{bkgColorArray:i,borderColorArray:f}=o;if(!f?.length)return"";let _="";for(let E=0;E{const u=Ye(),{look:o,themeVariables:n}=u,{requirementEdgeLabelBackground:i}=n;return` + ${ht(e)} + marker { + fill: ${e.relationColor}; + stroke: ${e.relationColor}; + } + + marker.cross { + stroke: ${e.lineColor}; + } + + svg { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + } + + .reqBox { + fill: ${e.requirementBackground}; + fill-opacity: 1.0; + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${e.requirementTextColor}; + } + .reqLabelBox { + fill: ${e.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + .relationshipLine { + stroke: ${e.relationColor}; + stroke-width: ${o==="neo"?e.strokeWidth:"1px"}; + } + .relationshipLabel { + fill: ${e.relationLabelColor}; + } + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.relationLabelColor}; + } + .divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; + } + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + .labelBkg { + background-color: ${i??e.edgeLabelBackground}; + } + +`},"getStyles"),ft=ut,Be={};rt(Be,{draw:()=>mt});var mt=h(async function(e,u,o,n){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:i,state:f,layout:_,look:E}=Te(),g=n.db.getData(),S=ze(u,i);g.type=n.type,g.layoutAlgorithm=nt(_),g.nodeSpacing=f?.nodeSpacing??50,g.rankSpacing=f?.rankSpacing??50,g.markers=E==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],g.diagramId=u,await at(g,S);const k=8;lt.insertTitle(S,"requirementDiagramTitleText",f?.titleTopMargin??25,n.db.getDiagramTitle()),Ge(S,k,"requirementDiagram",f?.useMaxWidth??!0)},"draw"),Rt={parser:ct,get db(){return new ot},renderer:Be,styles:ft};export{Rt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CgOSnyR8.js b/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CgOSnyR8.js new file mode 100644 index 0000000000..3f3062d541 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/requirementDiagram-4Y6WPE33-CgOSnyR8.js @@ -0,0 +1,84 @@ +import{g as ze}from"./chunk-55IACEB6-mUr9lxTD.js";import{s as Ge}from"./chunk-2J33WTMH-BlbqWzB_.js";import{_ as h,D 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,z as it,C as rt,o as nt,r as at,u as lt}from"./mermaid.core-zKrc8Ye9.js";import"./index-DtRfJ0vw.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[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:h(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:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].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[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-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[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);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[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,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(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:o,11:n,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:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",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){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(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=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,G,N,Ie,J={},ge,F,Ue,ye;;){if(G=c[c.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:c.push(b),m.push(y.yytext),t.push(y.yylloc),c.push(N[1]),b=null,Fe=y.yyleng,l=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,[l,Fe,Re,z.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(c=c.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:h(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:h(function(r,a){return this.yy=a||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:h(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.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),r},"input"),unput:h(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;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),c.length-1&&(this.yylineno-=c.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:c?(c.length===s.length?this.yylloc.first_column:0)+s[s.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(r){this.unput(this.match.slice(r))},"less"),pastInput:h(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:h(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:h(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:h(function(r,a){var c,s,m;if(this.options.backtrack_lexer&&(m={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(m.yylloc.range=this.yylloc.range.slice(0))),s=r[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in m)this[t]=m[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,c,s;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),t=0;ta[0].length)){if(a=c,s=t,this.options.backtrack_lexer){if(r=this.test_match(c,m[t]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,m[s]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var a=this.next();return a||this.lex()},"lex"),begin:h(function(a){this.conditionStack.push(a)},"begin"),popState:h(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:h(function(a){this.begin(a)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(a,c,s,m){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return c.yytext=c.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();_e.lexer=Qe;function pe(){this.yy={}}return h(pe,"Parser"),pe.prototype=_e,_e.Parser=pe,new pe})();qe.parser=qe;var ct=qe,ot=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Xe,this.getAccTitle=Je,this.setAccDescription=Ze,this.getAccDescription=et,this.setDiagramTitle=tt,this.getDiagramTitle=st,this.getConfig=h(()=>Te().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{h(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,u){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),Ne.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,u,o){this.relations.push({type:e,src:u,dst:o})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,it()}setCssStyle(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(!u||!n)return;for(const i of u)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(n)for(const i of u){n.classes.push(i);const f=this.classes.get(i)?.styles;f&&n.cssStyles.push(...f)}}}defineClass(e,u){for(const o of e){let n=this.classes.get(o);n===void 0&&(n={id:o,styles:[],textStyles:[]},this.classes.set(o,n)),u&&u.forEach(function(i){if(/color/.exec(i)){const f=i.replace("fill","bgFill");n.textStyles.push(f)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))}),this.elements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))})}}getClasses(){return this.classes}getData(){const e=Te(),u=[],o=[];for(const n of this.requirements.values()){const i=n;i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.shape="requirementBox",i.look=e.look,i.colorIndex=u.length,u.push(i)}for(const n of this.elements.values()){const i=n;i.shape="requirementBox",i.look=e.look,i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.colorIndex=u.length,u.push(i)}for(const n of this.relations){let i=0;const f=n.type===this.Relationships.CONTAINS,_={id:`${n.src}-${n.dst}-${i}`,start:this.requirements.get(n.src)?.name??this.elements.get(n.src)?.name,end:this.requirements.get(n.dst)?.name??this.elements.get(n.dst)?.name,label:`<<${n.type}>>`,classes:"relationshipLine",style:["fill:none",f?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:f?"normal":"dashed",arrowTypeStart:f?"requirement_contains":"",arrowTypeEnd:f?"":"requirement_arrow",look:e.look,labelType:"markdown"};o.push(_),i++}return{nodes:u,edges:o,other:{},config:e,direction:this.getDirection()}}},ht=h(e=>{const u=Ye(),{themeVariables:o,look:n}=u,{bkgColorArray:i,borderColorArray:f}=o;if(!f?.length)return"";let _="";for(let E=0;E{const u=Ye(),{look:o,themeVariables:n}=u,{requirementEdgeLabelBackground:i}=n;return` + ${ht(e)} + marker { + fill: ${e.relationColor}; + stroke: ${e.relationColor}; + } + + marker.cross { + stroke: ${e.lineColor}; + } + + svg { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + } + + .reqBox { + fill: ${e.requirementBackground}; + fill-opacity: 1.0; + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${e.requirementTextColor}; + } + .reqLabelBox { + fill: ${e.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + .relationshipLine { + stroke: ${e.relationColor}; + stroke-width: ${o==="neo"?e.strokeWidth:"1px"}; + } + .relationshipLabel { + fill: ${e.relationLabelColor}; + } + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.relationLabelColor}; + } + .divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; + } + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + .labelBkg { + background-color: ${i??e.edgeLabelBackground}; + } + +`},"getStyles"),ft=ut,Be={};rt(Be,{draw:()=>mt});var mt=h(async function(e,u,o,n){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:i,state:f,layout:_,look:E}=Te(),g=n.db.getData(),S=ze(u,i);g.type=n.type,g.layoutAlgorithm=nt(_),g.nodeSpacing=f?.nodeSpacing??50,g.rankSpacing=f?.rankSpacing??50,g.markers=E==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],g.diagramId=u,await at(g,S);const k=8;lt.insertTitle(S,"requirementDiagramTitleText",f?.titleTopMargin??25,n.db.getDiagramTitle()),Ge(S,k,"requirementDiagram",f?.useMaxWidth??!0)},"draw"),gt={parser:ct,get db(){return new ot},renderer:Be,styles:ft};export{gt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-DBhf2qeh.js b/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-DBhf2qeh.js new file mode 100644 index 0000000000..0a981c315e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-DBhf2qeh.js @@ -0,0 +1,40 @@ +import{p as kt,q as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,A as St,d as G,af as wt,z as Lt,k as Et}from"./mermaid.core-zKrc8Ye9.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-DtRfJ0vw.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 zt(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,_=zt,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/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),z(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,j=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,j+=U}if(!(j>0))continue;let V=(L/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),z(p,c)}}function z(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,jt=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>jt?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 z=S.yylloc;d.push(z);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:z,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,z=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()+` +`+a+"^"},"showPosition"),test_match:y(function(o,a){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,a,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!a||h[0].length>a[0].length)){if(a=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(o=this.test_match(a,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();rt.parser=rt;var H=rt,Q=[],K=[],X=new Map,Qt=y(()=>{Q=[],K=[],X=new Map,Lt()},"clear"),Kt=class{constructor(t,i,s=0){this.source=t,this.target=i,this.value=s}static{y(this,"SankeyLink")}},Zt=y((t,i,s)=>{Q.push(new Kt(t,i,s))},"addLink"),Jt=class{constructor(t){this.ID=t}static{y(this,"SankeyNode")}},te=y(t=>{t=Et.sanitizeText(t,ot());let i=X.get(t);return i===void 0&&(i=new Jt(t),X.set(t,i),K.push(i)),i},"findOrCreateNode"),ee=y(()=>K,"getNodes"),ne=y(()=>Q,"getLinks"),ie=y(()=>({nodes:K.map(t=>({id:t.ID})),links:Q.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),re={nodesMap:X,getConfig:y(()=>ot().sankey,"getConfig"),getNodes:ee,getLinks:ne,getGraph:ie,addLink:Zt,findOrCreateNode:te,getAccTitle:bt,setAccTitle:vt,getAccDescription:_t,setAccDescription:xt,getDiagramTitle:mt,setDiagramTitle:kt,clear:Qt},yt=class st{static{y(this,"Uid")}static{this.count=0}static next(i){return new st(i+ ++st.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},se={left:Ct,right:Pt,center:It,justify:gt},oe=y(t=>{let i=0,s=0;for(const l of t){const u=l.value??0;u>i&&(i=u,s=l.layer??0)}return s},"findCentralNodeLayer"),ae=y(function(t,i,s,l){const{securityLevel:u,sankey:x}=ot(),g=St.sankey;let k;u==="sandbox"&&(k=G("#i"+i));const o=u==="sandbox"?G(k.nodes()[0].contentDocument.body):G("body"),a=u==="sandbox"?o.select(`[id="${i}"]`):G(`[id="${i}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",$=x?.nodeColors??{},S=l.db.getGraph(),C=se[d];Dt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const z=oe(S.nodes),R=At(Mt),O=y(e=>$[e]??R(e),"getNodeColor");a.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=yt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const D=y(({id:e,value:r})=>A?`${e} +${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(D),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const n=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=n.append("linearGradient").attr("id",r=>(r.uid=yt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}n.append("path").attr("d",Xt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),wt(void 0,a,0,_)},"draw"),le={draw:ae},ce=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),ue=y(t=>`.label { + font-family: ${t.fontFamily}; + } + + .node-labels { + font-family: ${t.fontFamily}; + } + + /* Outlined label style - background stroke for better readability */ + .sankey-label-bg { + stroke: ${t.mainBkg||t.background||"#fff"}; + stroke-width: 4px; + stroke-linejoin: round; + paint-order: stroke; + } + + /* Foreground label text */ + .sankey-label-fg { + fill: ${t.textColor}; + } + + /* Node styling */ + .node rect { + shape-rendering: crispEdges; + } + + /* Link styling */ + .link { + fill: none; + stroke-opacity: 0.5; + mix-blend-mode: multiply; + } +`,"getStyles"),he=ue,fe=H.parse.bind(H);H.parse=t=>fe(ce(t));var ke={styles:he,parser:H,db:re,renderer:le};export{ke as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js b/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js new file mode 100644 index 0000000000..70b6c1a309 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js @@ -0,0 +1,40 @@ +import{p as kt,q as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,A as St,d as G,Y as wt,z as Lt,k as Et}from"./mermaidParser.worker-Dx4jPi9z.js";import{o as At}from"./ordinal-Cboi1Yqb.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 zt(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,_=zt,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/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),z(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,j=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,j+=U}if(!(j>0))continue;let V=(L/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),z(p,c)}}function z(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,jt=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>jt?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 z=S.yylloc;d.push(z);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:z,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,z=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()+` +`+a+"^"},"showPosition"),test_match:y(function(o,a){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,a,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!a||h[0].length>a[0].length)){if(a=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(o=this.test_match(a,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();rt.parser=rt;var H=rt,Q=[],K=[],X=new Map,Qt=y(()=>{Q=[],K=[],X=new Map,Lt()},"clear"),Kt=class{constructor(t,i,s=0){this.source=t,this.target=i,this.value=s}static{y(this,"SankeyLink")}},Zt=y((t,i,s)=>{Q.push(new Kt(t,i,s))},"addLink"),Jt=class{constructor(t){this.ID=t}static{y(this,"SankeyNode")}},te=y(t=>{t=Et.sanitizeText(t,ot());let i=X.get(t);return i===void 0&&(i=new Jt(t),X.set(t,i),K.push(i)),i},"findOrCreateNode"),ee=y(()=>K,"getNodes"),ne=y(()=>Q,"getLinks"),ie=y(()=>({nodes:K.map(t=>({id:t.ID})),links:Q.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),re={nodesMap:X,getConfig:y(()=>ot().sankey,"getConfig"),getNodes:ee,getLinks:ne,getGraph:ie,addLink:Zt,findOrCreateNode:te,getAccTitle:bt,setAccTitle:vt,getAccDescription:_t,setAccDescription:xt,getDiagramTitle:mt,setDiagramTitle:kt,clear:Qt},yt=class st{static{y(this,"Uid")}static{this.count=0}static next(i){return new st(i+ ++st.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},se={left:Ct,right:Pt,center:It,justify:gt},oe=y(t=>{let i=0,s=0;for(const l of t){const u=l.value??0;u>i&&(i=u,s=l.layer??0)}return s},"findCentralNodeLayer"),ae=y(function(t,i,s,l){const{securityLevel:u,sankey:x}=ot(),g=St.sankey;let k;u==="sandbox"&&(k=G("#i"+i));const o=u==="sandbox"?G(k.nodes()[0].contentDocument.body):G("body"),a=u==="sandbox"?o.select(`[id="${i}"]`):G(`[id="${i}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",$=x?.nodeColors??{},S=l.db.getGraph(),C=se[d];Dt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const z=oe(S.nodes),R=At(Mt),O=y(e=>$[e]??R(e),"getNodeColor");a.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=yt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const D=y(({id:e,value:r})=>A?`${e} +${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(D),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const n=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=n.append("linearGradient").attr("id",r=>(r.uid=yt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}n.append("path").attr("d",Xt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),wt(void 0,a,0,_)},"draw"),le={draw:ae},ce=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),ue=y(t=>`.label { + font-family: ${t.fontFamily}; + } + + .node-labels { + font-family: ${t.fontFamily}; + } + + /* Outlined label style - background stroke for better readability */ + .sankey-label-bg { + stroke: ${t.mainBkg||t.background||"#fff"}; + stroke-width: 4px; + stroke-linejoin: round; + paint-order: stroke; + } + + /* Foreground label text */ + .sankey-label-fg { + fill: ${t.textColor}; + } + + /* Node styling */ + .node rect { + shape-rendering: crispEdges; + } + + /* Link styling */ + .link { + fill: none; + stroke-opacity: 0.5; + mix-blend-mode: multiply; + } +`,"getStyles"),he=ue,fe=H.parse.bind(H);H.parse=t=>fe(ce(t));var pe={styles:he,parser:H,db:re,renderer:le};export{pe as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-BwZabocW.js b/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-BwZabocW.js new file mode 100644 index 0000000000..aa69a29b19 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-BwZabocW.js @@ -0,0 +1,162 @@ +import{_ as g,n as tr,c as $,d as Mt,l as at,j as Ce,e as er,f as rr,k as P,b as ke,s as ar,p as sr,a as ir,g as nr,q as or,t as cr,J as lr,z as hr,i as Bt,u as Z,L as Q,M as wt,N as Me,Z as dr,D as Yt,O as Tr,P as Be}from"./mermaid.core-zKrc8Ye9.js";import{a as pr,b as ee,g as dt,d as Er,e as re,f as ae}from"./chunk-ND2GUHAM-D-Pih1kA.js";import{I as ur}from"./chunk-QZHKN3VN-Dyzf1Pwd.js";import"./index-DtRfJ0vw.js";var $t=(function(){var e=g(function(ut,w,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=w);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],o=[1,9],s=[1,11],n=[1,12],E=[1,14],T=[1,15],l=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],S=[1,32],A=[1,33],N=[1,34],B=[1,35],V=[1,36],q=[1,37],U=[1,38],G=[1,39],X=[1,40],j=[1,42],H=[1,43],st=[1,44],tt=[1,45],it=[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],Nt=[1,74],m=[1,80],D=[1,81],lt=[1,82],et=[1,83],W=[1,84],se=[1,85],ie=[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],mt=[4,5,17,51,53,54],Pt=[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],Ht=[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],zt=[5,52],K=[70,71,72,73],ot=[1,151],Ut={trace:g(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:g(function(w,v,k,y,z,c,At){var d=c.length-1;switch(z){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-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[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};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[d].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:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},e(C,[2,5]),{9:48,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,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:Nt},{23:75,55:76,73:Nt},{23:77,73:Y},{69:78,72:[1,79],78:m,79:D,80:lt,81:et,82:W,83:se,84:ie,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(mt,[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(Pt,i,{7:120}),e(Pt,i,{7:121}),e(Pt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ht,i,{43:125,7:126}),e(Ht,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Pt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(zt,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:m,79:D,80:lt,81:et,82:W,83:se,84:ie,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(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[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:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,161],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,162],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,163],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,164]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,47],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,50:[1,165],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,166]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,45],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,49:[1,167],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,43],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,48:[1,170],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,171],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(zt,[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(mt,[2,11]),{13:186,51:U,53:G,54:X},e(mt,[2,13]),e(mt,[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(mt,[2,12]),e(me,i,{7:124,41:201}),e(Ht,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(zt,[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:g(function(w,v){if(v.recoverable)this.trace(w);else{var k=new Error(w);throw k.hash=v,k}},"parseError"),parse:g(function(w){var v=this,k=[0],y=[],z=[null],c=[],At=this.table,d="",Dt=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(gt.yy[Gt]=this.yy[Gt]);J.setInput(w,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Xt=J.yylloc;c.push(Xt);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(nt){k.length=k.length-2*nt,z.length=z.length-nt,c.length=c.length-nt}g(je,"popStack");function Ne(){var nt;return nt=y.pop()||J.lex()||we,typeof nt!="number"&&(nt instanceof Array&&(y=nt,nt=y.pop()),nt=v.symbols_[nt]||nt),nt}g(Ne,"lex");for(var rt,xt,ct,Jt,Ot={},vt,Tt,Pe,Ct;;){if(xt=k[k.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=At[xt]&&At[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var Zt="";Ct=[];for(vt in At[xt])this.terminals_[vt]&&vt>Ze&&Ct.push("'"+this.terminals_[vt]+"'");J.showPosition?Zt="Parse error on line "+(Dt+1)+`: +`+J.showPosition()+` +Expecting `+Ct.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":Zt="Parse error on line "+(Dt+1)+": Unexpected "+(rt==we?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(Zt,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Xt,expected:Ct})}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:k.push(rt),z.push(J.yytext),c.push(J.yylloc),k.push(ct[1]),rt=null,Se=J.yyleng,d=J.yytext,Dt=J.yylineno,Xt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Ot.$=z[z.length-Tt],Ot._$={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&&(Ot._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Jt=this.performAction.apply(Ot,[d,Se,Dt,gt.yy,ct[1],z,c].concat(Qe)),typeof Jt<"u")return Jt;Tt&&(k=k.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),k.push(this.productions_[ct[1]][0]),z.push(Ot.$),c.push(Ot._$),Pe=At[k[k.length-2]][k[k.length-1]],k.push(Pe);break;case 3:return!0}}return!0},"parse")},Je=(function(){var ut={EOF:1,parseError:g(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:g(function(w,v){return this.yy=v||this.yy||{},this._input=w,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:g(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var v=w.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),w},"input"),unput:g(function(w){var v=w.length,k=w.split(/(?:\r\n?|\n)/g);this._input=w+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),k.length-1&&(this.yylineno-=k.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:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[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:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(w){this.unput(this.match.slice(w))},"less"),pastInput:g(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var w=this.pastInput(),v=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:g(function(w,v){var k,y,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),y=w[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],k=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var c in z)this[c]=z[c];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,v,k,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),c=0;cv[0].length)){if(v=k,y=c,this.options.backtrack_lexer){if(w=this.test_match(k,z[c]),w!==!1)return w;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(w=this.test_match(v,z[y]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var v=this.next();return v||this.lex()},"lex"),begin:g(function(v){this.conditionStack.push(v)},"begin"),popState:g(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:g(function(v){this.begin(v)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(v,k,y,z){switch(y){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return k.yytext=k.yytext.trim(),73;case 12:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),73;case 13:return k.yytext=k.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return k.yytext=k.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return k.yytext=k.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Ut.lexer=Je;function kt(){this.yy={}}return g(kt,"Parser"),kt.prototype=Ut,Ut.Parser=kt,new kt})();$t.parser=$t;var fr=$t,_r={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},gr={FILLED:0,OPEN:1},xr={LEFTOF:0,RIGHTOF:1,OVER:2},Vt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Ir=class{constructor(){this.state=new ur(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ke,this.setAccDescription=ar,this.setDiagramTitle=sr,this.getAccTitle=ir,this.getAccDescription=nr,this.getDiagramTitle=or,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=_r,this.ARROWTYPE=gr,this.PLACEMENT=xr}static{g(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,a,r,i){let o=this.state.records.currentBox,s;if(i!==void 0){let E;i.includes(` +`)?E=i+` +`:E=`{ +`+i+` +}`,s=cr(E,{schema:lr})}r=s?.type??r,s?.alias&&(!a||a.text===t)&&(a={text:s.alias,wrap:a?.wrap,type:r});const n=this.state.records.actors.get(e);if(n){if(this.state.records.currentBox&&n.box&&this.state.records.currentBox!==n.box)throw new Error(`A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=n.box?n.box:this.state.records.currentBox,n.box=o,n&&t===n.name&&a==null)return}if(a?.text==null&&(a={text:t,type:r}),(r==null||a.text==null)&&(a={text:t,type:r}),this.state.records.actors.set(e,{box:o,name:t,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const E=this.state.records.actors.get(this.state.records.prevActor);E&&(E.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,a=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},n}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:o??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),hr()}parseMessage(e){const t=e.trim(),{wrap:a,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:a};return at.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let a=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",r=e.trim());else{const s=new Option().style;s.color=a,s.color!==a&&(a="transparent",r=e.trim())}const{wrap:i,cleanedText:o}=this.extractWrap(r);return{text:o?Bt(o,$()):void 0,color:a,wrap:i}}addNote(e,t,a){const r={actor:e,placement:t,message:a.text,wrap:a.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const a=this.getActor(e);try{let r=Bt(t.text,$());r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const i=JSON.parse(r);this.insertLinks(a,i)}catch(r){at.error("error while parsing actor link text",r)}}addALink(e,t){const a=this.getActor(e);try{const r={};let i=Bt(t.text,$());const o=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=i.slice(0,o-1).trim(),n=i.slice(o+1).trim();r[s]=n,this.insertLinks(a,r)}catch(r){at.error("error while parsing actor link text",r)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(const a in t)e.links[a]=t[a]}addProperties(e,t){const a=this.getActor(e);try{const r=Bt(t.text,$()),i=JSON.parse(r);this.insertProperties(a,i)}catch(r){at.error("error while parsing actor properties text",r)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(const a in t)e.properties[a]=t[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const a=this.getActor(e),r=document.getElementById(t.text);try{const i=r.innerHTML,o=JSON.parse(i);o.properties&&this.insertProperties(a,o.properties),o.links&&this.insertLinks(a,o.links)}catch(i){at.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":ke(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return $().sequence}},yr=g(e=>{const t=e.dropShadow??"none",{look:a}=$();return`.actor { + stroke: ${e.actorBorder}; + fill: ${e.actorBkg}; + stroke-width: ${e.strokeWidth??1}; + } + + rect.actor.outer-path[data-look="neo"] { + filter: ${t}; + } + + rect.note[data-look="neo"] { + stroke:${e.noteBorderColor}; + fill:${e.noteBkgColor}; + filter: ${t}; + } + + text.actor > tspan { + fill: ${e.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${e.actorLineColor}; + } + + .innerArc { + stroke-width: 1.5; + stroke-dasharray: none; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${e.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${e.signalColor}; + } + + [id$="-arrowhead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .sequenceNumber { + fill: ${e.sequenceNumberColor}; + } + + [id$="-sequencenumber"] { + fill: ${e.signalColor}; + } + + [id$="-crosshead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .messageText { + fill: ${e.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBkgColor}; + filter: ${a==="neo"?t:"none"}; + } + + .labelText, .labelText > tspan { + fill: ${e.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .sectionTitle, .sectionTitle > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${e.noteTextColor}; + stroke: none; + ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} + } + + .activation0 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation1 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation2 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${e.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man circle, line { + fill: ${e.actorBkg}; + stroke-width: 2px; + } + + g rect.rect { + filter: ${t}; + stroke: ${e.nodeBorder}; + } +`},"getStyles"),Rr=yr,It=36,ft="actor-top",_t="actor-bottom",Kt="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),St=g(function(e,t){const a=Er(e,t);return Yt().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Or=g(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const o=t.links,s=t.actorCnt,n=t.rectData;var E="none";i&&(E="block !important");const T=e.append("g");T.attr("id","actor"+s+"_popup"),T.attr("class","actorPopupMenu"),T.attr("display",E);var l="";n.class!==void 0&&(l=" "+n.class);let x=n.width>a?n.width:a;const u=T.append("rect");if(u.attr("class","actorPopupMenuPanel"+l),u.attr("x",n.x),u.attr("y",n.height),u.attr("fill",n.fill),u.attr("stroke",n.stroke),u.attr("width",x),u.attr("height",n.height),u.attr("rx",n.rx),u.attr("ry",n.ry),o!=null){var O=20;for(let _ in o){var p=T.append("a"),f=Ce.sanitizeUrl(o[_]);p.attr("xlink:href",f),p.attr("target","_blank"),Ur(r)(_,p,n.x+10,n.height+O,x,20,{class:"actor"},r),O+=30}}return u.attr("height",O),{height:n.height+O,width:x}},"drawPopup"),Ft=g(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Wt=g(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Be(t.text,Yt()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const n=e.node().firstChild;n.setAttribute("height",s.height+2*t.textMargin);const E=n.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:n,stopx:E,starty:T}=a;if(n>E){const l=n;n=E,E=l}r.attr("x",Math.round(n+Math.abs(n-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(T)):r.attr("y",Math.round(T-s.height))}return[r]},"drawKatex"),bt=g(function(e,t){let a=0,r=0;const i=t.text.split(P.lineBreakRegex),[o,s]=Me(t.fontSize);let n=[],E=0,T=g(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":T=g(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":T=g(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":T=g(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[l,x]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&o!==void 0&&(E=l*o);const u=e.append("text");u.attr("x",t.x),u.attr("y",T()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);const O=x||dr;if(t.tspan){const p=u.append("tspan");p.attr("x",t.x),t.fill!==void 0&&p.attr("fill",t.fill),p.text(O)}else u.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),n.push(u)}return n},"drawText"),Ve=g(function(e,t){function a(i,o,s,n,E){return i+","+o+" "+(i+s)+","+o+" "+(i+s)+","+(o+n-E)+" "+(i+s-E*1.2)+","+(o+n)+" "+i+","+(o+n)}g(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,bt(e,t),r},"drawLabel"),M=-1,Ye=g((e,t,a,r)=>{e.select&&a.forEach(i=>{const o=t.get(i),s=e.select("#actor"+o.actorCnt);!r.mirrorActors&&o.stopy?s.attr("y2",o.stopy+o.height/2):r.mirrorActors&&s.attr("y2",o.stopy)})},"fixLifeLineHeights"),Lr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();var p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.class=_,f.rx=3,f.ry=3,f.name=t.name,E==="neo"&&(f.rx=6,f.ry=6);const I=St(p,f),L=i.get(t.name)??0;if(pt.has(T)&&(I.style("stroke",u[L%u.length]),I.style("fill",x[L%u.length])),E==="neo"&&I.attr("filter","url(#drop-shadow)"),t.rectData=f,t.properties?.icon){const S=t.properties.icon.trim();S.charAt(0)==="@"?re(p,f.x+f.width-20,f.y+10,S.substr(1)):ae(p,f.x+f.width-20,f.y+10,S)}r||(p.attr("data-et","participant"),p.attr("data-type","participant"),p.attr("data-id",t.name)),Et(a,Q(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Kt}`},a);let b=t.height;if(I.node){const S=I.node().getBBox();t.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),br=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();var p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.class=_,f.name=t.name;const I=6,L={...f,x:f.x+-I,y:f.y+ +I,class:"actor"},b=St(p,f),S=St(p,L);t.rectData=f,E==="neo"&&p.attr("filter","url(#drop-shadow)");const A=i.get(t.name)??0;if(pt.has(T)&&(b.style("stroke",u[A%u.length]),b.style("fill",x[A%u.length]),S.style("stroke",u[A%u.length]),S.style("fill",x[A%u.length])),t.properties?.icon){const B=t.properties.icon.trim();B.charAt(0)==="@"?re(p,f.x+f.width-20,f.y+10,B.substr(1)):ae(p,f.x+f.width-20,f.y+10,B)}Et(a,Q(t.description))(t.description,p,f.x-I,f.y+I,f.width,f.height,{class:`actor ${Kt}`},a);let N=t.height;if(b.node){const B=b.node().getBBox();t.height=B.height,N=B.height}return r||(p.attr("data-et","participant"),p.attr("data-type","collections"),p.attr("data-id",t.name)),N},"drawActorTypeCollections"),mr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();let p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();let _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,p.attr("class",_),f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.name=t.name;const I=f.height/2,L=I/(2.5+f.height/50),b=p.append("g"),S=p.append("g"),A=`M ${f.x},${f.y+I} + a ${L},${I} 0 0 0 0,${f.height} + h ${f.width-2*L} + a ${L},${I} 0 0 0 0,-${f.height} + Z + `;b.append("path").attr("d",A),S.append("path").attr("d",`M ${f.x},${f.y+I} + a ${L},${I} 0 0 0 0,${f.height}`),b.attr("transform",`translate(${L}, ${-(f.height/2)})`),S.attr("transform",`translate(${f.width-L}, ${-f.height/2})`),t.rectData=f,E==="neo"&&b.attr("filter","url(#drop-shadow)");const N=i.get(t.name)??0;if(pt.has(T)&&(b.style("stroke",u[N%u.length]),b.style("fill",x[N%u.length]),S.style("stroke",u[N%u.length]),S.style("fill",x[N%u.length])),t.properties?.icon){const q=t.properties.icon.trim(),U=f.x+f.width-20,G=f.y+10;q.charAt(0)==="@"?re(p,U,G,q.substr(1)):ae(p,U,G,q)}Et(a,Q(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Kt}`},a);let B=t.height;const V=b.select("path:last-child");if(V.node()){const q=V.node().getBBox();t.height=q.height,B=q.height}return r||(p.attr("data-et","participant"),p.attr("data-type","queue"),p.attr("data-id",t.name)),B},"drawActorTypeQueue"),Ar=g(function(e,t,a,r,i,o){const s=r?t.stopy:t.starty,n=t.x+t.width/2,E=s+75,{look:T,theme:l,themeVariables:x}=a,{bkgColorArray:u,borderColorArray:O,actorBorder:p,actorBkg:f}=x,_=e.append("g").lower();r||(M++,_.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",E).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const S=t.x+t.width/2,A=s+32,N=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",S).attr("cy",A).attr("r",N).attr("filter",`${T==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${S}, ${A-N})`);const B=o.get(t.name)??0;pt.has(l)?(I.style("stroke",O[B%O.length]),I.style("fill",u[B%O.length])):(I.style("stroke",p),I.style("fill",f));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+N+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),Sr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+75,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower(),p=e.append("g");let f="actor";r?f+=` ${_t}`:f+=` ${ft}`,p.attr("class",f),p.attr("name",t.name);const _=dt();_.x=t.x,_.y=o,_.fill="#eaeaea",_.width=t.width,_.height=t.height,_.class="actor";const I=t.x+t.width/2,L=o+(r?10:25),b=22;p.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),p.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),E==="neo"&&p.attr("filter","url(#drop-shadow)");const S=i.get(t.name)??0;pt.has(T)&&(p.style("stroke",u[S%u.length]),p.style("fill",x[S%u.length]));const A=p.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(M++,O.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M),Et(a,Q(t.description))(t.description,p,_.x,_.y+(r?15:30),_.width,_.height,{class:`actor ${yt}`},a),r?p.attr("transform",`translate(0, ${b})`):(p.attr("transform",`translate(0, ${b/2-5})`),p.attr("data-et","participant"),p.attr("data-type","entity"),p.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),wr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height+2*a.boxTextMargin,{theme:E,themeVariables:T,look:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:O}=T,p=e.append("g").lower();let f=p;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&f.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),f.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),f=p.append("g"),t.actorCnt=M,t.links!=null&&f.attr("id","root-"+M),l==="neo"&&f.attr("data-look","neo"));const _=dt();let I="actor";t.properties?.class?I=t.properties.class:_.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,_.x=t.x,_.y=o,_.width=t.width,_.height=t.height,_.class=I,_.name=t.name,_.x=t.x,_.y=o;const L=_.width/3,b=_.width/3,S=L/2,A=S/(2.5+L/50),N=f.append("g");N.attr("class",I);const B=` + M ${_.x},${_.y+A} + a ${S},${A} 0 0 0 ${L},0 + a ${S},${A} 0 0 0 -${L},0 + l 0,${b-2*A} + a ${S},${A} 0 0 0 ${L},0 + l 0,-${b-2*A} +`;N.append("path").attr("d",B),l==="neo"&&N.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(E)?(N.style("stroke",u[V%u.length]),N.style("fill",x[V%u.length])):N.style("stroke",O),N.attr("transform",`translate(${L}, ${A})`),t.rectData=_,Et(a,Q(t.description))(t.description,f,_.x,_.y+35,_.width,_.height,{class:`actor ${Kt}`},a);const q=N.select("path:last-child");if(q.node()){const U=q.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Nr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+80,E=22,T=e.append("g").lower(),{look:l,theme:x,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:p,actorBorder:f}=u;r||(M++,T.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const _=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,_.attr("class",I),_.attr("name",t.name);const L=dt();L.x=t.x,L.y=o,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",_.append("line").attr("id","actor-man-torso"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",o+12).attr("x2",t.x+t.width/2-15).attr("y2",o+12),_.append("line").attr("id","actor-man-arms"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",o+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",o+22),_.append("circle").attr("cx",t.x+t.width/2).attr("cy",o+12).attr("r",E),l==="neo"&&_.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(x)?(_.style("stroke",p[b%p.length]),_.style("fill",O[b%p.length])):_.style("stroke",f);const S=_.node().getBBox();return t.height=S.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,_,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),_.attr("transform",`translate(0,${E/2+10})`),r||(_.attr("data-et","participant"),_.attr("data-type","boundary"),_.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Pr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+80,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:O}=l,p=e.append("g").lower();r||(M++,p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const f=e.append("g");let _=yt;r?_+=` ${_t}`:_+=` ${ft}`,f.attr("class",_),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?o+(1-I)*30:o;f.append("line").attr("id","actor-man-torso"+M).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("id","actor-man-arms"+M).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),f.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=f.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const S=f.node().getBBox();t.height=S.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const N=i.get(t.name)??0;return pt.has(T)?(f.style("stroke",u[N%u.length]),f.style("fill",x[N%u.length])):f.style("stroke",O),Et(a,Q(t.description))(t.description,f,A.x,L+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),kr=g(async function(e,t,a,r,i,o,s){const n=s??new Map([...o.db.getActors().values()].map((E,T)=>[E.name,T]));switch(t.type){case"actor":return await Pr(e,t,a,r,n);case"participant":return await Lr(e,t,a,r,n);case"boundary":return await Nr(e,t,a,r,n);case"control":return await Ar(e,t,a,r,i,n);case"entity":return await Sr(e,t,a,r,n);case"database":return await wr(e,t,a,r,n);case"collections":return await br(e,t,a,r,n);case"queue":return await mr(e,t,a,r,n)}},"drawActor"),Dr=g(function(e,t,a){const i=e.append("g");We(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),vr=g(function(e){return e.append("g")},"anchorElement"),Cr=g(function(e,t,a,r,i,o,s){const{theme:n,themeVariables:E}=r,{bkgColorArray:T,borderColorArray:l,mainBkg:x}=E,u=dt(),O=t.anchored,p=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const f=St(O,u),I=(s??new Map([...o.db.getActors().values()].map((L,b)=>[L.name,b]))).get(p)??0;pt.has(n)&&(f.style("stroke",l[I%l.length]),f.style("fill",T[I%l.length]??x))},"drawActivation"),Mr=g(async function(e,t,a,r,i){const{boxMargin:o,boxTextMargin:s,labelBoxHeight:n,labelBoxWidth:E,messageFontFamily:T,messageFontSize:l,messageFontWeight:x}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),O=g(function(_,I,L,b){return u.append("line").attr("x1",_).attr("y1",I).attr("x2",L).attr("y2",b).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(_){O(t.startx,_.y,t.stopx,_.y).style("stroke-dasharray","3, 3")});let p=ee();p.text=a,p.x=t.startx,p.y=t.starty,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=Math.max(E??0,50),p.height=n+(r.look==="neo"?15:0)||20,p.textMargin=s,p.class="labelText",Ve(u,p),p=Ke(),p.text=t.title,p.x=t.startx+E/2+(t.stopx-t.startx)/2,p.y=t.starty+o+s,p.anchor="middle",p.valign="middle",p.textMargin=s,p.class="loopText",p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=!0;let f=Q(p.text)?await Wt(u,p,t):bt(u,p);if(t.sectionTitles!==void 0){for(const[_,I]of Object.entries(t.sectionTitles))if(I.message){p.text=I.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[_].y+o+s,p.class="sectionTitle",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=t.wrap,Q(p.text)?(t.starty=t.sections[_].y,await Wt(u,p,t)):bt(u,p);let L=Math.round(f.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,S)=>b+S));t.sections[_].height+=L-(o+s)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),We=g(function(e,t){pr(e,t)},"drawBackgroundRect"),Br=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Vr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Yr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Wr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Kr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Fr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),qr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),Hr=g(function(e,t){const{theme:a}=t;e.append("defs").append("filter").attr("id","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",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Ke=g(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),zr=g(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(o,s,n,E,T,l,x){const u=s.append("text").attr("x",n+T/2).attr("y",E+l/2+5).style("text-anchor","middle").text(o);i(u,x)}g(e,"byText");function t(o,s,n,E,T,l,x,u){const{actorFontSize:O,actorFontFamily:p,actorFontWeight:f}=u,[_,I]=Me(O),L=o.split(P.lineBreakRegex);for(let b=0;be.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:g(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:g(function(e){this.boxes.push(e)},"addBox"),addActor:g(function(e){this.actors.push(e)},"addActor"),addLoop:g(function(e){this.loops.push(e)},"addLoop"),addMessage:g(function(e){this.messages.push(e)},"addMessage"),addNote:g(function(e){this.notes.push(e)},"addNote"),lastActor:g(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:g(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:g(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:g(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:g(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,He($())},"init"),updateVal:g(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:g(function(e,t,a,r){const i=this;let o=0;function s(n){return g(function(T){o++;const l=i.sequenceItems.length-o+1;i.updateVal(T,"starty",t-l*h.boxMargin,Math.min),i.updateVal(T,"stopy",r+l*h.boxMargin,Math.max),i.updateVal(R.data,"startx",e-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopx",a+l*h.boxMargin,Math.max),n!=="activation"&&(i.updateVal(T,"startx",e-l*h.boxMargin,Math.min),i.updateVal(T,"stopx",a+l*h.boxMargin,Math.max),i.updateVal(R.data,"starty",t-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopy",r+l*h.boxMargin,Math.max))},"updateItemBounds")}g(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:g(function(e,t,a,r){const i=P.getMin(e,a),o=P.getMax(e,a),s=P.getMin(t,r),n=P.getMax(t,r);this.updateVal(R.data,"startx",i,Math.min),this.updateVal(R.data,"starty",s,Math.min),this.updateVal(R.data,"stopx",o,Math.max),this.updateVal(R.data,"stopy",n,Math.max),this.updateBounds(i,s,o,n)},"insert"),newActivation:g(function(e,t,a){const r=a.get(e.from),i=qt(e.from).length||0,o=r.x+r.width/2+(i-1)*h.activationWidth/2;this.activations.push({startx:o,starty:this.verticalPos+2,stopx:o+h.activationWidth,stopy:void 0,actor:e.from,anchored:F.anchorElement(t)})},"newActivation"),endActivation:g(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:g(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:g(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:g(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:R.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:g(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:g(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:g(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=P.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:g(function(){return this.verticalPos},"getVerticalPos"),getBounds:g(function(){return{bounds:this.data,models:this.models}},"getBounds")},Qr=g(async function(e,t,a){R.bumpVerticalPos(h.boxMargin),t.height=h.boxMargin,t.starty=R.getVerticalPos();const r=dt();r.x=t.startx,r.y=t.starty,r.width=t.width||h.width,r.class="note";const i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);const o=F.drawRect(i,r),s=ee();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=h.noteFontFamily,s.fontSize=h.noteFontSize,s.fontWeight=h.noteFontWeight,s.anchor=h.noteAlign,s.textMargin=h.noteMargin,s.valign="center";const n=Q(s.text)?await Wt(i,s):bt(i,s),E=Math.round(n.map(T=>(T._groups||T)[0][0].getBBox().height).reduce((T,l)=>T+l));o.attr("height",E+2*h.noteMargin),t.height+=E+2*h.noteMargin,R.bumpVerticalPos(E+2*h.noteMargin),t.stopy=t.starty+E+2*h.noteMargin,t.stopx=t.startx+r.width,R.insert(t.startx,t.starty,t.stopx,t.stopy),R.models.addNote(t)},"drawNote"),De=g(function(e,t,a,r,i,o,s){const n=r.db.getActors(),E=n.get(t.from),T=n.get(t.to),l=a.sequenceVisible;let x=E.x+E.width/2,u=T.x+T.width/2;const O=x<=u,p=Xe(t,r),f=e.append("g"),_=16.5,I=g((N,B)=>{const V=N?_:-_;return B?-V:V},"getCircleOffset"),L=g(N=>{f.append("circle").attr("cx",N).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:S,CENTRAL_CONNECTION_DUAL:A}=r.db.LINETYPE;if(l)switch(t.centralConnection){case b:p&&(u+=I(O,!0));break;case S:p||(x+=I(O,!1));break;case A:p?u+=I(O,!0):x+=I(O,!1);break}switch(t.centralConnection){case b:L(u);break;case S:L(x);break;case A:L(x),L(u);break}},"drawCentralConnection"),Rt=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Lt=g(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),jt=g(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Fe(e,t){R.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=t,o=P.splitBreaks(i).length,s=Q(i),n=s?await wt(i,$()):Z.calculateTextDimensions(i,Rt(h));if(!s){const x=n.height/o;t.height+=x,R.bumpVerticalPos(x)}let E,T=n.height-10;const l=n.width;if(a===r){E=R.getVerticalPos()+T,h.rightAngles||(T+=h.boxMargin,E=R.getVerticalPos()+T),T+=30;const x=P.getMax(l/2,h.width/2);R.insert(a-x,R.getVerticalPos()-10+T,r+x,R.getVerticalPos()+30+T)}else T+=h.boxMargin,E=R.getVerticalPos()+T,R.insert(a,E-10,r,E);return R.bumpVerticalPos(T),t.height+=T,t.stopy=t.starty+t.height,R.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}g(Fe,"boundMessage");var $r=g(async function(e,t,a,r,i,o){const{startx:s,stopx:n,starty:E,message:T,type:l,sequenceIndex:x,sequenceVisible:u}=t,O=Z.calculateTextDimensions(T,Rt(h)),p=ee();p.x=Math.min(s,n),p.y=E+10,p.width=Math.abs(n-s),p.class="messageText",p.dy="1em",p.text=T,p.fontFamily=h.messageFontFamily,p.fontSize=h.messageFontSize,p.fontWeight=h.messageFontWeight,p.anchor=h.messageAlign,p.valign="center",p.textMargin=h.wrapPadding,p.tspan=!1,Q(p.text)?await Wt(e,p,{startx:s,stopx:n,starty:a}):bt(e,p);const f=O.width;let _;if(s===n){const L=u||h.showSequenceNumbers,b=Xe(i,r),S=ia(i,r),A=s+(L&&(b||S)?10:0);h.rightAngles?_=e.append("path").attr("d",`M ${A},${a} H ${s+P.getMax(h.width/2,f/2)} V ${a+25} H ${s}`):_=e.append("path").attr("d","M "+A+","+a+" C "+(A+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),Qt(i,r)&&De(e,i,t,r,s,n,a)}else _=e.append("line"),_.attr("x1",s),_.attr("y1",a),_.attr("x2",n),_.attr("y2",a),Qt(i,r)&&De(e,i,t,r,s,n,a);l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||l===r.db.LINETYPE.SOLID_TOP_DOTTED||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||l===r.db.LINETYPE.STICK_TOP_DOTTED||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style("stroke-dasharray","3, 3"),_.attr("class","messageLine1")):_.attr("class","messageLine0"),_.attr("data-et","message"),_.attr("data-id","i"+t.id),_.attr("data-from",t.from),_.attr("data-to",t.to);let I="";if(h.arrowMarkerAbsolute&&(I=Tr(!0)),_.attr("stroke-width",2),_.attr("stroke","none"),_.style("fill","none"),(l===r.db.LINETYPE.SOLID_TOP||l===r.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-solidTopArrowHead)"),(l===r.db.LINETYPE.SOLID_BOTTOM||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.STICK_TOP||l===r.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-stickTopArrowHead)"),(l===r.db.LINETYPE.STICK_BOTTOM||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-solidTopArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-stickTopArrowHead)"),(l===r.db.LINETYPE.SOLID||l===r.db.LINETYPE.DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-arrowhead)"),(l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr("marker-start","url("+I+"#"+o+"-arrowhead)"),_.attr("marker-end","url("+I+"#"+o+"-arrowhead)")),(l===r.db.LINETYPE.SOLID_POINT||l===r.db.LINETYPE.DOTTED_POINT)&&_.attr("marker-end","url("+I+"#"+o+"-filled-head)"),(l===r.db.LINETYPE.SOLID_CROSS||l===r.db.LINETYPE.DOTTED_CROSS)&&_.attr("marker-end","url("+I+"#"+o+"-crosshead)"),u||h.showSequenceNumbers){const L=l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,S=6,A=Qt(i,r);let N=s,B=n;L?(ss?B=n-2*S:(B=n-S,N+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),B+=A?15:0,_.attr("x2",B),_.attr("x1",N)):_.attr("x1",s+S);let V=0;const q=s===n,U=s<=n;q?V=t.fromBounds+1:b?V=U?t.toBounds-1:t.fromBounds+1:V=U?t.fromBounds+1:t.toBounds-1;let G="12px";const X=x.toString().length;X>5?G="7px":X>3&&(G="9px"),e.append("line").attr("x1",V).attr("y1",a).attr("x2",V).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+o+"-sequencenumber)"),e.append("text").attr("x",V).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(x)}},"drawMessage"),jr=g(function(e,t,a,r,i,o,s){let n=0,E=0,T,l=0;for(const x of r){const u=t.get(x),O=u.box;T&&T!=O&&(s||R.models.addBox(T),E+=h.boxMargin+T.margin),O&&O!=T&&(s||(O.x=n+E,O.y=i),E+=O.margin),u.width=P.getMax(u.width||h.width,h.width),u.height=P.getMax(u.height||h.height,h.height),u.margin=u.margin||h.actorMargin,l=P.getMax(l,u.height),a.get(u.name)&&(E+=u.width/2),u.x=n+E,u.starty=R.getVerticalPos(),R.insert(u.x,i,u.x+u.width,u.height),n+=u.width+E,u.box&&(u.box.width=n+O.margin-u.box.x),E=u.margin,T=u.box,R.models.addActor(u)}T&&!s&&R.models.addBox(T),R.bumpVerticalPos(l)},"addActorRenderingData"),te=g(async function(e,t,a,r,i,o,s){if(r){let n=0;R.bumpVerticalPos(h.boxMargin*2);for(const E of a){const T=t.get(E);T.stopy||(T.stopy=R.getVerticalPos());const l=await F.drawActor(e,T,h,!0,i,o,s);n=P.getMax(n,l)}R.bumpVerticalPos(n+h.boxMargin)}else for(const n of a){const E=t.get(n);await F.drawActor(e,E,h,!1,i,o,s)}},"drawActors"),qe=g(function(e,t,a,r){let i=0,o=0;for(const s of a){const n=t.get(s),E=ea(n),T=F.drawPopup(e,n,E,h,h.forceMenus,r);T.height>i&&(i=T.height),T.width+n.x>o&&(o=T.width+n.x)}return{maxHeight:i,maxWidth:o}},"drawActorsPopup"),He=g(function(e){rr(h,e),e.fontFamily&&(h.actorFontFamily=h.noteFontFamily=h.messageFontFamily=e.fontFamily),e.fontSize&&(h.actorFontSize=h.noteFontSize=h.messageFontSize=e.fontSize),e.fontWeight&&(h.actorFontWeight=h.noteFontWeight=h.messageFontWeight=e.fontWeight)},"setConf"),qt=g(function(e){return R.activations.filter(function(t){return t.actor===e})},"actorActivations"),ve=g(function(e,t){const a=t.get(e),r=qt(e),i=r.reduce(function(s,n){return P.getMin(s,n.startx)},a.x+a.width/2-1),o=r.reduce(function(s,n){return P.getMax(s,n.stopx)},a.x+a.width/2+1);return[i,o]},"activationBounds");function ht(e,t,a,r,i){R.bumpVerticalPos(a);let o=r;if(t.id&&t.message&&e[t.id]){const s=e[t.id].width,n=Rt(h);t.message=Z.wrapLabel(`[${t.message}]`,s-2*h.wrapPadding,n),t.width=s,t.wrap=!0;const E=Z.calculateTextDimensions(t.message,n),T=P.getMax(E.height,h.labelBoxHeight);o=r+T,at.debug(`${T} - ${t.message}`)}i(t),R.bumpVerticalPos(o)}g(ht,"adjustLoopHeightForWrap");function ze(e,t,a,r,i,o,s){function n(l,x){l.x{m.add(D.from),m.add(D.to)}),f=f.filter(D=>m.has(D))}const A=new Map(f.map((m,D)=>[x.get(m)?.name??m,D]));jr(l,x,u,f,0,_,!1);const N=await oa(_,x,S,r);F.insertArrowHead(l,t),F.insertArrowCrossHead(l,t),F.insertArrowFilledHead(l,t),F.insertSequenceNumber(l,t),F.insertSolidTopArrowHead(l,t),F.insertSolidBottomArrowHead(l,t),F.insertStickTopArrowHead(l,t),F.insertStickBottomArrowHead(l,t),s==="neo"&&F.insertDropShadow(l,h);function B(m,D){const lt=R.endActivation(m);lt.starty+18>D&&(lt.starty=D-6,D+=12),F.drawActivation(l,lt,D,h,qt(m.from).length,r,A),R.insert(lt.startx,D-10,lt.stopx,D)}g(B,"activeEnd");let V=1,q=1;const U=[],G=[];let X=0;for(const m of _){let D,lt,et;switch(m.type){case r.db.LINETYPE.NOTE:R.resetVerticalPos(),lt=m.noteModel,await Qr(l,lt,m.id);break;case r.db.LINETYPE.ACTIVE_START:R.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION:R.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:R.newActivation(m,l,x);break;case r.db.LINETYPE.ACTIVE_END:B(m,R.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.LOOP_END:D=R.endLoop(),await F.drawLoop(l,D,"loop",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.RECT_START:ht(N,m,h.boxMargin,h.boxMargin,W=>R.newLoop(void 0,W.message));break;case r.db.LINETYPE.RECT_END:D=R.endLoop(),G.push(D),R.models.addLoop(D),R.bumpVerticalPos(D.stopy-R.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.OPT_END:D=R.endLoop(),await F.drawLoop(l,D,"opt",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.ALT_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.ALT_ELSE:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.ALT_END:D=R.endLoop(),await F.drawLoop(l,D,"alt",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W)),R.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.PAR_END:D=R.endLoop(),await F.drawLoop(l,D,"par",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.AUTONUMBER:V=m.message.start||V,q=m.message.step||q,m.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.CRITICAL_END:D=R.endLoop(),await F.drawLoop(l,D,"critical",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.BREAK_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.BREAK_END:D=R.endLoop(),await F.drawLoop(l,D,"break",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;default:try{et=m.msgModel,et.starty=R.getVerticalPos(),et.sequenceIndex=V,et.sequenceVisible=r.db.showSequenceNumbers(),et.id=m.id,et.from=m.from,et.to=m.to;const W=await Fe(l,et);ze(m,et,W,X,x,u,O),U.push({messageModel:et,lineStartY:W,msg:m}),R.models.addMessage(et)}catch(W){at.error("error while drawing message",W)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&(V=Math.round((V+q)*100)/100),X++}at.debug("createdActors",u),at.debug("destroyedActors",O),await te(l,x,f,!1,t,r,A);for(const m of U)await $r(l,m.messageModel,m.lineStartY,r,m.msg,t);h.mirrorActors&&await te(l,x,f,!0,t,r,A),G.forEach(m=>F.drawBackgroundRect(l,m)),Ye(l,x,f,h);for(const m of R.models.boxes){m.height=R.getVerticalPos()-m.y,R.insert(m.x,m.y,m.x+m.width,m.height);const D=h.boxMargin*2;m.startx=m.x-D,m.starty=m.y-D*.25,m.stopx=m.startx+m.width+2*D,m.stopy=m.starty+m.height+D*.75,m.stroke="rgb(0,0,0, 0.5)",F.drawBox(l,m,h)}L&&R.bumpVerticalPos(h.boxMargin);const j=qe(l,x,f,T),{bounds:H}=R.getBounds();H.startx===void 0&&(H.startx=0),H.starty===void 0&&(H.starty=0),H.stopx===void 0&&(H.stopx=0),H.stopy===void 0&&(H.stopy=0);let st=H.stopy-H.starty;st{const s=Rt(h);let n=o.actorKeys.reduce((x,u)=>x+=e.get(u).width+(e.get(u).margin||0),0);const E=h.boxMargin*8;n+=E,n-=2*h.boxTextMargin,o.wrap&&(o.name=Z.wrapLabel(o.name,n-2*h.wrapPadding,s));const T=Z.calculateTextDimensions(o.name,s);i=P.getMax(T.height,i);const l=P.getMax(n,T.width+2*h.wrapPadding);if(o.margin=h.boxTextMargin,no.textMaxHeight=i),P.getMax(r,h.height)}g(Ge,"calculateActorMargins");var ra=g(async function(e,t,a){const r=t.get(e.from),i=t.get(e.to),o=r.x,s=i.x,n=e.wrap&&e.message;let E=Q(e.message)?await wt(e.message,$()):Z.calculateTextDimensions(n?Z.wrapLabel(e.message,h.width,Lt(h)):e.message,Lt(h));const T={width:n?h.width:P.getMax(h.width,E.width+2*h.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(T.width=n?P.getMax(h.width,E.width):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=o+(r.width+h.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(T.width=n?P.getMax(h.width,E.width+2*h.noteMargin):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=o-T.width+(r.width-h.actorMargin)/2):e.to===e.from?(E=Z.calculateTextDimensions(n?Z.wrapLabel(e.message,P.getMax(h.width,r.width),Lt(h)):e.message,Lt(h)),T.width=n?P.getMax(h.width,r.width):P.getMax(r.width,h.width,E.width+2*h.noteMargin),T.startx=o+(r.width-T.width)/2):(T.width=Math.abs(o+r.width/2-(s+i.width/2))+h.actorMargin,T.startx=o2,u=g(_=>E?-_:_,"adjustValue");e.from===e.to?l=T:(e.activate&&!x&&(l+=u(h.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(l+=u(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(T-=u(3)));const O=[i,o,s,n],p=Math.abs(T-l);e.wrap&&e.message&&(e.message=Z.wrapLabel(e.message,P.getMax(p+2*h.wrapPadding,h.width),Rt(h)));const f=Z.calculateTextDimensions(e.message,Rt(h));return{width:P.getMax(e.wrap?0:f.width+2*h.wrapPadding,p+2*h.wrapPadding,h.width),height:0,startx:T,stopx:l,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),oa=g(async function(e,t,a,r){const i={},o=[];let s,n,E;for(const T of e){switch(T.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:o.push({id:T.id,msg:T.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:T.message&&(s=o.pop(),i[s.id]=s,i[T.id]=s,o.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=o.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const x=t.get(T.from?T.from:T.to.actor),u=qt(T.from?T.from:T.to.actor).length,O=x.x+x.width/2+(u-1)*h.activationWidth/2,p={startx:O,stopx:O+h.activationWidth,actor:T.from,enabled:!0};R.activations.push(p)}break;case r.db.LINETYPE.ACTIVE_END:{const x=R.activations.map(u=>u.actor).lastIndexOf(T.from);R.activations.splice(x,1).splice(0,1)}break}T.placement!==void 0?(n=await ra(T,t,r),T.noteModel=n,o.forEach(x=>{s=x,s.from=P.getMin(s.from,n.startx),s.to=P.getMax(s.to,n.startx+n.width),s.width=P.getMax(s.width,Math.abs(s.from-s.to))-h.labelBoxWidth})):(E=na(T,t,r),T.msgModel=E,E.startx&&E.stopx&&o.length>0&&o.forEach(x=>{if(s=x,E.startx===E.stopx){const u=t.get(T.from),O=t.get(T.to);s.from=P.getMin(u.x-E.width/2,u.x-u.width/2,s.from),s.to=P.getMax(O.x+E.width/2,O.x+u.width/2,s.to),s.width=P.getMax(s.width,Math.abs(s.to-s.from))-h.labelBoxWidth}else s.from=P.getMin(E.startx,s.from),s.to=P.getMax(E.stopx,s.to),s.width=P.getMax(s.width,E.width)-h.labelBoxWidth}))}return R.activations=[],at.debug("Loop type widths:",i),i},"calculateLoopBounds"),ca={bounds:R,drawActors:te,drawActorsPopup:qe,setConf:He,draw:ta},pa={parser:fr,get db(){return new Ir},renderer:ca,styles:Rr,init:g(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,tr({sequence:{wrap:e.wrap}}))},"init")};export{pa as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js b/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js new file mode 100644 index 0000000000..3982016cda --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js @@ -0,0 +1,162 @@ +import{_ as g,n as tr,c as $,d as Mt,l as at,j as Ce,e as er,f as rr,k as P,b as ke,s as ar,p as sr,a as ir,g as nr,q as or,t as cr,J as lr,z as hr,i as Bt,u as Z,L as Q,M as wt,N as Me,Z as dr,D as Yt,O as Tr,P as Be}from"./mermaidParser.worker-Dx4jPi9z.js";import{a as pr,b as ee,g as dt,d as Er,e as re,f as ae}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{I as ur}from"./chunk-QZHKN3VN-_Rz9_NuS.js";var $t=(function(){var e=g(function(ut,w,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=w);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],o=[1,9],s=[1,11],n=[1,12],E=[1,14],T=[1,15],l=[1,17],x=[1,18],u=[1,19],O=[1,25],p=[1,26],f=[1,27],_=[1,28],I=[1,29],L=[1,30],b=[1,31],S=[1,32],A=[1,33],N=[1,34],B=[1,35],V=[1,36],q=[1,37],U=[1,38],G=[1,39],X=[1,40],j=[1,42],H=[1,43],st=[1,44],tt=[1,45],it=[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],Nt=[1,74],m=[1,80],D=[1,81],lt=[1,82],et=[1,83],W=[1,84],se=[1,85],ie=[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],mt=[4,5,17,51,53,54],Pt=[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],Ht=[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],zt=[5,52],K=[70,71,72,73],ot=[1,151],Ut={trace:g(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:g(function(w,v,k,y,z,c,At){var d=c.length-1;switch(z){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-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[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};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[d].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:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},e(C,[2,5]),{9:48,13:13,14:E,15:T,18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,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:Nt},{23:75,55:76,73:Nt},{23:77,73:Y},{69:78,72:[1,79],78:m,79:D,80:lt,81:et,82:W,83:se,84:ie,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(mt,[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(Pt,i,{7:120}),e(Pt,i,{7:121}),e(Pt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ht,i,{43:125,7:126}),e(Ht,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Pt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(zt,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:m,79:D,80:lt,81:et,82:W,83:se,84:ie,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(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[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:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,161],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,162],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,163],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,164]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,47],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,50:[1,165],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,166]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,45],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,49:[1,167],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[2,43],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,48:[1,170],51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{4:o,5:s,8:8,9:10,10:n,13:13,14:E,15:T,17:[1,171],18:16,19:l,22:x,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:p,32:f,34:_,36:I,37:L,38:b,39:S,40:A,42:N,44:B,45:V,47:q,51:U,53:G,54:X,56:j,61:H,62:st,63:tt,64:it,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(zt,[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(mt,[2,11]),{13:186,51:U,53:G,54:X},e(mt,[2,13]),e(mt,[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(mt,[2,12]),e(me,i,{7:124,41:201}),e(Ht,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(zt,[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:g(function(w,v){if(v.recoverable)this.trace(w);else{var k=new Error(w);throw k.hash=v,k}},"parseError"),parse:g(function(w){var v=this,k=[0],y=[],z=[null],c=[],At=this.table,d="",Dt=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(gt.yy[Gt]=this.yy[Gt]);J.setInput(w,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Xt=J.yylloc;c.push(Xt);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(nt){k.length=k.length-2*nt,z.length=z.length-nt,c.length=c.length-nt}g(je,"popStack");function Ne(){var nt;return nt=y.pop()||J.lex()||we,typeof nt!="number"&&(nt instanceof Array&&(y=nt,nt=y.pop()),nt=v.symbols_[nt]||nt),nt}g(Ne,"lex");for(var rt,xt,ct,Jt,Ot={},vt,Tt,Pe,Ct;;){if(xt=k[k.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=At[xt]&&At[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var Zt="";Ct=[];for(vt in At[xt])this.terminals_[vt]&&vt>Ze&&Ct.push("'"+this.terminals_[vt]+"'");J.showPosition?Zt="Parse error on line "+(Dt+1)+`: +`+J.showPosition()+` +Expecting `+Ct.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":Zt="Parse error on line "+(Dt+1)+": Unexpected "+(rt==we?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(Zt,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Xt,expected:Ct})}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:k.push(rt),z.push(J.yytext),c.push(J.yylloc),k.push(ct[1]),rt=null,Se=J.yyleng,d=J.yytext,Dt=J.yylineno,Xt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Ot.$=z[z.length-Tt],Ot._$={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&&(Ot._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Jt=this.performAction.apply(Ot,[d,Se,Dt,gt.yy,ct[1],z,c].concat(Qe)),typeof Jt<"u")return Jt;Tt&&(k=k.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),k.push(this.productions_[ct[1]][0]),z.push(Ot.$),c.push(Ot._$),Pe=At[k[k.length-2]][k[k.length-1]],k.push(Pe);break;case 3:return!0}}return!0},"parse")},Je=(function(){var ut={EOF:1,parseError:g(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:g(function(w,v){return this.yy=v||this.yy||{},this._input=w,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:g(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var v=w.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),w},"input"),unput:g(function(w){var v=w.length,k=w.split(/(?:\r\n?|\n)/g);this._input=w+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),k.length-1&&(this.yylineno-=k.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:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[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:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(w){this.unput(this.match.slice(w))},"less"),pastInput:g(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var w=this.pastInput(),v=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:g(function(w,v){var k,y,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),y=w[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],k=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var c in z)this[c]=z[c];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,v,k,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),c=0;cv[0].length)){if(v=k,y=c,this.options.backtrack_lexer){if(w=this.test_match(k,z[c]),w!==!1)return w;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(w=this.test_match(v,z[y]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var v=this.next();return v||this.lex()},"lex"),begin:g(function(v){this.conditionStack.push(v)},"begin"),popState:g(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:g(function(v){this.begin(v)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(v,k,y,z){switch(y){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return k.yytext=k.yytext.trim(),73;case 12:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),73;case 13:return k.yytext=k.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return k.yytext=k.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return k.yytext=k.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Ut.lexer=Je;function kt(){this.yy={}}return g(kt,"Parser"),kt.prototype=Ut,Ut.Parser=kt,new kt})();$t.parser=$t;var fr=$t,_r={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},gr={FILLED:0,OPEN:1},xr={LEFTOF:0,RIGHTOF:1,OVER:2},Vt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Ir=class{constructor(){this.state=new ur(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ke,this.setAccDescription=ar,this.setDiagramTitle=sr,this.getAccTitle=ir,this.getAccDescription=nr,this.getDiagramTitle=or,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=_r,this.ARROWTYPE=gr,this.PLACEMENT=xr}static{g(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,a,r,i){let o=this.state.records.currentBox,s;if(i!==void 0){let E;i.includes(` +`)?E=i+` +`:E=`{ +`+i+` +}`,s=cr(E,{schema:lr})}r=s?.type??r,s?.alias&&(!a||a.text===t)&&(a={text:s.alias,wrap:a?.wrap,type:r});const n=this.state.records.actors.get(e);if(n){if(this.state.records.currentBox&&n.box&&this.state.records.currentBox!==n.box)throw new Error(`A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=n.box?n.box:this.state.records.currentBox,n.box=o,n&&t===n.name&&a==null)return}if(a?.text==null&&(a={text:t,type:r}),(r==null||a.text==null)&&(a={text:t,type:r}),this.state.records.actors.set(e,{box:o,name:t,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const E=this.state.records.actors.get(this.state.records.prevActor);E&&(E.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,a=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},n}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:o??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),hr()}parseMessage(e){const t=e.trim(),{wrap:a,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:a};return at.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let a=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",r=e.trim());else{const s=new Option().style;s.color=a,s.color!==a&&(a="transparent",r=e.trim())}const{wrap:i,cleanedText:o}=this.extractWrap(r);return{text:o?Bt(o,$()):void 0,color:a,wrap:i}}addNote(e,t,a){const r={actor:e,placement:t,message:a.text,wrap:a.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const a=this.getActor(e);try{let r=Bt(t.text,$());r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const i=JSON.parse(r);this.insertLinks(a,i)}catch(r){at.error("error while parsing actor link text",r)}}addALink(e,t){const a=this.getActor(e);try{const r={};let i=Bt(t.text,$());const o=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=i.slice(0,o-1).trim(),n=i.slice(o+1).trim();r[s]=n,this.insertLinks(a,r)}catch(r){at.error("error while parsing actor link text",r)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(const a in t)e.links[a]=t[a]}addProperties(e,t){const a=this.getActor(e);try{const r=Bt(t.text,$()),i=JSON.parse(r);this.insertProperties(a,i)}catch(r){at.error("error while parsing actor properties text",r)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(const a in t)e.properties[a]=t[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const a=this.getActor(e),r=document.getElementById(t.text);try{const i=r.innerHTML,o=JSON.parse(i);o.properties&&this.insertProperties(a,o.properties),o.links&&this.insertLinks(a,o.links)}catch(i){at.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":ke(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return $().sequence}},yr=g(e=>{const t=e.dropShadow??"none",{look:a}=$();return`.actor { + stroke: ${e.actorBorder}; + fill: ${e.actorBkg}; + stroke-width: ${e.strokeWidth??1}; + } + + rect.actor.outer-path[data-look="neo"] { + filter: ${t}; + } + + rect.note[data-look="neo"] { + stroke:${e.noteBorderColor}; + fill:${e.noteBkgColor}; + filter: ${t}; + } + + text.actor > tspan { + fill: ${e.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${e.actorLineColor}; + } + + .innerArc { + stroke-width: 1.5; + stroke-dasharray: none; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${e.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${e.signalColor}; + } + + [id$="-arrowhead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .sequenceNumber { + fill: ${e.sequenceNumberColor}; + } + + [id$="-sequencenumber"] { + fill: ${e.signalColor}; + } + + [id$="-crosshead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .messageText { + fill: ${e.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBkgColor}; + filter: ${a==="neo"?t:"none"}; + } + + .labelText, .labelText > tspan { + fill: ${e.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .sectionTitle, .sectionTitle > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${e.noteTextColor}; + stroke: none; + ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} + } + + .activation0 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation1 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation2 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${e.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man circle, line { + fill: ${e.actorBkg}; + stroke-width: 2px; + } + + g rect.rect { + filter: ${t}; + stroke: ${e.nodeBorder}; + } +`},"getStyles"),Rr=yr,It=36,ft="actor-top",_t="actor-bottom",Kt="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),St=g(function(e,t){const a=Er(e,t);return Yt().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Or=g(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const o=t.links,s=t.actorCnt,n=t.rectData;var E="none";i&&(E="block !important");const T=e.append("g");T.attr("id","actor"+s+"_popup"),T.attr("class","actorPopupMenu"),T.attr("display",E);var l="";n.class!==void 0&&(l=" "+n.class);let x=n.width>a?n.width:a;const u=T.append("rect");if(u.attr("class","actorPopupMenuPanel"+l),u.attr("x",n.x),u.attr("y",n.height),u.attr("fill",n.fill),u.attr("stroke",n.stroke),u.attr("width",x),u.attr("height",n.height),u.attr("rx",n.rx),u.attr("ry",n.ry),o!=null){var O=20;for(let _ in o){var p=T.append("a"),f=Ce.sanitizeUrl(o[_]);p.attr("xlink:href",f),p.attr("target","_blank"),Ur(r)(_,p,n.x+10,n.height+O,x,20,{class:"actor"},r),O+=30}}return u.attr("height",O),{height:n.height+O,width:x}},"drawPopup"),Ft=g(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Wt=g(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Be(t.text,Yt()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const n=e.node().firstChild;n.setAttribute("height",s.height+2*t.textMargin);const E=n.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:n,stopx:E,starty:T}=a;if(n>E){const l=n;n=E,E=l}r.attr("x",Math.round(n+Math.abs(n-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(T)):r.attr("y",Math.round(T-s.height))}return[r]},"drawKatex"),bt=g(function(e,t){let a=0,r=0;const i=t.text.split(P.lineBreakRegex),[o,s]=Me(t.fontSize);let n=[],E=0,T=g(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":T=g(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":T=g(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":T=g(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[l,x]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&o!==void 0&&(E=l*o);const u=e.append("text");u.attr("x",t.x),u.attr("y",T()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);const O=x||dr;if(t.tspan){const p=u.append("tspan");p.attr("x",t.x),t.fill!==void 0&&p.attr("fill",t.fill),p.text(O)}else u.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),n.push(u)}return n},"drawText"),Ve=g(function(e,t){function a(i,o,s,n,E){return i+","+o+" "+(i+s)+","+o+" "+(i+s)+","+(o+n-E)+" "+(i+s-E*1.2)+","+(o+n)+" "+i+","+(o+n)}g(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,bt(e,t),r},"drawLabel"),M=-1,Ye=g((e,t,a,r)=>{e.select&&a.forEach(i=>{const o=t.get(i),s=e.select("#actor"+o.actorCnt);!r.mirrorActors&&o.stopy?s.attr("y2",o.stopy+o.height/2):r.mirrorActors&&s.attr("y2",o.stopy)})},"fixLifeLineHeights"),Lr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();var p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.class=_,f.rx=3,f.ry=3,f.name=t.name,E==="neo"&&(f.rx=6,f.ry=6);const I=St(p,f),L=i.get(t.name)??0;if(pt.has(T)&&(I.style("stroke",u[L%u.length]),I.style("fill",x[L%u.length])),E==="neo"&&I.attr("filter","url(#drop-shadow)"),t.rectData=f,t.properties?.icon){const S=t.properties.icon.trim();S.charAt(0)==="@"?re(p,f.x+f.width-20,f.y+10,S.substr(1)):ae(p,f.x+f.width-20,f.y+10,S)}r||(p.attr("data-et","participant"),p.attr("data-type","participant"),p.attr("data-id",t.name)),Et(a,Q(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Kt}`},a);let b=t.height;if(I.node){const S=I.node().getBBox();t.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),br=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();var p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();var _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.class=_,f.name=t.name;const I=6,L={...f,x:f.x+-I,y:f.y+ +I,class:"actor"},b=St(p,f),S=St(p,L);t.rectData=f,E==="neo"&&p.attr("filter","url(#drop-shadow)");const A=i.get(t.name)??0;if(pt.has(T)&&(b.style("stroke",u[A%u.length]),b.style("fill",x[A%u.length]),S.style("stroke",u[A%u.length]),S.style("fill",x[A%u.length])),t.properties?.icon){const B=t.properties.icon.trim();B.charAt(0)==="@"?re(p,f.x+f.width-20,f.y+10,B.substr(1)):ae(p,f.x+f.width-20,f.y+10,B)}Et(a,Q(t.description))(t.description,p,f.x-I,f.y+I,f.width,f.height,{class:`actor ${Kt}`},a);let N=t.height;if(b.node){const B=b.node().getBBox();t.height=B.height,N=B.height}return r||(p.attr("data-et","participant"),p.attr("data-type","collections"),p.attr("data-id",t.name)),N},"drawActorTypeCollections"),mr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower();let p=O;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&p.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),p=O.append("g"),t.actorCnt=M,t.links!=null&&p.attr("id","root-"+M),E==="neo"&&p.attr("data-look","neo"));const f=dt();let _="actor";t.properties?.class?_=t.properties.class:f.fill="#eaeaea",r?_+=` ${_t}`:_+=` ${ft}`,p.attr("class",_),f.x=t.x,f.y=o,f.width=t.width,f.height=t.height,f.name=t.name;const I=f.height/2,L=I/(2.5+f.height/50),b=p.append("g"),S=p.append("g"),A=`M ${f.x},${f.y+I} + a ${L},${I} 0 0 0 0,${f.height} + h ${f.width-2*L} + a ${L},${I} 0 0 0 0,-${f.height} + Z + `;b.append("path").attr("d",A),S.append("path").attr("d",`M ${f.x},${f.y+I} + a ${L},${I} 0 0 0 0,${f.height}`),b.attr("transform",`translate(${L}, ${-(f.height/2)})`),S.attr("transform",`translate(${f.width-L}, ${-f.height/2})`),t.rectData=f,E==="neo"&&b.attr("filter","url(#drop-shadow)");const N=i.get(t.name)??0;if(pt.has(T)&&(b.style("stroke",u[N%u.length]),b.style("fill",x[N%u.length]),S.style("stroke",u[N%u.length]),S.style("fill",x[N%u.length])),t.properties?.icon){const q=t.properties.icon.trim(),U=f.x+f.width-20,G=f.y+10;q.charAt(0)==="@"?re(p,U,G,q.substr(1)):ae(p,U,G,q)}Et(a,Q(t.description))(t.description,p,f.x,f.y,f.width,f.height,{class:`actor ${Kt}`},a);let B=t.height;const V=b.select("path:last-child");if(V.node()){const q=V.node().getBBox();t.height=q.height,B=q.height}return r||(p.attr("data-et","participant"),p.attr("data-type","queue"),p.attr("data-id",t.name)),B},"drawActorTypeQueue"),Ar=g(function(e,t,a,r,i,o){const s=r?t.stopy:t.starty,n=t.x+t.width/2,E=s+75,{look:T,theme:l,themeVariables:x}=a,{bkgColorArray:u,borderColorArray:O,actorBorder:p,actorBkg:f}=x,_=e.append("g").lower();r||(M++,_.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",E).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const S=t.x+t.width/2,A=s+32,N=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",S).attr("cy",A).attr("r",N).attr("filter",`${T==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${S}, ${A-N})`);const B=o.get(t.name)??0;pt.has(l)?(I.style("stroke",O[B%O.length]),I.style("fill",u[B%O.length])):(I.style("stroke",p),I.style("fill",f));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+N+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),Sr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+75,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u}=l,O=e.append("g").lower(),p=e.append("g");let f="actor";r?f+=` ${_t}`:f+=` ${ft}`,p.attr("class",f),p.attr("name",t.name);const _=dt();_.x=t.x,_.y=o,_.fill="#eaeaea",_.width=t.width,_.height=t.height,_.class="actor";const I=t.x+t.width/2,L=o+(r?10:25),b=22;p.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),p.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),E==="neo"&&p.attr("filter","url(#drop-shadow)");const S=i.get(t.name)??0;pt.has(T)&&(p.style("stroke",u[S%u.length]),p.style("fill",x[S%u.length]));const A=p.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(M++,O.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M),Et(a,Q(t.description))(t.description,p,_.x,_.y+(r?15:30),_.width,_.height,{class:`actor ${yt}`},a),r?p.attr("transform",`translate(0, ${b})`):(p.attr("transform",`translate(0, ${b/2-5})`),p.attr("data-et","participant"),p.attr("data-type","entity"),p.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),wr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+t.height+2*a.boxTextMargin,{theme:E,themeVariables:T,look:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:O}=T,p=e.append("g").lower();let f=p;r||(M++,Object.keys(t.links||{}).length&&!a.forceMenus&&f.attr("onclick",Ft(`actor${M}_popup`)).attr("cursor","pointer"),f.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),f=p.append("g"),t.actorCnt=M,t.links!=null&&f.attr("id","root-"+M),l==="neo"&&f.attr("data-look","neo"));const _=dt();let I="actor";t.properties?.class?I=t.properties.class:_.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,_.x=t.x,_.y=o,_.width=t.width,_.height=t.height,_.class=I,_.name=t.name,_.x=t.x,_.y=o;const L=_.width/3,b=_.width/3,S=L/2,A=S/(2.5+L/50),N=f.append("g");N.attr("class",I);const B=` + M ${_.x},${_.y+A} + a ${S},${A} 0 0 0 ${L},0 + a ${S},${A} 0 0 0 -${L},0 + l 0,${b-2*A} + a ${S},${A} 0 0 0 ${L},0 + l 0,-${b-2*A} +`;N.append("path").attr("d",B),l==="neo"&&N.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(E)?(N.style("stroke",u[V%u.length]),N.style("fill",x[V%u.length])):N.style("stroke",O),N.attr("transform",`translate(${L}, ${A})`),t.rectData=_,Et(a,Q(t.description))(t.description,f,_.x,_.y+35,_.width,_.height,{class:`actor ${Kt}`},a);const q=N.select("path:last-child");if(q.node()){const U=q.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Nr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+80,E=22,T=e.append("g").lower(),{look:l,theme:x,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:p,actorBorder:f}=u;r||(M++,T.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const _=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,_.attr("class",I),_.attr("name",t.name);const L=dt();L.x=t.x,L.y=o,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",_.append("line").attr("id","actor-man-torso"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",o+12).attr("x2",t.x+t.width/2-15).attr("y2",o+12),_.append("line").attr("id","actor-man-arms"+M).attr("x1",t.x+t.width/2-E*2.5).attr("y1",o+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",o+22),_.append("circle").attr("cx",t.x+t.width/2).attr("cy",o+12).attr("r",E),l==="neo"&&_.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(x)?(_.style("stroke",p[b%p.length]),_.style("fill",O[b%p.length])):_.style("stroke",f);const S=_.node().getBBox();return t.height=S.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,_,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),_.attr("transform",`translate(0,${E/2+10})`),r||(_.attr("data-et","participant"),_.attr("data-type","boundary"),_.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Pr=g(function(e,t,a,r,i){const o=r?t.stopy:t.starty,s=t.x+t.width/2,n=o+80,{look:E,theme:T,themeVariables:l}=a,{bkgColorArray:x,borderColorArray:u,actorBorder:O}=l,p=e.append("g").lower();r||(M++,p.append("line").attr("id","actor"+M).attr("x1",s).attr("y1",n).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=M);const f=e.append("g");let _=yt;r?_+=` ${_t}`:_+=` ${ft}`,f.attr("class",_),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?o+(1-I)*30:o;f.append("line").attr("id","actor-man-torso"+M).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("id","actor-man-arms"+M).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),f.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),f.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=f.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const S=f.node().getBBox();t.height=S.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const N=i.get(t.name)??0;return pt.has(T)?(f.style("stroke",u[N%u.length]),f.style("fill",x[N%u.length])):f.style("stroke",O),Et(a,Q(t.description))(t.description,f,A.x,L+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),kr=g(async function(e,t,a,r,i,o,s){const n=s??new Map([...o.db.getActors().values()].map((E,T)=>[E.name,T]));switch(t.type){case"actor":return await Pr(e,t,a,r,n);case"participant":return await Lr(e,t,a,r,n);case"boundary":return await Nr(e,t,a,r,n);case"control":return await Ar(e,t,a,r,i,n);case"entity":return await Sr(e,t,a,r,n);case"database":return await wr(e,t,a,r,n);case"collections":return await br(e,t,a,r,n);case"queue":return await mr(e,t,a,r,n)}},"drawActor"),Dr=g(function(e,t,a){const i=e.append("g");We(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),vr=g(function(e){return e.append("g")},"anchorElement"),Cr=g(function(e,t,a,r,i,o,s){const{theme:n,themeVariables:E}=r,{bkgColorArray:T,borderColorArray:l,mainBkg:x}=E,u=dt(),O=t.anchored,p=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const f=St(O,u),I=(s??new Map([...o.db.getActors().values()].map((L,b)=>[L.name,b]))).get(p)??0;pt.has(n)&&(f.style("stroke",l[I%l.length]),f.style("fill",T[I%l.length]??x))},"drawActivation"),Mr=g(async function(e,t,a,r,i){const{boxMargin:o,boxTextMargin:s,labelBoxHeight:n,labelBoxWidth:E,messageFontFamily:T,messageFontSize:l,messageFontWeight:x}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),O=g(function(_,I,L,b){return u.append("line").attr("x1",_).attr("y1",I).attr("x2",L).attr("y2",b).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(_){O(t.startx,_.y,t.stopx,_.y).style("stroke-dasharray","3, 3")});let p=ee();p.text=a,p.x=t.startx,p.y=t.starty,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=Math.max(E??0,50),p.height=n+(r.look==="neo"?15:0)||20,p.textMargin=s,p.class="labelText",Ve(u,p),p=Ke(),p.text=t.title,p.x=t.startx+E/2+(t.stopx-t.startx)/2,p.y=t.starty+o+s,p.anchor="middle",p.valign="middle",p.textMargin=s,p.class="loopText",p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=!0;let f=Q(p.text)?await Wt(u,p,t):bt(u,p);if(t.sectionTitles!==void 0){for(const[_,I]of Object.entries(t.sectionTitles))if(I.message){p.text=I.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[_].y+o+s,p.class="sectionTitle",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=T,p.fontSize=l,p.fontWeight=x,p.wrap=t.wrap,Q(p.text)?(t.starty=t.sections[_].y,await Wt(u,p,t)):bt(u,p);let L=Math.round(f.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,S)=>b+S));t.sections[_].height+=L-(o+s)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),We=g(function(e,t){pr(e,t)},"drawBackgroundRect"),Br=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Vr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Yr=g(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Wr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Kr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Fr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),qr=g(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),Hr=g(function(e,t){const{theme:a}=t;e.append("defs").append("filter").attr("id","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",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Ke=g(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),zr=g(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(o,s,n,E,T,l,x){const u=s.append("text").attr("x",n+T/2).attr("y",E+l/2+5).style("text-anchor","middle").text(o);i(u,x)}g(e,"byText");function t(o,s,n,E,T,l,x,u){const{actorFontSize:O,actorFontFamily:p,actorFontWeight:f}=u,[_,I]=Me(O),L=o.split(P.lineBreakRegex);for(let b=0;be.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:g(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:g(function(e){this.boxes.push(e)},"addBox"),addActor:g(function(e){this.actors.push(e)},"addActor"),addLoop:g(function(e){this.loops.push(e)},"addLoop"),addMessage:g(function(e){this.messages.push(e)},"addMessage"),addNote:g(function(e){this.notes.push(e)},"addNote"),lastActor:g(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:g(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:g(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:g(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:g(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,He($())},"init"),updateVal:g(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:g(function(e,t,a,r){const i=this;let o=0;function s(n){return g(function(T){o++;const l=i.sequenceItems.length-o+1;i.updateVal(T,"starty",t-l*h.boxMargin,Math.min),i.updateVal(T,"stopy",r+l*h.boxMargin,Math.max),i.updateVal(R.data,"startx",e-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopx",a+l*h.boxMargin,Math.max),n!=="activation"&&(i.updateVal(T,"startx",e-l*h.boxMargin,Math.min),i.updateVal(T,"stopx",a+l*h.boxMargin,Math.max),i.updateVal(R.data,"starty",t-l*h.boxMargin,Math.min),i.updateVal(R.data,"stopy",r+l*h.boxMargin,Math.max))},"updateItemBounds")}g(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:g(function(e,t,a,r){const i=P.getMin(e,a),o=P.getMax(e,a),s=P.getMin(t,r),n=P.getMax(t,r);this.updateVal(R.data,"startx",i,Math.min),this.updateVal(R.data,"starty",s,Math.min),this.updateVal(R.data,"stopx",o,Math.max),this.updateVal(R.data,"stopy",n,Math.max),this.updateBounds(i,s,o,n)},"insert"),newActivation:g(function(e,t,a){const r=a.get(e.from),i=qt(e.from).length||0,o=r.x+r.width/2+(i-1)*h.activationWidth/2;this.activations.push({startx:o,starty:this.verticalPos+2,stopx:o+h.activationWidth,stopy:void 0,actor:e.from,anchored:F.anchorElement(t)})},"newActivation"),endActivation:g(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:g(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:g(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:g(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:g(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:R.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:g(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:g(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:g(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=P.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:g(function(){return this.verticalPos},"getVerticalPos"),getBounds:g(function(){return{bounds:this.data,models:this.models}},"getBounds")},Qr=g(async function(e,t,a){R.bumpVerticalPos(h.boxMargin),t.height=h.boxMargin,t.starty=R.getVerticalPos();const r=dt();r.x=t.startx,r.y=t.starty,r.width=t.width||h.width,r.class="note";const i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);const o=F.drawRect(i,r),s=ee();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=h.noteFontFamily,s.fontSize=h.noteFontSize,s.fontWeight=h.noteFontWeight,s.anchor=h.noteAlign,s.textMargin=h.noteMargin,s.valign="center";const n=Q(s.text)?await Wt(i,s):bt(i,s),E=Math.round(n.map(T=>(T._groups||T)[0][0].getBBox().height).reduce((T,l)=>T+l));o.attr("height",E+2*h.noteMargin),t.height+=E+2*h.noteMargin,R.bumpVerticalPos(E+2*h.noteMargin),t.stopy=t.starty+E+2*h.noteMargin,t.stopx=t.startx+r.width,R.insert(t.startx,t.starty,t.stopx,t.stopy),R.models.addNote(t)},"drawNote"),De=g(function(e,t,a,r,i,o,s){const n=r.db.getActors(),E=n.get(t.from),T=n.get(t.to),l=a.sequenceVisible;let x=E.x+E.width/2,u=T.x+T.width/2;const O=x<=u,p=Xe(t,r),f=e.append("g"),_=16.5,I=g((N,B)=>{const V=N?_:-_;return B?-V:V},"getCircleOffset"),L=g(N=>{f.append("circle").attr("cx",N).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:S,CENTRAL_CONNECTION_DUAL:A}=r.db.LINETYPE;if(l)switch(t.centralConnection){case b:p&&(u+=I(O,!0));break;case S:p||(x+=I(O,!1));break;case A:p?u+=I(O,!0):x+=I(O,!1);break}switch(t.centralConnection){case b:L(u);break;case S:L(x);break;case A:L(x),L(u);break}},"drawCentralConnection"),Rt=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Lt=g(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),jt=g(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Fe(e,t){R.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=t,o=P.splitBreaks(i).length,s=Q(i),n=s?await wt(i,$()):Z.calculateTextDimensions(i,Rt(h));if(!s){const x=n.height/o;t.height+=x,R.bumpVerticalPos(x)}let E,T=n.height-10;const l=n.width;if(a===r){E=R.getVerticalPos()+T,h.rightAngles||(T+=h.boxMargin,E=R.getVerticalPos()+T),T+=30;const x=P.getMax(l/2,h.width/2);R.insert(a-x,R.getVerticalPos()-10+T,r+x,R.getVerticalPos()+30+T)}else T+=h.boxMargin,E=R.getVerticalPos()+T,R.insert(a,E-10,r,E);return R.bumpVerticalPos(T),t.height+=T,t.stopy=t.starty+t.height,R.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}g(Fe,"boundMessage");var $r=g(async function(e,t,a,r,i,o){const{startx:s,stopx:n,starty:E,message:T,type:l,sequenceIndex:x,sequenceVisible:u}=t,O=Z.calculateTextDimensions(T,Rt(h)),p=ee();p.x=Math.min(s,n),p.y=E+10,p.width=Math.abs(n-s),p.class="messageText",p.dy="1em",p.text=T,p.fontFamily=h.messageFontFamily,p.fontSize=h.messageFontSize,p.fontWeight=h.messageFontWeight,p.anchor=h.messageAlign,p.valign="center",p.textMargin=h.wrapPadding,p.tspan=!1,Q(p.text)?await Wt(e,p,{startx:s,stopx:n,starty:a}):bt(e,p);const f=O.width;let _;if(s===n){const L=u||h.showSequenceNumbers,b=Xe(i,r),S=ia(i,r),A=s+(L&&(b||S)?10:0);h.rightAngles?_=e.append("path").attr("d",`M ${A},${a} H ${s+P.getMax(h.width/2,f/2)} V ${a+25} H ${s}`):_=e.append("path").attr("d","M "+A+","+a+" C "+(A+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),Qt(i,r)&&De(e,i,t,r,s,n,a)}else _=e.append("line"),_.attr("x1",s),_.attr("y1",a),_.attr("x2",n),_.attr("y2",a),Qt(i,r)&&De(e,i,t,r,s,n,a);l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||l===r.db.LINETYPE.SOLID_TOP_DOTTED||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||l===r.db.LINETYPE.STICK_TOP_DOTTED||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style("stroke-dasharray","3, 3"),_.attr("class","messageLine1")):_.attr("class","messageLine0"),_.attr("data-et","message"),_.attr("data-id","i"+t.id),_.attr("data-from",t.from),_.attr("data-to",t.to);let I="";if(h.arrowMarkerAbsolute&&(I=Tr(!0)),_.attr("stroke-width",2),_.attr("stroke","none"),_.style("fill","none"),(l===r.db.LINETYPE.SOLID_TOP||l===r.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-solidTopArrowHead)"),(l===r.db.LINETYPE.SOLID_BOTTOM||l===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.STICK_TOP||l===r.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-stickTopArrowHead)"),(l===r.db.LINETYPE.STICK_BOTTOM||l===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-solidBottomArrowHead)"),(l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-solidTopArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-stickBottomArrowHead)"),(l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+I+"#"+o+"-stickTopArrowHead)"),(l===r.db.LINETYPE.SOLID||l===r.db.LINETYPE.DOTTED)&&_.attr("marker-end","url("+I+"#"+o+"-arrowhead)"),(l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr("marker-start","url("+I+"#"+o+"-arrowhead)"),_.attr("marker-end","url("+I+"#"+o+"-arrowhead)")),(l===r.db.LINETYPE.SOLID_POINT||l===r.db.LINETYPE.DOTTED_POINT)&&_.attr("marker-end","url("+I+"#"+o+"-filled-head)"),(l===r.db.LINETYPE.SOLID_CROSS||l===r.db.LINETYPE.DOTTED_CROSS)&&_.attr("marker-end","url("+I+"#"+o+"-crosshead)"),u||h.showSequenceNumbers){const L=l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||l===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||l===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,S=6,A=Qt(i,r);let N=s,B=n;L?(ss?B=n-2*S:(B=n-S,N+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),B+=A?15:0,_.attr("x2",B),_.attr("x1",N)):_.attr("x1",s+S);let V=0;const q=s===n,U=s<=n;q?V=t.fromBounds+1:b?V=U?t.toBounds-1:t.fromBounds+1:V=U?t.fromBounds+1:t.toBounds-1;let G="12px";const X=x.toString().length;X>5?G="7px":X>3&&(G="9px"),e.append("line").attr("x1",V).attr("y1",a).attr("x2",V).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+o+"-sequencenumber)"),e.append("text").attr("x",V).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(x)}},"drawMessage"),jr=g(function(e,t,a,r,i,o,s){let n=0,E=0,T,l=0;for(const x of r){const u=t.get(x),O=u.box;T&&T!=O&&(s||R.models.addBox(T),E+=h.boxMargin+T.margin),O&&O!=T&&(s||(O.x=n+E,O.y=i),E+=O.margin),u.width=P.getMax(u.width||h.width,h.width),u.height=P.getMax(u.height||h.height,h.height),u.margin=u.margin||h.actorMargin,l=P.getMax(l,u.height),a.get(u.name)&&(E+=u.width/2),u.x=n+E,u.starty=R.getVerticalPos(),R.insert(u.x,i,u.x+u.width,u.height),n+=u.width+E,u.box&&(u.box.width=n+O.margin-u.box.x),E=u.margin,T=u.box,R.models.addActor(u)}T&&!s&&R.models.addBox(T),R.bumpVerticalPos(l)},"addActorRenderingData"),te=g(async function(e,t,a,r,i,o,s){if(r){let n=0;R.bumpVerticalPos(h.boxMargin*2);for(const E of a){const T=t.get(E);T.stopy||(T.stopy=R.getVerticalPos());const l=await F.drawActor(e,T,h,!0,i,o,s);n=P.getMax(n,l)}R.bumpVerticalPos(n+h.boxMargin)}else for(const n of a){const E=t.get(n);await F.drawActor(e,E,h,!1,i,o,s)}},"drawActors"),qe=g(function(e,t,a,r){let i=0,o=0;for(const s of a){const n=t.get(s),E=ea(n),T=F.drawPopup(e,n,E,h,h.forceMenus,r);T.height>i&&(i=T.height),T.width+n.x>o&&(o=T.width+n.x)}return{maxHeight:i,maxWidth:o}},"drawActorsPopup"),He=g(function(e){rr(h,e),e.fontFamily&&(h.actorFontFamily=h.noteFontFamily=h.messageFontFamily=e.fontFamily),e.fontSize&&(h.actorFontSize=h.noteFontSize=h.messageFontSize=e.fontSize),e.fontWeight&&(h.actorFontWeight=h.noteFontWeight=h.messageFontWeight=e.fontWeight)},"setConf"),qt=g(function(e){return R.activations.filter(function(t){return t.actor===e})},"actorActivations"),ve=g(function(e,t){const a=t.get(e),r=qt(e),i=r.reduce(function(s,n){return P.getMin(s,n.startx)},a.x+a.width/2-1),o=r.reduce(function(s,n){return P.getMax(s,n.stopx)},a.x+a.width/2+1);return[i,o]},"activationBounds");function ht(e,t,a,r,i){R.bumpVerticalPos(a);let o=r;if(t.id&&t.message&&e[t.id]){const s=e[t.id].width,n=Rt(h);t.message=Z.wrapLabel(`[${t.message}]`,s-2*h.wrapPadding,n),t.width=s,t.wrap=!0;const E=Z.calculateTextDimensions(t.message,n),T=P.getMax(E.height,h.labelBoxHeight);o=r+T,at.debug(`${T} - ${t.message}`)}i(t),R.bumpVerticalPos(o)}g(ht,"adjustLoopHeightForWrap");function ze(e,t,a,r,i,o,s){function n(l,x){l.x{m.add(D.from),m.add(D.to)}),f=f.filter(D=>m.has(D))}const A=new Map(f.map((m,D)=>[x.get(m)?.name??m,D]));jr(l,x,u,f,0,_,!1);const N=await oa(_,x,S,r);F.insertArrowHead(l,t),F.insertArrowCrossHead(l,t),F.insertArrowFilledHead(l,t),F.insertSequenceNumber(l,t),F.insertSolidTopArrowHead(l,t),F.insertSolidBottomArrowHead(l,t),F.insertStickTopArrowHead(l,t),F.insertStickBottomArrowHead(l,t),s==="neo"&&F.insertDropShadow(l,h);function B(m,D){const lt=R.endActivation(m);lt.starty+18>D&&(lt.starty=D-6,D+=12),F.drawActivation(l,lt,D,h,qt(m.from).length,r,A),R.insert(lt.startx,D-10,lt.stopx,D)}g(B,"activeEnd");let V=1,q=1;const U=[],G=[];let X=0;for(const m of _){let D,lt,et;switch(m.type){case r.db.LINETYPE.NOTE:R.resetVerticalPos(),lt=m.noteModel,await Qr(l,lt,m.id);break;case r.db.LINETYPE.ACTIVE_START:R.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION:R.newActivation(m,l,x);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:R.newActivation(m,l,x);break;case r.db.LINETYPE.ACTIVE_END:B(m,R.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.LOOP_END:D=R.endLoop(),await F.drawLoop(l,D,"loop",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.RECT_START:ht(N,m,h.boxMargin,h.boxMargin,W=>R.newLoop(void 0,W.message));break;case r.db.LINETYPE.RECT_END:D=R.endLoop(),G.push(D),R.models.addLoop(D),R.bumpVerticalPos(D.stopy-R.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.OPT_END:D=R.endLoop(),await F.drawLoop(l,D,"opt",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.ALT_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.ALT_ELSE:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.ALT_END:D=R.endLoop(),await F.drawLoop(l,D,"alt",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W)),R.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.PAR_END:D=R.endLoop(),await F.drawLoop(l,D,"par",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.AUTONUMBER:V=m.message.start||V,q=m.message.step||q,m.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(N,m,h.boxMargin+h.boxTextMargin,h.boxMargin,W=>R.addSectionToLoop(W));break;case r.db.LINETYPE.CRITICAL_END:D=R.endLoop(),await F.drawLoop(l,D,"critical",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;case r.db.LINETYPE.BREAK_START:ht(N,m,h.boxMargin,h.boxMargin+h.boxTextMargin,W=>R.newLoop(W));break;case r.db.LINETYPE.BREAK_END:D=R.endLoop(),await F.drawLoop(l,D,"break",h,m),R.bumpVerticalPos(D.stopy-R.getVerticalPos()),R.models.addLoop(D);break;default:try{et=m.msgModel,et.starty=R.getVerticalPos(),et.sequenceIndex=V,et.sequenceVisible=r.db.showSequenceNumbers(),et.id=m.id,et.from=m.from,et.to=m.to;const W=await Fe(l,et);ze(m,et,W,X,x,u,O),U.push({messageModel:et,lineStartY:W,msg:m}),R.models.addMessage(et)}catch(W){at.error("error while drawing message",W)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&(V=Math.round((V+q)*100)/100),X++}at.debug("createdActors",u),at.debug("destroyedActors",O),await te(l,x,f,!1,t,r,A);for(const m of U)await $r(l,m.messageModel,m.lineStartY,r,m.msg,t);h.mirrorActors&&await te(l,x,f,!0,t,r,A),G.forEach(m=>F.drawBackgroundRect(l,m)),Ye(l,x,f,h);for(const m of R.models.boxes){m.height=R.getVerticalPos()-m.y,R.insert(m.x,m.y,m.x+m.width,m.height);const D=h.boxMargin*2;m.startx=m.x-D,m.starty=m.y-D*.25,m.stopx=m.startx+m.width+2*D,m.stopy=m.starty+m.height+D*.75,m.stroke="rgb(0,0,0, 0.5)",F.drawBox(l,m,h)}L&&R.bumpVerticalPos(h.boxMargin);const j=qe(l,x,f,T),{bounds:H}=R.getBounds();H.startx===void 0&&(H.startx=0),H.starty===void 0&&(H.starty=0),H.stopx===void 0&&(H.stopx=0),H.stopy===void 0&&(H.stopy=0);let st=H.stopy-H.starty;st{const s=Rt(h);let n=o.actorKeys.reduce((x,u)=>x+=e.get(u).width+(e.get(u).margin||0),0);const E=h.boxMargin*8;n+=E,n-=2*h.boxTextMargin,o.wrap&&(o.name=Z.wrapLabel(o.name,n-2*h.wrapPadding,s));const T=Z.calculateTextDimensions(o.name,s);i=P.getMax(T.height,i);const l=P.getMax(n,T.width+2*h.wrapPadding);if(o.margin=h.boxTextMargin,no.textMaxHeight=i),P.getMax(r,h.height)}g(Ge,"calculateActorMargins");var ra=g(async function(e,t,a){const r=t.get(e.from),i=t.get(e.to),o=r.x,s=i.x,n=e.wrap&&e.message;let E=Q(e.message)?await wt(e.message,$()):Z.calculateTextDimensions(n?Z.wrapLabel(e.message,h.width,Lt(h)):e.message,Lt(h));const T={width:n?h.width:P.getMax(h.width,E.width+2*h.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(T.width=n?P.getMax(h.width,E.width):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=o+(r.width+h.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(T.width=n?P.getMax(h.width,E.width+2*h.noteMargin):P.getMax(r.width/2+i.width/2,E.width+2*h.noteMargin),T.startx=o-T.width+(r.width-h.actorMargin)/2):e.to===e.from?(E=Z.calculateTextDimensions(n?Z.wrapLabel(e.message,P.getMax(h.width,r.width),Lt(h)):e.message,Lt(h)),T.width=n?P.getMax(h.width,r.width):P.getMax(r.width,h.width,E.width+2*h.noteMargin),T.startx=o+(r.width-T.width)/2):(T.width=Math.abs(o+r.width/2-(s+i.width/2))+h.actorMargin,T.startx=o2,u=g(_=>E?-_:_,"adjustValue");e.from===e.to?l=T:(e.activate&&!x&&(l+=u(h.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(l+=u(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(T-=u(3)));const O=[i,o,s,n],p=Math.abs(T-l);e.wrap&&e.message&&(e.message=Z.wrapLabel(e.message,P.getMax(p+2*h.wrapPadding,h.width),Rt(h)));const f=Z.calculateTextDimensions(e.message,Rt(h));return{width:P.getMax(e.wrap?0:f.width+2*h.wrapPadding,p+2*h.wrapPadding,h.width),height:0,startx:T,stopx:l,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),oa=g(async function(e,t,a,r){const i={},o=[];let s,n,E;for(const T of e){switch(T.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:o.push({id:T.id,msg:T.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:T.message&&(s=o.pop(),i[s.id]=s,i[T.id]=s,o.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=o.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const x=t.get(T.from?T.from:T.to.actor),u=qt(T.from?T.from:T.to.actor).length,O=x.x+x.width/2+(u-1)*h.activationWidth/2,p={startx:O,stopx:O+h.activationWidth,actor:T.from,enabled:!0};R.activations.push(p)}break;case r.db.LINETYPE.ACTIVE_END:{const x=R.activations.map(u=>u.actor).lastIndexOf(T.from);R.activations.splice(x,1).splice(0,1)}break}T.placement!==void 0?(n=await ra(T,t,r),T.noteModel=n,o.forEach(x=>{s=x,s.from=P.getMin(s.from,n.startx),s.to=P.getMax(s.to,n.startx+n.width),s.width=P.getMax(s.width,Math.abs(s.from-s.to))-h.labelBoxWidth})):(E=na(T,t,r),T.msgModel=E,E.startx&&E.stopx&&o.length>0&&o.forEach(x=>{if(s=x,E.startx===E.stopx){const u=t.get(T.from),O=t.get(T.to);s.from=P.getMin(u.x-E.width/2,u.x-u.width/2,s.from),s.to=P.getMax(O.x+E.width/2,O.x+u.width/2,s.to),s.width=P.getMax(s.width,Math.abs(s.to-s.from))-h.labelBoxWidth}else s.from=P.getMin(E.startx,s.from),s.to=P.getMax(E.stopx,s.to),s.width=P.getMax(s.width,E.width)-h.labelBoxWidth}))}return R.activations=[],at.debug("Loop type widths:",i),i},"calculateLoopBounds"),ca={bounds:R,drawActors:te,drawActorsPopup:qe,setConf:He,draw:ta},Ta={parser:fr,get db(){return new Ir},renderer:ca,styles:Rr,init:g(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,tr({sequence:{wrap:e.wrap}}))},"init")};export{Ta as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-BJcdTFrX.js b/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-BJcdTFrX.js new file mode 100644 index 0000000000..89686e891d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-BJcdTFrX.js @@ -0,0 +1 @@ +import{s as R,a as W,S as N}from"./chunk-AQP2D5EJ-DbRpkGly.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a9 as _,aa as U,O as C,u as F}from"./mermaid.core-zKrc8Ye9.js";import{G as O}from"./graph--OzhPTMs.js";import{l as J}from"./layout-SsrduOYp.js";import"./chunk-55IACEB6-mUr9lxTD.js";import"./chunk-2J33WTMH-BlbqWzB_.js";import"./index-DtRfJ0vw.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"),q=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"),Z=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"),j=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}=j(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"&&q(n),(i.type==="fork"||i.type==="join")&&Z(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"),G=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=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!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}=F.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)}G++},"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");A(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"),A=f((e,i,d,c,n,l,p)=>{const a=new O({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},lt={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{lt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js b/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js new file mode 100644 index 0000000000..498e60f838 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js @@ -0,0 +1 @@ +import{s as A,a as W,S as N}from"./chunk-AQP2D5EJ-FS8-f8lF.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,R as _,S as U,O as C,u as F}from"./mermaidParser.worker-Dx4jPi9z.js";import{G as O}from"./graph-BwjfAU3j.js";import{l as J}from"./layout-C1ojF0zw.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.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"),q=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"),Z=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"),j=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}=j(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"&&q(n),(i.type==="fork"||i.type==="join")&&Z(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"),G=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=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!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}=F.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)}G++},"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");R(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"),R=f((e,i,d,c,n,l,p)=>{const a=new O({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},gt={parser:W,get db(){return new N(1)},renderer:it,styles:A,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{gt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js b/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js new file mode 100644 index 0000000000..03e0fb98dc --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js @@ -0,0 +1 @@ +import{s as t,b as r,a,S as s}from"./chunk-AQP2D5EJ-FS8-f8lF.js";import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.js";var l={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{l as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-DpW8Zeth.js b/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-DpW8Zeth.js new file mode 100644 index 0000000000..a2e34e3394 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-DpW8Zeth.js @@ -0,0 +1 @@ +import{s as e,b as r,a,S as s}from"./chunk-AQP2D5EJ-DbRpkGly.js";import{_ as i}from"./mermaid.core-zKrc8Ye9.js";import"./chunk-55IACEB6-mUr9lxTD.js";import"./chunk-2J33WTMH-BlbqWzB_.js";import"./index-DtRfJ0vw.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram}; diff --git a/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DRsCTcc3.js b/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DRsCTcc3.js new file mode 100644 index 0000000000..94b0189762 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DRsCTcc3.js @@ -0,0 +1,120 @@ +import{_ as o,D as pt,ac as Ct,ad as Rt,ae as Wt,c as gt,l as E,I as Pt,N as Bt,af as ft,d as X,C as Vt,ag as Ft,z as zt}from"./mermaid.core-zKrc8Ye9.js";import{d as ot}from"./arc-DtCnpCZe.js";import"./index-DtRfJ0vw.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,C=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 U=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,R={},G,B,Z,j;;){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="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +`+w.showPosition()+` +Expecting `+j.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:j})}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,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],R.$=x[x.length-B],R._$={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},U&&(R._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(R,[v,C,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(R.$),u.push(R._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);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()+` +`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;ud[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],K=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",K.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&nn.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return K[n].processed},"compileTask");let t=!0;for(const[n,i]of K.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Kt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=o(function(e,t){const n=t.text.replace(//gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Ut=o(function(e,t){function n(r,h,c,a,f){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+a-f)+" "+(r+c-f*1.2)+","+(h+a)+" "+r+","+(h+a)}o(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),Xt=o(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,J(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Zt=o(function(e,t,n,i){const r=t.x+n.width/2,h=e.append("g");et++,h.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(h,{cx:r,cy:300+(5-t.score)*30,score:t.score});const a=st();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,J(h,a),Ht(n)(t.task,h,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jt=o(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=(function(){function e(r,h,c,a,f,g,m,y){const k=h.append("text").attr("x",c+f/2).attr("y",a+g/2+5).style("font-color",y).style("text-anchor","middle").text(r);i(k,m)}o(e,"byText");function t(r,h,c,a,f,g,m,y,k){const{taskFontSize:s,taskFontFamily:d}=y,l=r.split(//gi);for(let p=0;p)/).reverse(),r,h=[],c=1.1,a=n.attr("y"),f=parseFloat(n.attr("dy")),g=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",f+"em");for(let m=0;mt||r==="
      ")&&(h.pop(),g.text(h.join(" ").trim()),r==="
      "?h=[""]:h=[r],g=n.append("tspan").attr("x",0).attr("y",a).attr("dy",c+"em").text(r))})}o(it,"wrap");var Qt=o(function(e,t,n,i,r,h=!1){const{theme:c,look:a}=i,f=c?.includes("redux"),g=i?.themeVariables?.THEME_COLOR_LIMIT??12,m=n%g-1,y=e.append("g");t.section=m,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=y.append("g"),s=y.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),p=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=l.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),te(k,t,m,r,i),a==="neo"&&(y.attr("data-look","neo"),f)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=X(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const C=S.select("defs");(C.empty()?S.append("defs"):C).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),Yt=o(function(e,t,n){const i=e.append("g"),h=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),te=o(function(e,t,n,i,r){const{theme:h}=r,c=h?.includes("redux")?0:5,a=5,f=c>0?`M0 ${t.height-a} v${-t.height+2*a} q0,-${c},${c},-${c} h${t.width-2*a} q${c},0,${c},${c} v${t.height-a} H0 Z`:`M0 ${t.height-a} v${-(t.height-a)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",f),h?.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:J,drawCircle:Kt,drawSection:Xt,drawText:It,drawLabel:Ut,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:st,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=o(function(e,t,n,i){const r=gt(),{look:h,theme:c,themeVariables:a}=r,{useGradient:f,gradientStart:g,gradientStop:m}=a,y=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=X("#i"+t));const l=(k==="sandbox"?X(s.nodes()[0].contentDocument.body):X("body")).select("#"+t);l.append("g");const p=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();E.debug("task",p),M.initGraphics(l,t);const u=i.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,C=0,W=50+y,O=50;C=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,r);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",p.length);for(const[N,b]of p.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,r);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,R,r)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=p.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,r,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${C})`),O+=S+50,b.length>0&<(l,b,L,W,O,v,r,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=C,L++}):(w=!1,lt(l,p,L,W,O,v,r,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+y:F.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",I).attr("x2",F.width+3*y).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&f&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",g).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}ft(void 0,l,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),lt=o(function(e,t,n,i,r,h,c,a,f,g,m,y){for(const k of t){const s={descr:k.task,section:n,number:n,width:150,padding:20,maxHeight:h};E.debug("taskNode",s);const d=e.append("g").attr("class","taskWrapper"),p=M.drawNode(d,s,n,c,y).height;if(E.debug("taskHeight after draw",p),d.attr("transform",`translate(${i}, ${r})`),h=Math.max(h,p),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;r+=100,u=u+ne(e,k.events,n,i,r,c,y),r-=100,x.append("line").attr("x1",i+190/2).attr("y1",r+h).attr("x2",i+190/2).attr("y2",r+h+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,m&&!c.timeline?.disableMulticolor&&n++}r=r-10},"drawTasks"),ne=o(function(e,t,n,i,r,h,c){let a=0;const f=r;r=r+100;for(const g of t){const m={descr:g,section:n,number:n,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const y=e.append("g").attr("class","eventWrapper"),s=M.drawNode(y,m,n,h,c,!0).height;a=a+s,y.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=f,a},"drawEvents"),re={setConf:o(()=>{},"setConf"),draw:ee},Q=200,z=5,se=Q+z*2,at=Q+100,ie=at+z*2,Lt=10,ae=0,ht=20,Mt=20,dt=30,At=50,oe=o(function(e,t,n,i){const r=gt(),h=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const c=Pt(t);c.append("g");const a=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();E.debug("task",a),M.initGraphics(c);const g=i.db.getSections();E.debug("sections",g);let m=0,y=0;const k=50+h;let s=50;const d=s,l=k,p=se+Mt,x=ie+At,u=l+p;let S=0;const v=g&&g.length>0,I=v?u:k+p,C=Math.max(50,p+x-z*2);g.forEach(function(N){const b={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,r);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",a.length);for(const[N,b]of a.entries()){const _={number:N,descr:b,section:b.section,width:Q,padding:z,maxHeight:y},$=M.getVirtualNodeHeight(c,_,r);E.debug("taskHeight before draw",$),y=Math.max(y,$);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:at,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,R,r)}b.events.length>0&&(T+=(b.events.length-1)*Lt),W=Math.max(W,T)+ae}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",y);const L=Math.max(y,W)+dt;v?g.forEach(N=>{const b=a.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,r);E.debug("sectionNode output",T);const P=I-p;$.attr("transform",`translate(${P}, ${s})`);const R=s+T.height+ht;b.length>0&&ut(c,b,S,I,R,y,r,L,!1);const G=b.length,B=T.height+ht+L*Math.max(G,1)-(G>0?dt*2:0);s+=B,S++}):ut(c,a,S,I,s,y,r,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),f){if(c.append("text").text(f).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Bt(r.fontSize),V=(H??16)*2,F=(H??16)*.5+20,U=c.append("g").attr("class","lineWrapper");U.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),U.lower(),ft(void 0,c,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),ut=o(function(e,t,n,i,r,h,c,a,f){for(const g of t){const m={descr:g.task,section:n,number:n,width:Q,padding:z,maxHeight:h};E.debug("taskNode",m);const y=e.append("g").attr("class","taskWrapper"),k=M.drawNode(y,m,n,c),s=k.height;E.debug("taskHeight after draw",s);const d=i-Mt-k.width;if(y.attr("transform",`translate(${d}, ${r})`),h=Math.max(h,s),g.events&&g.events.length>0){const l=r,p=i+At;ce(e,g.events,n,i,p,l,c)}r=r+a,f&&!c.timeline?.disableMulticolor&&n++}},"drawTasks"),ce=o(function(e,t,n,i,r,h,c){let a=h;for(const f of t){const g={descr:f,section:n,number:n,width:at,padding:z,maxHeight:0};E.debug("eventNode",g);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,g,n,c).height;m.attr("transform",`translate(${r}, ${a})`);const s=e.append("g").attr("class","lineWrapper"),d=a+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),a=a+k+Lt}return a-h},"drawEvents"),le={setConf:o(()=>{},"setConf"),draw:oe},he=o(e=>{const{theme:t}=pt(),n=t?.includes("dark"),i=t?.includes("color"),r=e.svgId?.replace(/^#/,"")??"",h=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let c="";for(let a=0;a{let t="";for(let n=0;n{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},xe={db:yt,renderer:ge,parser:Ot,styles:pe};export{xe as diagram}; diff --git a/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js b/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js new file mode 100644 index 0000000000..8f5e0b8ae8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js @@ -0,0 +1,120 @@ +import{_ as o,D as pt,V as Ct,W as Rt,X as Wt,c as gt,l as E,I as Pt,N as Bt,Y as ft,d as U,C as Vt,$ as Ft,z as zt}from"./mermaidParser.worker-Dx4jPi9z.js";import{d as ot}from"./arc-Doj0wRZ0.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,C=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,R={},G,B,Z,j;;){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="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +`+w.showPosition()+` +Expecting `+j.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:j})}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,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],R.$=x[x.length-B],R._$={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&&(R._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(R,[v,C,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(R.$),u.push(R._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);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()+` +`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;ud[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],X=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",X.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&nn.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return X[n].processed},"compileTask");let t=!0;for(const[n,i]of X.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Xt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=o(function(e,t){const n=t.text.replace(//gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Kt=o(function(e,t){function n(r,h,c,a,f){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+a-f)+" "+(r+c-f*1.2)+","+(h+a)+" "+r+","+(h+a)}o(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),Ut=o(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,J(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Zt=o(function(e,t,n,i){const r=t.x+n.width/2,h=e.append("g");et++,h.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(h,{cx:r,cy:300+(5-t.score)*30,score:t.score});const a=st();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,J(h,a),Ht(n)(t.task,h,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jt=o(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=(function(){function e(r,h,c,a,f,g,m,y){const k=h.append("text").attr("x",c+f/2).attr("y",a+g/2+5).style("font-color",y).style("text-anchor","middle").text(r);i(k,m)}o(e,"byText");function t(r,h,c,a,f,g,m,y,k){const{taskFontSize:s,taskFontFamily:d}=y,l=r.split(//gi);for(let p=0;p)/).reverse(),r,h=[],c=1.1,a=n.attr("y"),f=parseFloat(n.attr("dy")),g=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",f+"em");for(let m=0;mt||r==="
      ")&&(h.pop(),g.text(h.join(" ").trim()),r==="
      "?h=[""]:h=[r],g=n.append("tspan").attr("x",0).attr("y",a).attr("dy",c+"em").text(r))})}o(it,"wrap");var Qt=o(function(e,t,n,i,r,h=!1){const{theme:c,look:a}=i,f=c?.includes("redux"),g=i?.themeVariables?.THEME_COLOR_LIMIT??12,m=n%g-1,y=e.append("g");t.section=m,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=y.append("g"),s=y.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),p=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=l.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),te(k,t,m,r,i),a==="neo"&&(y.attr("data-look","neo"),f)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=U(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const C=S.select("defs");(C.empty()?S.append("defs"):C).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),Yt=o(function(e,t,n){const i=e.append("g"),h=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),te=o(function(e,t,n,i,r){const{theme:h}=r,c=h?.includes("redux")?0:5,a=5,f=c>0?`M0 ${t.height-a} v${-t.height+2*a} q0,-${c},${c},-${c} h${t.width-2*a} q${c},0,${c},${c} v${t.height-a} H0 Z`:`M0 ${t.height-a} v${-(t.height-a)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",f),h?.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:J,drawCircle:Xt,drawSection:Ut,drawText:It,drawLabel:Kt,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:st,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=o(function(e,t,n,i){const r=gt(),{look:h,theme:c,themeVariables:a}=r,{useGradient:f,gradientStart:g,gradientStop:m}=a,y=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=U("#i"+t));const l=(k==="sandbox"?U(s.nodes()[0].contentDocument.body):U("body")).select("#"+t);l.append("g");const p=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();E.debug("task",p),M.initGraphics(l,t);const u=i.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,C=0,W=50+y,O=50;C=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,r);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",p.length);for(const[N,b]of p.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,r);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,R,r)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=p.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,r,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${C})`),O+=S+50,b.length>0&<(l,b,L,W,O,v,r,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=C,L++}):(w=!1,lt(l,p,L,W,O,v,r,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+y:F.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",I).attr("x2",F.width+3*y).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&f&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",g).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}ft(void 0,l,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),lt=o(function(e,t,n,i,r,h,c,a,f,g,m,y){for(const k of t){const s={descr:k.task,section:n,number:n,width:150,padding:20,maxHeight:h};E.debug("taskNode",s);const d=e.append("g").attr("class","taskWrapper"),p=M.drawNode(d,s,n,c,y).height;if(E.debug("taskHeight after draw",p),d.attr("transform",`translate(${i}, ${r})`),h=Math.max(h,p),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;r+=100,u=u+ne(e,k.events,n,i,r,c,y),r-=100,x.append("line").attr("x1",i+190/2).attr("y1",r+h).attr("x2",i+190/2).attr("y2",r+h+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,m&&!c.timeline?.disableMulticolor&&n++}r=r-10},"drawTasks"),ne=o(function(e,t,n,i,r,h,c){let a=0;const f=r;r=r+100;for(const g of t){const m={descr:g,section:n,number:n,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const y=e.append("g").attr("class","eventWrapper"),s=M.drawNode(y,m,n,h,c,!0).height;a=a+s,y.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=f,a},"drawEvents"),re={setConf:o(()=>{},"setConf"),draw:ee},Q=200,z=5,se=Q+z*2,at=Q+100,ie=at+z*2,Lt=10,ae=0,ht=20,Mt=20,dt=30,At=50,oe=o(function(e,t,n,i){const r=gt(),h=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const c=Pt(t);c.append("g");const a=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();E.debug("task",a),M.initGraphics(c);const g=i.db.getSections();E.debug("sections",g);let m=0,y=0;const k=50+h;let s=50;const d=s,l=k,p=se+Mt,x=ie+At,u=l+p;let S=0;const v=g&&g.length>0,I=v?u:k+p,C=Math.max(50,p+x-z*2);g.forEach(function(N){const b={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,r);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",a.length);for(const[N,b]of a.entries()){const _={number:N,descr:b,section:b.section,width:Q,padding:z,maxHeight:y},$=M.getVirtualNodeHeight(c,_,r);E.debug("taskHeight before draw",$),y=Math.max(y,$);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:at,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,R,r)}b.events.length>0&&(T+=(b.events.length-1)*Lt),W=Math.max(W,T)+ae}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",y);const L=Math.max(y,W)+dt;v?g.forEach(N=>{const b=a.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,r);E.debug("sectionNode output",T);const P=I-p;$.attr("transform",`translate(${P}, ${s})`);const R=s+T.height+ht;b.length>0&&ut(c,b,S,I,R,y,r,L,!1);const G=b.length,B=T.height+ht+L*Math.max(G,1)-(G>0?dt*2:0);s+=B,S++}):ut(c,a,S,I,s,y,r,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),f){if(c.append("text").text(f).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Bt(r.fontSize),V=(H??16)*2,F=(H??16)*.5+20,K=c.append("g").attr("class","lineWrapper");K.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),K.lower(),ft(void 0,c,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),ut=o(function(e,t,n,i,r,h,c,a,f){for(const g of t){const m={descr:g.task,section:n,number:n,width:Q,padding:z,maxHeight:h};E.debug("taskNode",m);const y=e.append("g").attr("class","taskWrapper"),k=M.drawNode(y,m,n,c),s=k.height;E.debug("taskHeight after draw",s);const d=i-Mt-k.width;if(y.attr("transform",`translate(${d}, ${r})`),h=Math.max(h,s),g.events&&g.events.length>0){const l=r,p=i+At;ce(e,g.events,n,i,p,l,c)}r=r+a,f&&!c.timeline?.disableMulticolor&&n++}},"drawTasks"),ce=o(function(e,t,n,i,r,h,c){let a=h;for(const f of t){const g={descr:f,section:n,number:n,width:at,padding:z,maxHeight:0};E.debug("eventNode",g);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,g,n,c).height;m.attr("transform",`translate(${r}, ${a})`);const s=e.append("g").attr("class","lineWrapper"),d=a+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),a=a+k+Lt}return a-h},"drawEvents"),le={setConf:o(()=>{},"setConf"),draw:oe},he=o(e=>{const{theme:t}=pt(),n=t?.includes("dark"),i=t?.includes("color"),r=e.svgId?.replace(/^#/,"")??"",h=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let c="";for(let a=0;a{let t="";for(let n=0;n{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},me={db:yt,renderer:ge,parser:Ot,styles:pe};export{me as diagram}; diff --git a/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-B95s0NJK.js b/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-B95s0NJK.js new file mode 100644 index 0000000000..99a90cd0b6 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-B95s0NJK.js @@ -0,0 +1,34 @@ +import{aU as Gt,s as Wt,g as Kt,q as Ht,p as Yt,a as Xt,b as Zt,_ as w,D as wt,I as Jt,d as ot,al as Qt,ac as $t,ad as te,ae as ee,e as ne,z as se,F as ie,G as oe}from"./mermaid.core-zKrc8Ye9.js";import"./index-DtRfJ0vw.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Et(e);for(let u=0;ur.angle-u.angle);let h=e[e.length-1];for(let u=0;ux.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;uMath.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(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 Tt(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),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Et(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 le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u=0&&(n=r),Math.abs(h)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx=1)break;for(let f=1;fc+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(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 a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r{const y={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;uc===h?0:co.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;dy.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;bt[a]));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 c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(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 a of t)a.x-=i,a.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),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+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 a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(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 a=n(i),c=n(o);a.parent=c}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.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=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},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(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},D={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Ct(k,a,d)),I=Nt(k,s,e,i,h),D=jt(I,f,M)}const U={};f.forEach(k=>{k.label&&(U[k.sets]=k.label)});function j(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const R={};let _=!1;E.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{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-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=E.selectAll(".venn-area").data(f,k=>k.sets),O=V.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=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(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"),W.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=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in D).text(k=>j(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const C=K(V.exit()).remove();typeof V.transition=="function"&&C.selectAll("path").attrTween("d",P);const X=C.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:D,nodes:V,enter:O,update:z,exit:C}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Dt:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)r.p1))}function ve(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(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(` +a`,s,s,0,1,0,-s*2,0),e.join(" ")}function ke(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Vt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?o=>Math.round(o*s)/s:o=>o;if(t.length==1){const o=t[0].circle;return Ie(e(o.x),e(o.y),e(o.radius))}const i=[` +M`,e(t[0].p2.x),e(t[0].p2.y)];for(const o of t){const a=e(o.circle.radius);i.push(` +A`,a,a,0,o.large?1:0,o.sweep?1:0,e(o.p1.x),e(o.p1.y))}return i.join(" ")}function St(t,n){return Vt(Pt(t),n)}function Me(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:h=350,padding:u=15,scaleToFit:r=!1,symmetricalTextCentre:y=!1,distinct:d,round:b=2}=n;let x=e(t,{lossFunction:s==="default"||!s?tt:s==="logRatio"?Dt:s,distinct:d});i&&(x=Ct(x,o,a));const M=Nt(x,c,h,u,r),A=jt(M,t,y),T=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{const v=m.sets.map(f=>T.get(f)),l=Pt(v),p=Vt(l,b);return{circles:v,arcs:l,path:p,area:m,has:new Set(m.sets)}});function g(m){let v="";for(const l of S)l.has.size>m.length&&m.every(p=>l.has.has(p))&&(v+=" "+l.path);return v}return S.map(({circles:m,arcs:v,path:l,area:p})=>({data:p,text:A[p.sets],circles:m,arcs:v,path:l,distinctPath:l+g(p.sets)}))}var gt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],h=[7,8,11,12,17,19,22,24,27],u=[1,57],r=[1,56],y=[1,58],d=[1,59],b=[1,60],x=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:w(function(g,m,v,l,p,f,N){var I=f.length-1;switch(p){case 1:return f[I-1];case 2:case 3:case 4:this.$=[];break;case 5:f[I-1].push(f[I]),this.$=f[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=f[I];break;case 8:l.setDiagramTitle(f[I].substr(6)),this.$=f[I].substr(6);break;case 9:l.addSubsetData([f[I]],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 10:l.addSubsetData([f[I-1]],f[I],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 11:l.addSubsetData([f[I-2]],void 0,parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 12:l.addSubsetData([f[I-3]],f[I-2],parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 13:if(f[I].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I]),l.addSubsetData(f[I],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 14:if(f[I-1].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-1]),l.addSubsetData(f[I-1],f[I],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 15:if(f[I-2].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-2]),l.addSubsetData(f[I-2],void 0,parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 16:if(f[I-3].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-3]),l.addSubsetData(f[I-3],f[I-2],parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 17:case 18:case 19:l.addTextData(f[I-1],f[I],void 0);break;case 20:case 21:l.addTextData(f[I-2],f[I-1],f[I]);break;case 23:l.addStyleData(f[I-1],f[I]);break;case 24:case 25:case 26:var D=l.getCurrentSets();if(!D)throw new Error("text requires set");l.addTextData(D,f[I],void 0);break;case 27:case 28:var D=l.getCurrentSets();if(!D)throw new Error("text requires set");l.addTextData(D,f[I-1],f[I]);break;case 29:case 41:this.$=[f[I]];break;case 30:case 42:this.$=[...f[I-2],f[I]];break;case 31:this.$=[f[I-2],f[I]];break;case 33:this.$=f[I].join(" ");break;case 34:this.$=[f[I]];break;case 35:f[I-1].push(f[I]),this.$=f[I-1];break;case 43:case 44:this.$=f[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:c,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(h,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:c,26:51},{16:u,20:r,21:[1,53],28:52,29:54,30:55,31:y,32:d,33:b},t(s,[2,12]),t(s,[2,16]),t(h,[2,30]),t(h,[2,31]),t(h,[2,32]),t(h,[2,33],{30:61,16:u,20:r,31:y,32:d,33:b}),t(x,[2,34]),t(x,[2,36]),t(x,[2,37]),t(x,[2,38]),t(x,[2,39]),t(x,[2,40]),t(x,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(g,m){if(m.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=m,v}},"parseError"),parse:w(function(g){var m=this,v=[0],l=[],p=[null],f=[],N=this.table,I="",D=0,U=0,j=2,E=1,R=f.slice.call(arguments,1),_=Object.create(this.lexer),P={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(P.yy[V]=this.yy[V]);_.setInput(g,P.yy),P.yy.lexer=_,P.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var O=_.yylloc;f.push(O);var B=_.options&&_.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(G){v.length=v.length-2*G,p.length=p.length-G,f.length=f.length-G}w(W,"popStack");function K(){var G;return G=l.pop()||_.lex()||E,typeof G!="number"&&(G instanceof Array&&(l=G,G=l.pop()),G=m.symbols_[G]||G),G}w(K,"lex");for(var z,L,C,X,k={},F,H,et,Y;;){if(L=v[v.length-1],this.defaultActions[L]?C=this.defaultActions[L]:((z===null||typeof z>"u")&&(z=K()),C=N[L]&&N[L][z]),typeof C>"u"||!C.length||!C[0]){var Z="";Y=[];for(F in N[L])this.terminals_[F]&&F>j&&Y.push("'"+this.terminals_[F]+"'");_.showPosition?Z="Parse error on line "+(D+1)+`: +`+_.showPosition()+` +Expecting `+Y.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on line "+(D+1)+": Unexpected "+(z==E?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Z,{text:_.match,token:this.terminals_[z]||z,line:_.yylineno,loc:O,expected:Y})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+z);switch(C[0]){case 1:v.push(z),p.push(_.yytext),f.push(_.yylloc),v.push(C[1]),z=null,U=_.yyleng,I=_.yytext,D=_.yylineno,O=_.yylloc;break;case 2:if(H=this.productions_[C[1]][1],k.$=p[p.length-H],k._$={first_line:f[f.length-(H||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(H||1)].first_column,last_column:f[f.length-1].last_column},B&&(k._$.range=[f[f.length-(H||1)].range[0],f[f.length-1].range[1]]),X=this.performAction.apply(k,[I,U,D,P.yy,C[1],p,f].concat(R)),typeof X<"u")return X;H&&(v=v.slice(0,-1*H*2),p=p.slice(0,-1*H),f=f.slice(0,-1*H)),v.push(this.productions_[C[1]][0]),p.push(k.$),f.push(k._$),et=N[v[v.length-2]][v[v.length-1]],v.push(et);break;case 3:return!0}}return!0},"parse")},A=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||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:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(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:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;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),v.length-1&&(this.yylineno-=v.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:v?(v.length===l.length?this.yylloc.first_column:0)+l[l.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(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:w(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:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,l,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),l=g[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var f in p)this[f]=p[f];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,l;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),f=0;fm[0].length)){if(m=v,l=f,this.options.backtrack_lexer){if(g=this.test_match(v,p[f]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,p[l]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,l,p){switch(l){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return S})();M.lexer=A;function T(){this.yy={}}return w(T,"Parser"),T.prototype=M,M.Parser=T,new T})();gt.parser=gt;var Se=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,we=w((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),_e=w(()=>yt,"getSubsetData"),nt=w(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Te=w(t=>t&&nt(t),"normalizeStyleValue"),Ee=w((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),ze=w((t,n)=>{const s=it(t).sort(),e={};for(const[i,o]of n)e[i]=Te(o)??o;mt.push({targets:s,styles:e})},"addStyleData"),Ae=w(()=>mt,"getStyleData"),it=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),Re=w(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),De=w(()=>pt,"getTextData"),Ce=w(()=>vt,"getCurrentSets"),Ne=w(()=>It,"getIndentMode"),Oe=w(t=>{It=t},"setIndentMode"),Fe=oe.venn;function Bt(){return ie(Fe,wt().venn)}w(Bt,"getConfig");var Le=w(()=>{se(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),je={getConfig:Bt,clear:Le,setAccTitle:Zt,getAccTitle:Xt,setDiagramTitle:Yt,getDiagramTitle:Ht,getAccDescription:Kt,setAccDescription:Wt,addSubsetData:we,getSubsetData:_e,addTextData:Ee,addStyleData:ze,validateUnionIdentifiers:Re,getTextData:De,getStyleData:Ae,getCurrentSets:Ce,getIndentMode:Ne,setIndentMode:Oe},Pe=w(t=>` + .venn-title { + font-size: 32px; + fill: ${t.vennTitleTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-circle text { + font-size: 48px; + font-family: ${t.fontFamily}; + } + + .venn-intersection text { + font-size: 48px; + fill: ${t.vennSetTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-text-node { + font-family: ${t.fontFamily}; + color: ${t.vennSetTextColor}; + } +`,"getStyles"),Ve=Pe;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var Be=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:h}=wt(),u=c==="handDrawn",r=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),y=i.getDiagramTitle?.(),d=i.getSubsetData(),b=i.getTextData(),x=qt(i.getStyleData()),M=o?.width??800,A=o?.height??450,S=M/1600,g=y?48*S:0,m=a.primaryTextColor??a.textColor,v=Jt(n);v.attr("viewBox",`0 0 ${M} ${A}`),y&&v.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*S}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*S).style("fill",a.vennTitleTextColor||a.titleColor);const l=ot(document.createElement("div")),p=be().width(M).height(A-g);l.datum(d).call(p);const f=u?Qt.svg(l.select("svg").node()):void 0,N=Me(d,{width:M,height:A-g,padding:o?.padding??15}),I=new Map;for(const E of N){const R=Q([...E.data.sets].sort());I.set(R,E)}b.length>0&&Ut(o,I,l,b,S,x);const D=$t(a.background||"#f4f4f4");l.selectAll(".venn-circle").each(function(E,R){const _=ot(this),V=Q([...E.sets].sort()),O=x.get(V),B=O?.fill||r[R%r.length]||a.primaryColor;_.classed(`venn-set-${R%8}`,!0);const W=O?.["fill-opacity"]??.1,K=O?.stroke||B,z=O?.["stroke-width"]||`${5*S}`;if(u&&f){const C=I.get(V);if(C&&C.circles.length>0){const X=C.circles[0],k=f.circle(X.x,X.y,X.radius*2,{roughness:.7,seed:h,fill:kt(B,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+R*60,stroke:K,strokeWidth:parseFloat(String(z))});_.select("path").remove(),_.node()?.insertBefore(k,_.select("text").node())}}else _.select("path").style("fill",B).style("fill-opacity",W).style("stroke",K).style("stroke-width",z).style("stroke-opacity",.95);const L=O?.color||(D?te(B,30):ee(B,30));_.select("text").style("font-size",`${48*S}px`).style("fill",L)}),u&&f?l.selectAll(".venn-intersection").each(function(E){const R=ot(this),P=Q([...E.sets].sort()),V=x.get(P),O=V?.fill;if(O){const B=R.select("path"),W=B.attr("d");if(W){const K=f.path(W,{roughness:.7,seed:h,fill:kt(O,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),z=B.node();z?.parentNode?.insertBefore(K,z),B.remove()}}else R.select("path").style("fill-opacity",0);R.select("text").style("font-size",`${48*S}px`).style("fill",V?.color??a.vennSetTextColor??m)}):(l.selectAll(".venn-intersection text").style("font-size",`${48*S}px`).style("fill",E=>{const _=Q([...E.sets].sort());return x.get(_)?.color??a.vennSetTextColor??m}),l.selectAll(".venn-intersection path").style("fill-opacity",E=>{const _=Q([...E.sets].sort());return x.get(_)?.fill?1:0}).style("fill",E=>{const _=Q([...E.sets].sort());return x.get(_)?.fill??"transparent"}));const U=v.append("g").attr("transform",`translate(0, ${g})`),j=l.select("svg").node();if(j&&"childNodes"in j)for(const E of[...j.childNodes])U.node()?.appendChild(E);ne(v,A,M,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const a=t?.useDebugLayout??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const r of e){const y=Q(r.sets),d=u.get(y);d?d.push(r):u.set(y,[r])}for(const[r,y]of u.entries()){const d=n.get(r);if(!d?.text)continue;const b=d.text.x,x=d.text.y,M=Math.min(...d.circles.map(E=>E.radius)),A=Math.min(...d.circles.map(E=>E.radius-Math.hypot(b-E.x,x-E.y)));let T=Number.isFinite(A)?Math.max(0,A):0;T===0&&Number.isFinite(M)&&(T=M*.6);const S=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);a&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",x).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,T*2*.95),m=Math.max(60*i,T*2*.95),p=(d.data.label&&d.data.label.length>0?Math.min(32*i,T*.25):0)+(y.length<=2?30*i:0),f=b-g/2,N=x-m/2+p,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),D=Math.max(1,Math.ceil(y.length/I)),U=g/I,j=m/D;for(const[E,R]of y.entries()){const _=E%I,P=Math.floor(E/I),V=f+U*(_+.5),O=N+j*(P+.5);a&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",f+U*_).attr("y",N+j*P).attr("width",U).attr("height",j).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,W=j*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",W).attr("x",V-B/2).attr("y",O-W/2).attr("overflow","visible"),z=o.get(R.id)?.color,L=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&L.style("color",z)}}}w(Ut,"renderTextNodes");var qe={draw:Be},We={parser:Se,db:je,renderer:qe,styles:Ve};export{We as diagram}; diff --git a/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js b/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js new file mode 100644 index 0000000000..2a67db59df --- /dev/null +++ b/apps/kimi-code/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js @@ -0,0 +1,34 @@ +import{aU as Gt,s as Wt,g as Kt,q as Ht,p as Xt,a as Yt,b as Zt,_ as w,D as wt,I as Jt,d as ot,al as Qt,V as $t,W as te,X as ee,e as ne,z as se,F as ie,G as oe}from"./mermaidParser.worker-Dx4jPi9z.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Et(e);for(let u=0;ur.angle-u.angle);let h=e[e.length-1];for(let u=0;ux.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;uMath.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(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 Tt(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),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Et(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 le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u=0&&(n=r),Math.abs(h)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx=1)break;for(let f=1;fc+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(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 a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r{const y={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;uc===h?0:co.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;dy.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;bt[a]));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 c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(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 a of t)a.x-=i,a.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),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+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 a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(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 a=n(i),c=n(o);a.parent=c}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.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=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},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(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},D={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Ct(k,a,d)),I=Nt(k,s,e,i,h),D=jt(I,f,M)}const U={};f.forEach(k=>{k.label&&(U[k.sets]=k.label)});function j(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const R={};let _=!1;E.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{const H=k.sets.map(et=>{let X=R[et],Z=I[et];return X||(X={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:X.x*(1-F)+Z.x*F,y:X.y*(1-F)+Z.y*F,radius:X.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=E.selectAll(".venn-area").data(f,k=>k.sets),O=V.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=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(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"),W.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=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in D).text(k=>j(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const C=K(V.exit()).remove();typeof V.transition=="function"&&C.selectAll("path").attrTween("d",P);const Y=C.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),Y.style("font-size","0px")),{circles:I,textCentres:D,nodes:V,enter:O,update:z,exit:C}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Dt:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)r.p1))}function ve(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(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(` +a`,s,s,0,1,0,-s*2,0),e.join(" ")}function ke(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Vt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?o=>Math.round(o*s)/s:o=>o;if(t.length==1){const o=t[0].circle;return Ie(e(o.x),e(o.y),e(o.radius))}const i=[` +M`,e(t[0].p2.x),e(t[0].p2.y)];for(const o of t){const a=e(o.circle.radius);i.push(` +A`,a,a,0,o.large?1:0,o.sweep?1:0,e(o.p1.x),e(o.p1.y))}return i.join(" ")}function St(t,n){return Vt(Pt(t),n)}function Me(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:h=350,padding:u=15,scaleToFit:r=!1,symmetricalTextCentre:y=!1,distinct:d,round:b=2}=n;let x=e(t,{lossFunction:s==="default"||!s?tt:s==="logRatio"?Dt:s,distinct:d});i&&(x=Ct(x,o,a));const M=Nt(x,c,h,u,r),A=jt(M,t,y),T=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{const v=m.sets.map(f=>T.get(f)),l=Pt(v),p=Vt(l,b);return{circles:v,arcs:l,path:p,area:m,has:new Set(m.sets)}});function g(m){let v="";for(const l of S)l.has.size>m.length&&m.every(p=>l.has.has(p))&&(v+=" "+l.path);return v}return S.map(({circles:m,arcs:v,path:l,area:p})=>({data:p,text:A[p.sets],circles:m,arcs:v,path:l,distinctPath:l+g(p.sets)}))}var gt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],h=[7,8,11,12,17,19,22,24,27],u=[1,57],r=[1,56],y=[1,58],d=[1,59],b=[1,60],x=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:w(function(g,m,v,l,p,f,N){var I=f.length-1;switch(p){case 1:return f[I-1];case 2:case 3:case 4:this.$=[];break;case 5:f[I-1].push(f[I]),this.$=f[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=f[I];break;case 8:l.setDiagramTitle(f[I].substr(6)),this.$=f[I].substr(6);break;case 9:l.addSubsetData([f[I]],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 10:l.addSubsetData([f[I-1]],f[I],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 11:l.addSubsetData([f[I-2]],void 0,parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 12:l.addSubsetData([f[I-3]],f[I-2],parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 13:if(f[I].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I]),l.addSubsetData(f[I],void 0,void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 14:if(f[I-1].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-1]),l.addSubsetData(f[I-1],f[I],void 0),l.setIndentMode&&l.setIndentMode(!0);break;case 15:if(f[I-2].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-2]),l.addSubsetData(f[I-2],void 0,parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 16:if(f[I-3].length<2)throw new Error("union requires multiple identifiers");l.validateUnionIdentifiers&&l.validateUnionIdentifiers(f[I-3]),l.addSubsetData(f[I-3],f[I-2],parseFloat(f[I])),l.setIndentMode&&l.setIndentMode(!0);break;case 17:case 18:case 19:l.addTextData(f[I-1],f[I],void 0);break;case 20:case 21:l.addTextData(f[I-2],f[I-1],f[I]);break;case 23:l.addStyleData(f[I-1],f[I]);break;case 24:case 25:case 26:var D=l.getCurrentSets();if(!D)throw new Error("text requires set");l.addTextData(D,f[I],void 0);break;case 27:case 28:var D=l.getCurrentSets();if(!D)throw new Error("text requires set");l.addTextData(D,f[I-1],f[I]);break;case 29:case 41:this.$=[f[I]];break;case 30:case 42:this.$=[...f[I-2],f[I]];break;case 31:this.$=[f[I-2],f[I]];break;case 33:this.$=f[I].join(" ");break;case 34:this.$=[f[I]];break;case 35:f[I-1].push(f[I]),this.$=f[I-1];break;case 43:case 44:this.$=f[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:c,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(h,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:c,26:51},{16:u,20:r,21:[1,53],28:52,29:54,30:55,31:y,32:d,33:b},t(s,[2,12]),t(s,[2,16]),t(h,[2,30]),t(h,[2,31]),t(h,[2,32]),t(h,[2,33],{30:61,16:u,20:r,31:y,32:d,33:b}),t(x,[2,34]),t(x,[2,36]),t(x,[2,37]),t(x,[2,38]),t(x,[2,39]),t(x,[2,40]),t(x,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(g,m){if(m.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=m,v}},"parseError"),parse:w(function(g){var m=this,v=[0],l=[],p=[null],f=[],N=this.table,I="",D=0,U=0,j=2,E=1,R=f.slice.call(arguments,1),_=Object.create(this.lexer),P={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(P.yy[V]=this.yy[V]);_.setInput(g,P.yy),P.yy.lexer=_,P.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var O=_.yylloc;f.push(O);var B=_.options&&_.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(G){v.length=v.length-2*G,p.length=p.length-G,f.length=f.length-G}w(W,"popStack");function K(){var G;return G=l.pop()||_.lex()||E,typeof G!="number"&&(G instanceof Array&&(l=G,G=l.pop()),G=m.symbols_[G]||G),G}w(K,"lex");for(var z,L,C,Y,k={},F,H,et,X;;){if(L=v[v.length-1],this.defaultActions[L]?C=this.defaultActions[L]:((z===null||typeof z>"u")&&(z=K()),C=N[L]&&N[L][z]),typeof C>"u"||!C.length||!C[0]){var Z="";X=[];for(F in N[L])this.terminals_[F]&&F>j&&X.push("'"+this.terminals_[F]+"'");_.showPosition?Z="Parse error on line "+(D+1)+`: +`+_.showPosition()+` +Expecting `+X.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on line "+(D+1)+": Unexpected "+(z==E?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Z,{text:_.match,token:this.terminals_[z]||z,line:_.yylineno,loc:O,expected:X})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+z);switch(C[0]){case 1:v.push(z),p.push(_.yytext),f.push(_.yylloc),v.push(C[1]),z=null,U=_.yyleng,I=_.yytext,D=_.yylineno,O=_.yylloc;break;case 2:if(H=this.productions_[C[1]][1],k.$=p[p.length-H],k._$={first_line:f[f.length-(H||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(H||1)].first_column,last_column:f[f.length-1].last_column},B&&(k._$.range=[f[f.length-(H||1)].range[0],f[f.length-1].range[1]]),Y=this.performAction.apply(k,[I,U,D,P.yy,C[1],p,f].concat(R)),typeof Y<"u")return Y;H&&(v=v.slice(0,-1*H*2),p=p.slice(0,-1*H),f=f.slice(0,-1*H)),v.push(this.productions_[C[1]][0]),p.push(k.$),f.push(k._$),et=N[v[v.length-2]][v[v.length-1]],v.push(et);break;case 3:return!0}}return!0},"parse")},A=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||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:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(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:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;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),v.length-1&&(this.yylineno-=v.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:v?(v.length===l.length?this.yylloc.first_column:0)+l[l.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(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:w(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:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,l,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),l=g[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var f in p)this[f]=p[f];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,l;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),f=0;fm[0].length)){if(m=v,l=f,this.options.backtrack_lexer){if(g=this.test_match(v,p[f]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,p[l]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,l,p){switch(l){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return S})();M.lexer=A;function T(){this.yy={}}return w(T,"Parser"),T.prototype=M,M.Parser=T,new T})();gt.parser=gt;var Se=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,we=w((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),_e=w(()=>yt,"getSubsetData"),nt=w(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Te=w(t=>t&&nt(t),"normalizeStyleValue"),Ee=w((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),ze=w((t,n)=>{const s=it(t).sort(),e={};for(const[i,o]of n)e[i]=Te(o)??o;mt.push({targets:s,styles:e})},"addStyleData"),Ae=w(()=>mt,"getStyleData"),it=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),Re=w(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),De=w(()=>pt,"getTextData"),Ce=w(()=>vt,"getCurrentSets"),Ne=w(()=>It,"getIndentMode"),Oe=w(t=>{It=t},"setIndentMode"),Fe=oe.venn;function Bt(){return ie(Fe,wt().venn)}w(Bt,"getConfig");var Le=w(()=>{se(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),je={getConfig:Bt,clear:Le,setAccTitle:Zt,getAccTitle:Yt,setDiagramTitle:Xt,getDiagramTitle:Ht,getAccDescription:Kt,setAccDescription:Wt,addSubsetData:we,getSubsetData:_e,addTextData:Ee,addStyleData:ze,validateUnionIdentifiers:Re,getTextData:De,getStyleData:Ae,getCurrentSets:Ce,getIndentMode:Ne,setIndentMode:Oe},Pe=w(t=>` + .venn-title { + font-size: 32px; + fill: ${t.vennTitleTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-circle text { + font-size: 48px; + font-family: ${t.fontFamily}; + } + + .venn-intersection text { + font-size: 48px; + fill: ${t.vennSetTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-text-node { + font-family: ${t.fontFamily}; + color: ${t.vennSetTextColor}; + } +`,"getStyles"),Ve=Pe;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var Be=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:h}=wt(),u=c==="handDrawn",r=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),y=i.getDiagramTitle?.(),d=i.getSubsetData(),b=i.getTextData(),x=qt(i.getStyleData()),M=o?.width??800,A=o?.height??450,S=M/1600,g=y?48*S:0,m=a.primaryTextColor??a.textColor,v=Jt(n);v.attr("viewBox",`0 0 ${M} ${A}`),y&&v.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*S}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*S).style("fill",a.vennTitleTextColor||a.titleColor);const l=ot(document.createElement("div")),p=be().width(M).height(A-g);l.datum(d).call(p);const f=u?Qt.svg(l.select("svg").node()):void 0,N=Me(d,{width:M,height:A-g,padding:o?.padding??15}),I=new Map;for(const E of N){const R=Q([...E.data.sets].sort());I.set(R,E)}b.length>0&&Ut(o,I,l,b,S,x);const D=$t(a.background||"#f4f4f4");l.selectAll(".venn-circle").each(function(E,R){const _=ot(this),V=Q([...E.sets].sort()),O=x.get(V),B=O?.fill||r[R%r.length]||a.primaryColor;_.classed(`venn-set-${R%8}`,!0);const W=O?.["fill-opacity"]??.1,K=O?.stroke||B,z=O?.["stroke-width"]||`${5*S}`;if(u&&f){const C=I.get(V);if(C&&C.circles.length>0){const Y=C.circles[0],k=f.circle(Y.x,Y.y,Y.radius*2,{roughness:.7,seed:h,fill:kt(B,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+R*60,stroke:K,strokeWidth:parseFloat(String(z))});_.select("path").remove(),_.node()?.insertBefore(k,_.select("text").node())}}else _.select("path").style("fill",B).style("fill-opacity",W).style("stroke",K).style("stroke-width",z).style("stroke-opacity",.95);const L=O?.color||(D?te(B,30):ee(B,30));_.select("text").style("font-size",`${48*S}px`).style("fill",L)}),u&&f?l.selectAll(".venn-intersection").each(function(E){const R=ot(this),P=Q([...E.sets].sort()),V=x.get(P),O=V?.fill;if(O){const B=R.select("path"),W=B.attr("d");if(W){const K=f.path(W,{roughness:.7,seed:h,fill:kt(O,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),z=B.node();z?.parentNode?.insertBefore(K,z),B.remove()}}else R.select("path").style("fill-opacity",0);R.select("text").style("font-size",`${48*S}px`).style("fill",V?.color??a.vennSetTextColor??m)}):(l.selectAll(".venn-intersection text").style("font-size",`${48*S}px`).style("fill",E=>{const _=Q([...E.sets].sort());return x.get(_)?.color??a.vennSetTextColor??m}),l.selectAll(".venn-intersection path").style("fill-opacity",E=>{const _=Q([...E.sets].sort());return x.get(_)?.fill?1:0}).style("fill",E=>{const _=Q([...E.sets].sort());return x.get(_)?.fill??"transparent"}));const U=v.append("g").attr("transform",`translate(0, ${g})`),j=l.select("svg").node();if(j&&"childNodes"in j)for(const E of[...j.childNodes])U.node()?.appendChild(E);ne(v,A,M,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const a=t?.useDebugLayout??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const r of e){const y=Q(r.sets),d=u.get(y);d?d.push(r):u.set(y,[r])}for(const[r,y]of u.entries()){const d=n.get(r);if(!d?.text)continue;const b=d.text.x,x=d.text.y,M=Math.min(...d.circles.map(E=>E.radius)),A=Math.min(...d.circles.map(E=>E.radius-Math.hypot(b-E.x,x-E.y)));let T=Number.isFinite(A)?Math.max(0,A):0;T===0&&Number.isFinite(M)&&(T=M*.6);const S=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);a&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",x).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,T*2*.95),m=Math.max(60*i,T*2*.95),p=(d.data.label&&d.data.label.length>0?Math.min(32*i,T*.25):0)+(y.length<=2?30*i:0),f=b-g/2,N=x-m/2+p,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),D=Math.max(1,Math.ceil(y.length/I)),U=g/I,j=m/D;for(const[E,R]of y.entries()){const _=E%I,P=Math.floor(E/I),V=f+U*(_+.5),O=N+j*(P+.5);a&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",f+U*_).attr("y",N+j*P).attr("width",U).attr("height",j).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,W=j*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",W).attr("x",V-B/2).attr("y",O-W/2).attr("overflow","visible"),z=o.get(R.id)?.color,L=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&L.style("color",z)}}}w(Ut,"renderTextNodes");var qe={draw:Be},Ge={parser:Se,db:je,renderer:qe,styles:Ve};export{Ge as diagram}; diff --git a/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-DNukiHq4.js b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-DNukiHq4.js new file mode 100644 index 0000000000..e5d1f9429b --- /dev/null +++ b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-DNukiHq4.js @@ -0,0 +1,5 @@ +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-DtRfJ0vw.js";/** +* vue v3.5.35 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const a=()=>{};export{t as BaseTransition,o as BaseTransitionPropsValidators,r as Comment,n as DeprecationTypes,i as EffectScope,c as ErrorCodes,l as ErrorTypeStrings,d as Fragment,p as KeepAlive,b as ReactiveEffect,m as Static,f as Suspense,u as Teleport,h as Text,S as TrackOpTypes,y as Transition,R as TransitionGroup,v as TriggerOpTypes,C as VueElement,g as assertNumber,w as callWithAsyncErrorHandling,T as callWithErrorHandling,E as camelize,x as capitalize,M as cloneVNode,k as compatUtils,a as compile,D as computed,P as createApp,V as createBlock,A as createCommentVNode,B as createElementBlock,H as createElementVNode,N as createHydrationRenderer,O as createPropsRestProxy,I as createRenderer,z as createSSRApp,F as createSlots,U as createStaticVNode,K as createTextVNode,W as createVNode,j as customRef,q as defineAsyncComponent,G as defineComponent,L as defineCustomElement,J as defineEmits,Q as defineExpose,X as defineModel,Y as defineOptions,Z as defineProps,_ as defineSSRCustomElement,$ as defineSlots,aa as devtools,ea as effect,sa as effectScope,ta as getCurrentInstance,oa as getCurrentScope,ra as getCurrentWatcher,na as getTransitionRawChildren,ia as guardReactiveProps,ca as h,la as handleError,da as hasInjectionContext,pa as hydrate,ba as hydrateOnIdle,ma as hydrateOnInteraction,fa as hydrateOnMediaQuery,ua as hydrateOnVisible,ha as initCustomFormatter,Sa as initDirectivesForSSR,ya as inject,Ra as isMemoSame,va as isProxy,Ca as isReactive,ga as isReadonly,wa as isRef,Ta as isRuntimeOnly,Ea as isShallow,xa as isVNode,Ma as markRaw,ka as mergeDefaults,Da as mergeModels,Pa as mergeProps,Va as nextTick,Aa as nodeOps,Ba as normalizeClass,Ha as normalizeProps,Na as normalizeStyle,Oa as onActivated,Ia as onBeforeMount,za as onBeforeUnmount,Fa as onBeforeUpdate,Ua as onDeactivated,Ka as onErrorCaptured,Wa as onMounted,ja as onRenderTracked,qa as onRenderTriggered,Ga as onScopeDispose,La as onServerPrefetch,Ja as onUnmounted,Qa as onUpdated,Xa as onWatcherCleanup,Ya as openBlock,Za as patchProp,_a as popScopeId,$a as provide,ae as proxyRefs,ee as pushScopeId,se as queuePostFlushCb,te as reactive,oe as readonly,re as ref,ne as registerRuntimeCompiler,ie as render,ce as renderList,le as renderSlot,de as resolveComponent,pe as resolveDirective,be as resolveDynamicComponent,me as resolveFilter,fe as resolveTransitionHooks,ue as setBlockTracking,he as setDevtoolsHook,Se as setTransitionHooks,ye as shallowReactive,Re as shallowReadonly,ve as shallowRef,Ce as ssrContextKey,ge as ssrUtils,we as stop,Te as toDisplayString,Ee as toHandlerKey,xe as toHandlers,Me as toRaw,ke as toRef,De as toRefs,Pe as toValue,Ve as transformVNodeArgs,Ae as triggerRef,Be as unref,He as useAttrs,Ne as useCssModule,Oe as useCssVars,Ie as useHost,ze as useId,Fe as useModel,Ue as useSSRContext,Ke as useShadowRoot,We as useSlots,je as useTemplateRef,qe as useTransitionState,Ge as vModelCheckbox,Le as vModelDynamic,Je as vModelRadio,Qe as vModelSelect,Xe as vModelText,Ye as vShow,Ze as version,_e as warn,$e as watch,as as watchEffect,es as watchPostEffect,ss as watchSyncEffect,ts as withAsyncContext,os as withCtx,rs as withDefaults,ns as withDirectives,is as withKeys,cs as withMemo,ls as withModifiers,ds as withScopeId}; diff --git a/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js b/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js new file mode 100644 index 0000000000..6cf4cb3863 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js @@ -0,0 +1,173 @@ +var Zb=Object.create,As=Object.defineProperty,Qb=Object.getOwnPropertyDescriptor,Yf=Object.getOwnPropertyNames,ew=Object.getPrototypeOf,tw=Object.prototype.hasOwnProperty,i=(e,t)=>As(e,"name",{value:t,configurable:!0}),rw=(e,t)=>function(){return e&&(t=(0,e[Yf(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[Yf(e)[0]])((t={exports:{}}).exports,t),t.exports},Br=(e,t)=>{for(var r in t)As(e,r,{get:t[r],enumerable:!0})},Xf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Yf(t))!tw.call(e,a)&&a!==r&&As(e,a,{get:()=>t[a],enumerable:!(n=Qb(t,a))||n.enumerable});return e},Rl=(e,t,r)=>(Xf(e,t,"default"),r),Jf=(e,t,r)=>(r=e!=null?Zb(ew(e)):{},Xf(As(r,"default",{value:e,enumerable:!0}),e)),Zf=e=>Xf(As({},"__esModule",{value:!0}),e),$l={};Br($l,{AnnotatedTextEdit:()=>ur,ChangeAnnotation:()=>en,ChangeAnnotationIdentifier:()=>je,CodeAction:()=>Pu,CodeActionContext:()=>ku,CodeActionKind:()=>Nu,CodeActionTriggerKind:()=>Fi,CodeDescription:()=>lu,CodeLens:()=>Ou,Color:()=>uo,ColorInformation:()=>ru,ColorPresentation:()=>nu,Command:()=>Qr,CompletionItem:()=>vu,CompletionItemKind:()=>du,CompletionItemLabelDetails:()=>yu,CompletionItemTag:()=>hu,CompletionList:()=>Tu,CreateFile:()=>ca,DeleteFile:()=>fa,Diagnostic:()=>Li,DiagnosticRelatedInformation:()=>fo,DiagnosticSeverity:()=>su,DiagnosticTag:()=>ou,DocumentHighlight:()=>_u,DocumentHighlightKind:()=>Eu,DocumentLink:()=>Du,DocumentSymbol:()=>Iu,DocumentUri:()=>Qc,EOL:()=>Sg,FoldingRange:()=>iu,FoldingRangeKind:()=>au,FormattingOptions:()=>Lu,Hover:()=>Ru,InlayHint:()=>Ku,InlayHintKind:()=>mo,InlayHintLabelPart:()=>go,InlineCompletionContext:()=>Xu,InlineCompletionItem:()=>Wu,InlineCompletionList:()=>Vu,InlineCompletionTriggerKind:()=>Hu,InlineValueContext:()=>Bu,InlineValueEvaluatableExpression:()=>zu,InlineValueText:()=>ju,InlineValueVariableLookup:()=>Uu,InsertReplaceEdit:()=>mu,InsertTextFormat:()=>pu,InsertTextMode:()=>gu,Location:()=>Oi,LocationLink:()=>tu,MarkedString:()=>xi,MarkupContent:()=>da,MarkupKind:()=>ho,OptionalVersionedTextDocumentIdentifier:()=>Mi,ParameterInformation:()=>$u,Position:()=>ie,Range:()=>ee,RenameFile:()=>ua,SelectedCompletionInfo:()=>Yu,SelectionRange:()=>Mu,SemanticTokenModifiers:()=>Fu,SemanticTokenTypes:()=>xu,SemanticTokens:()=>Gu,SignatureInformation:()=>Au,StringValue:()=>qu,SymbolInformation:()=>bu,SymbolKind:()=>Cu,SymbolTag:()=>Su,TextDocument:()=>Zu,TextDocumentEdit:()=>Di,TextDocumentIdentifier:()=>cu,TextDocumentItem:()=>fu,TextEdit:()=>Wt,URI:()=>co,VersionedTextDocumentIdentifier:()=>uu,WorkspaceChange:()=>Cg,WorkspaceEdit:()=>po,WorkspaceFolder:()=>Ju,WorkspaceSymbol:()=>wu,integer:()=>eu,uinteger:()=>Pi});var Qc,co,eu,Pi,ie,ee,Oi,tu,uo,ru,nu,au,iu,fo,su,ou,lu,Li,Qr,Wt,en,je,ur,Di,ca,ua,fa,po,Ai,Nc,Cg,cu,uu,Mi,fu,ho,da,du,pu,hu,mu,gu,yu,vu,Tu,xi,Ru,$u,Au,Eu,_u,Cu,Su,bu,wu,Iu,Nu,Fi,ku,Pu,Ou,Lu,Du,Mu,xu,Fu,Gu,ju,Uu,zu,Bu,mo,go,Ku,qu,Wu,Vu,Hu,Yu,Xu,Ju,Sg,Zu,Dh,$,Es=rw({"../../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})(Qc||(Qc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(co||(co={})),(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})(eu||(eu={})),(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})(Pi||(Pi={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Pi.MAX_VALUE),a===Number.MAX_VALUE&&(a=Pi.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&$.uinteger(a.line)&&$.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if($.uinteger(n)&&$.uinteger(a)&&$.uinteger(s)&&$.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 $.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(ee||(ee={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&ee.is(a.range)&&($.string(a.uri)||$.undefined(a.uri))}i(r,"is"),e.is=r})(Oi||(Oi={})),(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 $.objectLiteral(a)&&ee.is(a.targetRange)&&$.string(a.targetUri)&&ee.is(a.targetSelectionRange)&&(ee.is(a.originSelectionRange)||$.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(tu||(tu={})),(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 $.objectLiteral(a)&&$.numberRange(a.red,0,1)&&$.numberRange(a.green,0,1)&&$.numberRange(a.blue,0,1)&&$.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(uo||(uo={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&ee.is(a.range)&&uo.is(a.color)}i(r,"is"),e.is=r})(ru||(ru={})),(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 $.objectLiteral(a)&&$.string(a.label)&&($.undefined(a.textEdit)||Wt.is(a))&&($.undefined(a.additionalTextEdits)||$.typedArray(a.additionalTextEdits,Wt.is))}i(r,"is"),e.is=r})(nu||(nu={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(au||(au={})),(function(e){function t(n,a,s,o,l,c){const u={startLine:n,endLine:a};return $.defined(s)&&(u.startCharacter=s),$.defined(o)&&(u.endCharacter=o),$.defined(l)&&(u.kind=l),$.defined(c)&&(u.collapsedText=c),u}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&$.uinteger(a.startLine)&&$.uinteger(a.startLine)&&($.undefined(a.startCharacter)||$.uinteger(a.startCharacter))&&($.undefined(a.endCharacter)||$.uinteger(a.endCharacter))&&($.undefined(a.kind)||$.string(a.kind))}i(r,"is"),e.is=r})(iu||(iu={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&Oi.is(a.location)&&$.string(a.message)}i(r,"is"),e.is=r})(fo||(fo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(su||(su={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(ou||(ou={})),(function(e){function t(r){const n=r;return $.objectLiteral(n)&&$.string(n.href)}i(t,"is"),e.is=t})(lu||(lu={})),(function(e){function t(n,a,s,o,l,c){let u={range:n,message:a};return $.defined(s)&&(u.severity=s),$.defined(o)&&(u.code=o),$.defined(l)&&(u.source=l),$.defined(c)&&(u.relatedInformation=c),u}i(t,"create"),e.create=t;function r(n){var a;let s=n;return $.defined(s)&&ee.is(s.range)&&$.string(s.message)&&($.number(s.severity)||$.undefined(s.severity))&&($.integer(s.code)||$.string(s.code)||$.undefined(s.code))&&($.undefined(s.codeDescription)||$.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&($.string(s.source)||$.undefined(s.source))&&($.undefined(s.relatedInformation)||$.typedArray(s.relatedInformation,fo.is))}i(r,"is"),e.is=r})(Li||(Li={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return $.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.title)&&$.string(a.command)}i(r,"is"),e.is=r})(Qr||(Qr={})),(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 $.objectLiteral(o)&&$.string(o.newText)&&ee.is(o.range)}i(a,"is"),e.is=a})(Wt||(Wt={})),(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 $.objectLiteral(a)&&$.string(a.label)&&($.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&($.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(en||(en={})),(function(e){function t(r){const n=r;return $.string(n)}i(t,"is"),e.is=t})(je||(je={})),(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 Wt.is(o)&&(en.is(o.annotationId)||je.is(o.annotationId))}i(a,"is"),e.is=a})(ur||(ur={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&Mi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(Di||(Di={})),(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"&&$.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||$.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||$.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(ca||(ca={})),(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"&&$.string(a.oldUri)&&$.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||$.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||$.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(ua||(ua={})),(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"&&$.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||$.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||$.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(fa||(fa={})),(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=>$.string(a.kind)?ca.is(a)||ua.is(a)||fa.is(a):Di.is(a)))}i(t,"is"),e.is=t})(po||(po={})),Ai=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=Wt.insert(e,t):je.is(r)?(a=r,n=ur.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=ur.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=Wt.replace(e,t):je.is(r)?(a=r,n=ur.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=ur.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Wt.del(e):je.is(t)?(n=t,r=ur.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=ur.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.")}},Nc=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(je.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()}},Cg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Nc(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Di.is(t)){const r=new Ai(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new Ai(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(Mi.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 Ai(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 Ai(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Nc,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;en.is(t)||je.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ca.create(e,r):(s=je.is(n)?n:this._changeAnnotations.manage(n),a=ca.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;en.is(r)||je.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ua.create(e,t,n):(o=je.is(a)?a:this._changeAnnotations.manage(a),s=ua.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;en.is(t)||je.is(t)?n=t:r=t;let a,s;if(n===void 0?a=fa.create(e,r):(s=je.is(n)?n:this._changeAnnotations.manage(n),a=fa.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 $.defined(a)&&$.string(a.uri)}i(r,"is"),e.is=r})(cu||(cu={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.uri)&&$.integer(a.version)}i(r,"is"),e.is=r})(uu||(uu={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.uri)&&(a.version===null||$.integer(a.version))}i(r,"is"),e.is=r})(Mi||(Mi={})),(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 $.defined(a)&&$.string(a.uri)&&$.string(a.languageId)&&$.integer(a.version)&&$.string(a.text)}i(r,"is"),e.is=r})(fu||(fu={})),(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})(ho||(ho={})),(function(e){function t(r){const n=r;return $.objectLiteral(r)&&ho.is(n.kind)&&$.string(n.value)}i(t,"is"),e.is=t})(da||(da={})),(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})(du||(du={})),(function(e){e.PlainText=1,e.Snippet=2})(pu||(pu={})),(function(e){e.Deprecated=1})(hu||(hu={})),(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&&$.string(a.newText)&&ee.is(a.insert)&&ee.is(a.replace)}i(r,"is"),e.is=r})(mu||(mu={})),(function(e){e.asIs=1,e.adjustIndentation=2})(gu||(gu={})),(function(e){function t(r){const n=r;return n&&($.string(n.detail)||n.detail===void 0)&&($.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(yu||(yu={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(vu||(vu={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(Tu||(Tu={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return $.string(a)||$.objectLiteral(a)&&$.string(a.language)&&$.string(a.value)}i(r,"is"),e.is=r})(xi||(xi={})),(function(e){function t(r){let n=r;return!!n&&$.objectLiteral(n)&&(da.is(n.contents)||xi.is(n.contents)||$.typedArray(n.contents,xi.is))&&(r.range===void 0||ee.is(r.range))}i(t,"is"),e.is=t})(Ru||(Ru={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})($u||($u={})),(function(e){function t(r,n,...a){let s={label:r};return $.defined(n)&&(s.documentation=n),$.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Au||(Au={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Eu||(Eu={})),(function(e){function t(r,n){let a={range:r};return $.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(_u||(_u={})),(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})(Cu||(Cu={})),(function(e){e.Deprecated=1})(Su||(Su={})),(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})(bu||(bu={})),(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})(wu||(wu={})),(function(e){function t(n,a,s,o,l,c){let u={name:n,detail:a,kind:s,range:o,selectionRange:l};return c!==void 0&&(u.children=c),u}i(t,"create"),e.create=t;function r(n){let a=n;return a&&$.string(a.name)&&$.number(a.kind)&&ee.is(a.range)&&ee.is(a.selectionRange)&&(a.detail===void 0||$.string(a.detail))&&(a.deprecated===void 0||$.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})(Iu||(Iu={})),(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"})(Nu||(Nu={})),(function(e){e.Invoked=1,e.Automatic=2})(Fi||(Fi={})),(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 $.defined(a)&&$.typedArray(a.diagnostics,Li.is)&&(a.only===void 0||$.typedArray(a.only,$.string))&&(a.triggerKind===void 0||a.triggerKind===Fi.Invoked||a.triggerKind===Fi.Automatic)}i(r,"is"),e.is=r})(ku||(ku={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):Qr.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&&$.string(a.title)&&(a.diagnostics===void 0||$.typedArray(a.diagnostics,Li.is))&&(a.kind===void 0||$.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||Qr.is(a.command))&&(a.isPreferred===void 0||$.boolean(a.isPreferred))&&(a.edit===void 0||po.is(a.edit))}i(r,"is"),e.is=r})(Pu||(Pu={})),(function(e){function t(n,a){let s={range:n};return $.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&ee.is(a.range)&&($.undefined(a.command)||Qr.is(a.command))}i(r,"is"),e.is=r})(Ou||(Ou={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.uinteger(a.tabSize)&&$.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(Lu||(Lu={})),(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 $.defined(a)&&ee.is(a.range)&&($.undefined(a.target)||$.string(a.target))}i(r,"is"),e.is=r})(Du||(Du={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&ee.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(Mu||(Mu={})),(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"})(xu||(xu={})),(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"})(Fu||(Fu={})),(function(e){function t(r){const n=r;return $.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})(Gu||(Gu={})),(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&&ee.is(a.range)&&$.string(a.text)}i(r,"is"),e.is=r})(ju||(ju={})),(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&&ee.is(a.range)&&$.boolean(a.caseSensitiveLookup)&&($.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(Uu||(Uu={})),(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&&ee.is(a.range)&&($.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(zu||(zu={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return $.defined(a)&&ee.is(n.stoppedLocation)}i(r,"is"),e.is=r})(Bu||(Bu={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(mo||(mo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&(a.tooltip===void 0||$.string(a.tooltip)||da.is(a.tooltip))&&(a.location===void 0||Oi.is(a.location))&&(a.command===void 0||Qr.is(a.command))}i(r,"is"),e.is=r})(go||(go={})),(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 $.objectLiteral(a)&&ie.is(a.position)&&($.string(a.label)||$.typedArray(a.label,go.is))&&(a.kind===void 0||mo.is(a.kind))&&a.textEdits===void 0||$.typedArray(a.textEdits,Wt.is)&&(a.tooltip===void 0||$.string(a.tooltip)||da.is(a.tooltip))&&(a.paddingLeft===void 0||$.boolean(a.paddingLeft))&&(a.paddingRight===void 0||$.boolean(a.paddingRight))}i(r,"is"),e.is=r})(Ku||(Ku={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(qu||(qu={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(Wu||(Wu={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(Vu||(Vu={})),(function(e){e.Invoked=0,e.Automatic=1})(Hu||(Hu={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(Yu||(Yu={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Xu||(Xu={})),(function(e){function t(r){const n=r;return $.objectLiteral(n)&&co.is(n.uri)&&$.string(n.name)}i(t,"is"),e.is=t})(Ju||(Ju={})),Sg=[` +`,`\r +`,"\r"],(function(e){function t(s,o,l,c){return new Dh(s,o,l,c)}i(t,"create"),e.create=t;function r(s){let o=s;return!!($.defined(o)&&$.string(o.uri)&&($.undefined(o.languageId)||$.string(o.languageId))&&$.uinteger(o.lineCount)&&$.func(o.getText)&&$.func(o.positionAt)&&$.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),c=a(o,(f,d)=>{let h=f.range.start.line-d.range.start.line;return h===0?f.range.start.character-d.range.start.character:h}),u=l.length;for(let f=c.length-1;f>=0;f--){let d=c[f],h=s.offsetAt(d.range.start),y=s.offsetAt(d.range.end);if(y<=u)l=l.substring(0,h)+d.newText+l.substring(y,l.length);else throw new Error("Overlapping edit");u=h}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,c=s.slice(0,l),u=s.slice(l);a(c,o),a(u,o);let f=0,d=0,h=0;for(;f0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,n=t.length;if(n===0)return ie.create(0,e);for(;re?n=s:r=s+1}let a=r-1;return ie.create(a,e-t[a])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1"u"}i(n,"undefined"),e.undefined=n;function a(y){return y===!0||y===!1}i(a,"boolean"),e.boolean=a;function s(y){return t.call(y)==="[object String]"}i(s,"string"),e.string=s;function o(y){return t.call(y)==="[object Number]"}i(o,"number"),e.number=o;function l(y,v,C){return t.call(y)==="[object Number]"&&v<=y&&y<=C}i(l,"numberRange"),e.numberRange=l;function c(y){return t.call(y)==="[object Number]"&&-2147483648<=y&&y<=2147483647}i(c,"integer"),e.integer=c;function u(y){return t.call(y)==="[object Number]"&&0<=y&&y<=2147483647}i(u,"uinteger"),e.uinteger=u;function f(y){return t.call(y)==="[object Function]"}i(f,"func"),e.func=f;function d(y){return y!==null&&typeof y=="object"}i(d,"objectLiteral"),e.objectLiteral=d;function h(y,v){return Array.isArray(y)&&y.every(v)}i(h,"typedArray"),e.typedArray=h})($||($={}))}}),Nn=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}i(r,"RAL"),(function(n){function a(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");t=s}i(a,"install"),n.install=a})(r||(r={})),e.default=r}}),_s=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(c){return c===!0||c===!1}i(t,"boolean"),e.boolean=t;function r(c){return typeof c=="string"||c instanceof String}i(r,"string"),e.string=r;function n(c){return typeof c=="number"||c instanceof Number}i(n,"number"),e.number=n;function a(c){return c instanceof Error}i(a,"error"),e.error=a;function s(c){return typeof c=="function"}i(s,"func"),e.func=s;function o(c){return Array.isArray(c)}i(o,"array"),e.array=o;function l(c){return o(c)&&c.every(u=>r(u))}i(l,"stringArray"),e.stringArray=l}}),Ka=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=Nn(),r;(function(s){const o={dispose(){}};s.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{i(this,"CallbackList")}add(s,o=null,l){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(l)&&l.push({dispose:i(()=>this.remove(s,o),"dispose")})}remove(s,o=null){if(!this._callbacks)return;let l=!1;for(let c=0,u=this._callbacks.length;c{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,l);const u={dispose:i(()=>{this._callbacks&&(this._callbacks.remove(o,l),u.dispose=bg._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(c)&&c.push(u),u}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=a,a._noop=function(){}}}),Al=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=Nn(),r=_s(),n=Ka(),a;(function(c){c.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),c.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function u(f){const d=f;return d&&(d===c.None||d===c.Cancelled||r.boolean(d.isCancellationRequested)&&!!d.onCancellationRequested)}i(u,"is"),c.is=u})(a||(e.CancellationToken=a={}));var s=Object.freeze(function(c,u){const f=(0,t.default)().timer.setTimeout(c.bind(u),0);return{dispose(){f.dispose()}}}),o=class{static{i(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{i(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}};e.CancellationTokenSource=l}}),wg=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=_s(),r;(function(g){g.ParseError=-32700,g.InvalidRequest=-32600,g.MethodNotFound=-32601,g.InvalidParams=-32602,g.InternalError=-32603,g.jsonrpcReservedErrorRangeStart=-32099,g.serverErrorStart=-32099,g.MessageWriteError=-32099,g.MessageReadError=-32098,g.PendingResponseRejected=-32097,g.ConnectionInactive=-32096,g.ServerNotInitialized=-32002,g.UnknownErrorCode=-32001,g.jsonrpcReservedErrorRangeEnd=-32e3,g.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class Ig extends Error{static{i(this,"ResponseError")}constructor(E,T,R){super(T),this.code=t.number(E)?E:r.UnknownErrorCode,this.data=R,Object.setPrototypeOf(this,Ig.prototype)}toJson(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),E}};e.ResponseError=n;var a=class yo{static{i(this,"ParameterStructures")}constructor(E){this.kind=E}static is(E){return E===yo.auto||E===yo.byName||E===yo.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{static{i(this,"AbstractMessageSignature")}constructor(g,E){this.method=g,this.numberOfParams=E}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s;var o=class extends s{static{i(this,"RequestType0")}constructor(g){super(g,0)}};e.RequestType0=o;var l=class extends s{static{i(this,"RequestType")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType=l;var c=class extends s{static{i(this,"RequestType1")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType1=c;var u=class extends s{static{i(this,"RequestType2")}constructor(g){super(g,2)}};e.RequestType2=u;var f=class extends s{static{i(this,"RequestType3")}constructor(g){super(g,3)}};e.RequestType3=f;var d=class extends s{static{i(this,"RequestType4")}constructor(g){super(g,4)}};e.RequestType4=d;var h=class extends s{static{i(this,"RequestType5")}constructor(g){super(g,5)}};e.RequestType5=h;var y=class extends s{static{i(this,"RequestType6")}constructor(g){super(g,6)}};e.RequestType6=y;var v=class extends s{static{i(this,"RequestType7")}constructor(g){super(g,7)}};e.RequestType7=v;var C=class extends s{static{i(this,"RequestType8")}constructor(g){super(g,8)}};e.RequestType8=C;var b=class extends s{static{i(this,"RequestType9")}constructor(g){super(g,9)}};e.RequestType9=b;var w=class extends s{static{i(this,"NotificationType")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType=w;var I=class extends s{static{i(this,"NotificationType0")}constructor(g){super(g,0)}};e.NotificationType0=I;var A=class extends s{static{i(this,"NotificationType1")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=A;var k=class extends s{static{i(this,"NotificationType2")}constructor(g){super(g,2)}};e.NotificationType2=k;var G=class extends s{static{i(this,"NotificationType3")}constructor(g){super(g,3)}};e.NotificationType3=G;var H=class extends s{static{i(this,"NotificationType4")}constructor(g){super(g,4)}};e.NotificationType4=H;var X=class extends s{static{i(this,"NotificationType5")}constructor(g){super(g,5)}};e.NotificationType5=X;var le=class extends s{static{i(this,"NotificationType6")}constructor(g){super(g,6)}};e.NotificationType6=le;var ce=class extends s{static{i(this,"NotificationType7")}constructor(g){super(g,7)}};e.NotificationType7=ce;var Ne=class extends s{static{i(this,"NotificationType8")}constructor(g){super(g,8)}};e.NotificationType8=Ne;var P=class extends s{static{i(this,"NotificationType9")}constructor(g){super(g,9)}};e.NotificationType9=P;var _;(function(g){function E(S){const O=S;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}i(E,"isRequest"),g.isRequest=E;function T(S){const O=S;return O&&t.string(O.method)&&S.id===void 0}i(T,"isNotification"),g.isNotification=T;function R(S){const O=S;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}i(R,"isResponse"),g.isResponse=R})(_||(e.Message=_={}))}}),Ng=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(r||(e.Touch=r={}));var n=class{static{i(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=r.None){const l=this._map.get(s);if(l)return o!==r.None&&this.touch(l,o),l.value}set(s,o,l=r.None){let c=this._map.get(s);if(c)c.value=o,l!==r.None&&this.touch(c,l);else{switch(c={key:s,value:o,next:void 0,previous:void 0},l){case r.None:this.addItemLast(c);break;case r.First:this.addItemFirst(c);break;case r.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const l=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==l)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}values(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.value,done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}entries(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,l=this.size;for(;o&&l>s;)this._map.delete(o.key),o=o.next,l--;this._head=o,this._size=l,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,l=s.previous;if(!o||!l)throw new Error("Invalid list");o.previous=l,l.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(s===this._head)return;const l=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(l.previous=c,c.next=l),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===r.Last){if(s===this._tail)return;const l=s.next,c=s.previous;s===this._head?(l.previous=void 0,this._head=l):(l.previous=c,c.next=l),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,l)=>{s.push([l,o])}),s}fromJSON(s){this.clear();for(const[o,l]of s)this.set(o,l)}};e.LinkedMap=n;var a=class extends n{static{i(this,"LRUCache")}constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=r.AsNew){return super.get(s,o)}peek(s){return super.get(s,r.None)}set(s,o){return super.set(s,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=a}}),nw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(a){return{dispose:a}}i(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),aw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Al(),r;(function(l){l.Continue=0,l.Cancelled=1})(r||(r={}));var n=class{static{i(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;const c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=r.Continue,this.buffers.set(l.id,c),l.$cancellationData=c}async sendCancellation(l,c){const u=this.buffers.get(c);if(u===void 0)return;const f=new Int32Array(u,0,1);Atomics.store(f,0,r.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var a=class{static{i(this,"SharedArrayBufferCancellationToken")}constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{static{i(this,"SharedArrayBufferCancellationTokenSource")}constructor(l){this.token=new a(l)}cancel(){}dispose(){}},o=class{static{i(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(l){const c=l.$cancellationData;return c===void 0?new t.CancellationTokenSource:new s(c)}};e.SharedArrayReceiverStrategy=o}}),kg=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=Nn(),r=class{static{i(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((a,s)=>{this._waiting.push({thunk:n,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=n.thunk();a instanceof Promise?a.then(s=>{this._active--,n.resolve(s),this.runNext()},s=>{this._active--,n.reject(s),this.runNext()}):(this._active--,n.resolve(a),this.runNext())}catch(a){this._active--,n.reject(a),this.runNext()}}};e.Semaphore=r}}),iw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=Nn(),r=_s(),n=Ka(),a=kg(),s;(function(u){function f(d){let h=d;return h&&r.func(h.listen)&&r.func(h.dispose)&&r.func(h.onError)&&r.func(h.onClose)&&r.func(h.onPartialMessage)}i(f,"is"),u.is=f})(s||(e.MessageReader=s={}));var o=class{static{i(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${r.string(u.message)?u.message:"unknown"}`)}};e.AbstractMessageReader=o;var l;(function(u){function f(d){let h,y;const v=new Map;let C;const b=new Map;if(d===void 0||typeof d=="string")h=d??"utf-8";else{if(h=d.charset??"utf-8",d.contentDecoder!==void 0&&(y=d.contentDecoder,v.set(y.name,y)),d.contentDecoders!==void 0)for(const w of d.contentDecoders)v.set(w.name,w);if(d.contentTypeDecoder!==void 0&&(C=d.contentTypeDecoder,b.set(C.name,C)),d.contentTypeDecoders!==void 0)for(const w of d.contentTypeDecoders)b.set(w.name,w)}return C===void 0&&(C=(0,t.default)().applicationJson.decoder,b.set(C.name,C)),{charset:h,contentDecoder:y,contentDecoders:v,contentTypeDecoder:C,contentTypeDecoders:b}}i(f,"fromOptions"),u.fromOptions=f})(l||(l={}));var c=class extends o{static{i(this,"ReadableStreamMessageReader")}constructor(u,f){super(),this.readable=u,this.options=l.fromOptions(f),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const f=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),f}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const h=d.get("content-length");if(!h){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(d))}`));return}const y=parseInt(h);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${h}`));return}this.nextMessageLength=y}const f=this.buffer.tryReadBody(this.nextMessageLength);if(f===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(f):f,h=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(h)}).catch(d=>{this.fireError(d)})}}catch(f){this.fireError(f)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,f)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:f}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=c}}),sw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=Nn(),r=_s(),n=kg(),a=Ka(),s="Content-Length: ",o=`\r +`,l;(function(d){function h(y){let v=y;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}i(h,"is"),d.is=h})(l||(e.MessageWriter=l={}));var c=class{static{i(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,h,y){this.errorEmitter.fire([this.asError(d),h,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${r.string(d.message)?d.message:"unknown"}`)}};e.AbstractMessageWriter=c;var u;(function(d){function h(y){return y===void 0||typeof y=="string"?{charset:y??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:y.charset??"utf-8",contentEncoder:y.contentEncoder,contentTypeEncoder:y.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}i(h,"fromOptions"),d.fromOptions=h})(u||(u={}));var f=class extends c{static{i(this,"WriteableStreamMessageWriter")}constructor(d,h){super(),this.writable=d,this.options=u.fromOptions(h),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),o),v.push(o),this.doWrite(d,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(d,h,y){try{return await this.writable.write(h.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,d),Promise.reject(v)}}handleError(d,h){this.errorCount++,this.fireError(d,h,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=f}}),ow=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r +`,a=class{static{i(this,"AbstractMessageBuffer")}constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,l=0,c=0,u=0;e:for(;lthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],f=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,f}const o=this.allocNative(s);let l=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const f=u.slice(0,s);o.set(f,l),l+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,l),l+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}};e.AbstractMessageBuffer=a}}),lw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=Nn(),r=_s(),n=wg(),a=Ng(),s=Ka(),o=Al(),l;(function(g){g.type=new n.NotificationType("$/cancelRequest")})(l||(l={}));var c;(function(g){function E(T){return typeof T=="string"||typeof T=="number"}i(E,"is"),g.is=E})(c||(e.ProgressToken=c={}));var u;(function(g){g.type=new n.NotificationType("$/progress")})(u||(u={}));var f=class{static{i(this,"ProgressType")}constructor(){}};e.ProgressType=f;var d;(function(g){function E(T){return r.func(T)}i(E,"is"),g.is=E})(d||(d={})),e.NullLogger=Object.freeze({error:i(()=>{},"error"),warn:i(()=>{},"warn"),info:i(()=>{},"info"),log:i(()=>{},"log")});var h;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(h||(e.Trace=h={}));var y;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(y||(e.TraceValues=y={})),(function(g){function E(R){if(!r.string(R))return g.Off;switch(R=R.toLowerCase(),R){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}i(E,"fromString"),g.fromString=E;function T(R){switch(R){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}i(T,"toString"),g.toString=T})(h||(e.Trace=h={}));var v;(function(g){g.Text="text",g.JSON="json"})(v||(e.TraceFormat=v={})),(function(g){function E(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?g.JSON:g.Text):g.Text}i(E,"fromString"),g.fromString=E})(v||(e.TraceFormat=v={}));var C;(function(g){g.type=new n.NotificationType("$/setTrace")})(C||(e.SetTraceNotification=C={}));var b;(function(g){g.type=new n.NotificationType("$/logTrace")})(b||(e.LogTraceNotification=b={}));var w;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(w||(e.ConnectionErrors=w={}));var I=class Pg extends Error{static{i(this,"ConnectionError")}constructor(E,T){super(T),this.code=E,Object.setPrototypeOf(this,Pg.prototype)}};e.ConnectionError=I;var A;(function(g){function E(T){const R=T;return R&&r.func(R.cancelUndispatched)}i(E,"is"),g.is=E})(A||(e.ConnectionStrategy=A={}));var k;(function(g){function E(T){const R=T;return R&&(R.kind===void 0||R.kind==="id")&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}i(E,"is"),g.is=E})(k||(e.IdCancellationReceiverStrategy=k={}));var G;(function(g){function E(T){const R=T;return R&&R.kind==="request"&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}i(E,"is"),g.is=E})(G||(e.RequestCancellationReceiverStrategy=G={}));var H;(function(g){g.Message=Object.freeze({createCancellationTokenSource(T){return new o.CancellationTokenSource}});function E(T){return k.is(T)||G.is(T)}i(E,"is"),g.is=E})(H||(e.CancellationReceiverStrategy=H={}));var X;(function(g){g.Message=Object.freeze({sendCancellation(T,R){return T.sendNotification(l.type,{id:R})},cleanup(T){}});function E(T){const R=T;return R&&r.func(R.sendCancellation)&&r.func(R.cleanup)}i(E,"is"),g.is=E})(X||(e.CancellationSenderStrategy=X={}));var le;(function(g){g.Message=Object.freeze({receiver:H.Message,sender:X.Message});function E(T){const R=T;return R&&H.is(R.receiver)&&X.is(R.sender)}i(E,"is"),g.is=E})(le||(e.CancellationStrategy=le={}));var ce;(function(g){function E(T){const R=T;return R&&r.func(R.handleMessage)}i(E,"is"),g.is=E})(ce||(e.MessageStrategy=ce={}));var Ne;(function(g){function E(T){const R=T;return R&&(le.is(R.cancellationStrategy)||A.is(R.connectionStrategy)||ce.is(R.messageStrategy))}i(E,"is"),g.is=E})(Ne||(e.ConnectionOptions=Ne={}));var P;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(P||(P={}));function _(g,E,T,R){const S=T!==void 0?T:e.NullLogger;let O=0,M=0,D=0;const z="2.0";let B;const Z=new Map;let J;const te=new Map,fe=new Map;let ct,Re=new a.LinkedMap,Oe=new Map,qe=new Set,Se=new Map,Q=h.Off,rt=v.Text,me,Nt=P.New;const Jn=new s.Emitter,ti=new s.Emitter,ri=new s.Emitter,ni=new s.Emitter,ai=new s.Emitter,kt=R&&R.cancellationStrategy?R.cancellationStrategy:le.Message;function Zn(m){if(m===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+m.toString()}i(Zn,"createRequestQueueKey");function ii(m){return m===null?"res-unknown-"+(++D).toString():"res-"+m.toString()}i(ii,"createResponseQueueKey");function si(){return"not-"+(++M).toString()}i(si,"createNotificationQueueKey");function oi(m,N){n.Message.isRequest(N)?m.set(Zn(N.id),N):n.Message.isResponse(N)?m.set(ii(N.id),N):m.set(si(),N)}i(oi,"addMessageToQueue");function li(m){}i(li,"cancelUndispatched");function Qn(){return Nt===P.Listening}i(Qn,"isListening");function ea(){return Nt===P.Closed}i(ea,"isClosed");function zt(){return Nt===P.Disposed}i(zt,"isDisposed");function ta(){(Nt===P.New||Nt===P.Listening)&&(Nt=P.Closed,ti.fire(void 0))}i(ta,"closeHandler");function ci(m){Jn.fire([m,void 0,void 0])}i(ci,"readErrorHandler");function ui(m){Jn.fire(m)}i(ui,"writeErrorHandler"),g.onClose(ta),g.onError(ci),E.onClose(ta),E.onError(ui);function ra(){ct||Re.size===0||(ct=(0,t.default)().timer.setImmediate(()=>{ct=void 0,fi()}))}i(ra,"triggerMessageQueue");function na(m){n.Message.isRequest(m)?di(m):n.Message.isNotification(m)?hi(m):n.Message.isResponse(m)?pi(m):mi(m)}i(na,"handleMessage");function fi(){if(Re.size===0)return;const m=Re.shift();try{const N=R?.messageStrategy;ce.is(N)?N.handleMessage(m,na):na(m)}finally{ra()}}i(fi,"processMessageQueue");const Ks=i(m=>{try{if(n.Message.isNotification(m)&&m.method===l.type.method){const N=m.params.id,L=Zn(N),x=Re.get(L);if(n.Message.isRequest(x)){const ue=R?.connectionStrategy,be=ue&&ue.cancelUndispatched?ue.cancelUndispatched(x,li):void 0;if(be&&(be.error!==void 0||be.result!==void 0)){Re.delete(L),Se.delete(N),be.id=x.id,kr(be,m.method,Date.now()),E.write(be).catch(()=>S.error("Sending response for canceled message failed."));return}}const ge=Se.get(N);if(ge!==void 0){ge.cancel(),Hr(m);return}else qe.add(N)}oi(Re,m)}finally{ra()}},"callback");function di(m){if(zt())return;function N(re,Ee,se){const De={jsonrpc:z,id:m.id};re instanceof n.ResponseError?De.error=re.toJson():De.result=re===void 0?null:re,kr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(N,"reply");function L(re,Ee,se){const De={jsonrpc:z,id:m.id,error:re.toJson()};kr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(L,"replyError");function x(re,Ee,se){re===void 0&&(re=null);const De={jsonrpc:z,id:m.id,result:re};kr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(x,"replySuccess"),vi(m);const ge=Z.get(m.method);let ue,be;ge&&(ue=ge.type,be=ge.handler);const ke=Date.now();if(be||B){const re=m.id??String(Date.now()),Ee=k.is(kt.receiver)?kt.receiver.createCancellationTokenSource(re):kt.receiver.createCancellationTokenSource(m);m.id!==null&&qe.has(m.id)&&Ee.cancel(),m.id!==null&&Se.set(re,Ee);try{let se;if(be)if(m.params===void 0){if(ue!==void 0&&ue.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines ${ue.numberOfParams} params but received none.`),m.method,ke);return}se=be(Ee.token)}else if(Array.isArray(m.params)){if(ue!==void 0&&ue.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by name but received parameters by position`),m.method,ke);return}se=be(...m.params,Ee.token)}else{if(ue!==void 0&&ue.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by position but received parameters by name`),m.method,ke);return}se=be(m.params,Ee.token)}else B&&(se=B(m.method,m.params,Ee.token));const De=se;se?De.then?De.then(We=>{Se.delete(re),N(We,m.method,ke)},We=>{Se.delete(re),We instanceof n.ResponseError?L(We,m.method,ke):We&&r.string(We.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${We.message}`),m.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,ke)}):(Se.delete(re),N(se,m.method,ke)):(Se.delete(re),x(se,m.method,ke))}catch(se){Se.delete(re),se instanceof n.ResponseError?N(se,m.method,ke):se&&r.string(se.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${se.message}`),m.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,ke)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${m.method}`),m.method,ke)}i(di,"handleRequest");function pi(m){if(!zt())if(m.id===null)m.error?S.error(`Received response message without id: Error is: +${JSON.stringify(m.error,void 0,4)}`):S.error("Received response message without id. No further error information provided.");else{const N=m.id,L=Oe.get(N);if(Ti(m,L),L!==void 0){Oe.delete(N);try{if(m.error){const x=m.error;L.reject(new n.ResponseError(x.code,x.message,x.data))}else if(m.result!==void 0)L.resolve(m.result);else throw new Error("Should never happen.")}catch(x){x.message?S.error(`Response handler '${L.method}' failed with message: ${x.message}`):S.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}i(pi,"handleResponse");function hi(m){if(zt())return;let N,L;if(m.method===l.type.method){const x=m.params.id;qe.delete(x),Hr(m);return}else{const x=te.get(m.method);x&&(L=x.handler,N=x.type)}if(L||J)try{if(Hr(m),L)if(m.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==n.ParameterStructures.byName&&S.error(`Notification ${m.method} defines ${N.numberOfParams} params but received none.`),L();else if(Array.isArray(m.params)){const x=m.params;m.method===u.type.method&&x.length===2&&c.is(x[0])?L({token:x[0],value:x[1]}):(N!==void 0&&(N.parameterStructures===n.ParameterStructures.byName&&S.error(`Notification ${m.method} defines parameters by name but received parameters by position`),N.numberOfParams!==m.params.length&&S.error(`Notification ${m.method} defines ${N.numberOfParams} params but received ${x.length} arguments`)),L(...x))}else N!==void 0&&N.parameterStructures===n.ParameterStructures.byPosition&&S.error(`Notification ${m.method} defines parameters by position but received parameters by name`),L(m.params);else J&&J(m.method,m.params)}catch(x){x.message?S.error(`Notification handler '${m.method}' failed with message: ${x.message}`):S.error(`Notification handler '${m.method}' failed unexpectedly.`)}else ri.fire(m)}i(hi,"handleNotification");function mi(m){if(!m){S.error("Received empty message.");return}S.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(m,null,4)}`);const N=m;if(r.string(N.id)||r.number(N.id)){const L=N.id,x=Oe.get(L);x&&x.reject(new Error("The received response has neither a result nor an error property."))}}i(mi,"handleInvalidMessage");function $t(m){if(m!=null)switch(Q){case h.Verbose:return JSON.stringify(m,null,4);case h.Compact:return JSON.stringify(m);default:return}}i($t,"stringifyTrace");function gi(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&m.params&&(N=`Params: ${$t(m.params)} + +`),me.log(`Sending request '${m.method} - (${m.id})'.`,N)}else Bt("send-request",m)}i(gi,"traceSendingRequest");function yi(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&(m.params?N=`Params: ${$t(m.params)} + +`:N=`No parameters provided. + +`),me.log(`Sending notification '${m.method}'.`,N)}else Bt("send-notification",m)}i(yi,"traceSendingNotification");function kr(m,N,L){if(!(Q===h.Off||!me))if(rt===v.Text){let x;(Q===h.Verbose||Q===h.Compact)&&(m.error&&m.error.data?x=`Error data: ${$t(m.error.data)} + +`:m.result?x=`Result: ${$t(m.result)} + +`:m.error===void 0&&(x=`No result returned. + +`)),me.log(`Sending response '${N} - (${m.id})'. Processing request took ${Date.now()-L}ms`,x)}else Bt("send-response",m)}i(kr,"traceSendingResponse");function vi(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&m.params&&(N=`Params: ${$t(m.params)} + +`),me.log(`Received request '${m.method} - (${m.id})'.`,N)}else Bt("receive-request",m)}i(vi,"traceReceivedRequest");function Hr(m){if(!(Q===h.Off||!me||m.method===b.type.method))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&(m.params?N=`Params: ${$t(m.params)} + +`:N=`No parameters provided. + +`),me.log(`Received notification '${m.method}'.`,N)}else Bt("receive-notification",m)}i(Hr,"traceReceivedNotification");function Ti(m,N){if(!(Q===h.Off||!me))if(rt===v.Text){let L;if((Q===h.Verbose||Q===h.Compact)&&(m.error&&m.error.data?L=`Error data: ${$t(m.error.data)} + +`:m.result?L=`Result: ${$t(m.result)} + +`:m.error===void 0&&(L=`No result returned. + +`)),N){const x=m.error?` Request failed: ${m.error.message} (${m.error.code}).`:"";me.log(`Received response '${N.method} - (${m.id})' in ${Date.now()-N.timerStart}ms.${x}`,L)}else me.log(`Received response ${m.id} without active response promise.`,L)}else Bt("receive-response",m)}i(Ti,"traceReceivedResponse");function Bt(m,N){if(!me||Q===h.Off)return;const L={isLSPMessage:!0,type:m,message:N,timestamp:Date.now()};me.log(L)}i(Bt,"logLSPMessage");function or(){if(ea())throw new I(w.Closed,"Connection is closed.");if(zt())throw new I(w.Disposed,"Connection is disposed.")}i(or,"throwIfClosedOrDisposed");function Ri(){if(Qn())throw new I(w.AlreadyListening,"Connection is already listening")}i(Ri,"throwIfListening");function $i(){if(!Qn())throw new Error("Call listen() first.")}i($i,"throwIfNotListening");function lr(m){return m===void 0?null:m}i(lr,"undefinedToNull");function aa(m){if(m!==null)return m}i(aa,"nullToUndefined");function p(m){return m!=null&&!Array.isArray(m)&&typeof m=="object"}i(p,"isNamedParam");function ae(m,N){switch(m){case n.ParameterStructures.auto:return p(N)?aa(N):[lr(N)];case n.ParameterStructures.byName:if(!p(N))throw new Error("Received parameters by name but param is not an object literal.");return aa(N);case n.ParameterStructures.byPosition:return[lr(N)];default:throw new Error(`Unknown parameter structure ${m.toString()}`)}}i(ae,"computeSingleParam");function $e(m,N){let L;const x=m.numberOfParams;switch(x){case 0:L=void 0;break;case 1:L=ae(m.parameterStructures,N[0]);break;default:L=[];for(let ge=0;ge{or();let L,x;if(r.string(m)){L=m;const ue=N[0];let be=0,ke=n.ParameterStructures.auto;n.ParameterStructures.is(ue)&&(be=1,ke=ue);let re=N.length;const Ee=re-be;switch(Ee){case 0:x=void 0;break;case 1:x=ae(ke,N[be]);break;default:if(ke===n.ParameterStructures.byName)throw new Error(`Received ${Ee} parameters for 'by Name' notification parameter structure.`);x=N.slice(be,re).map(se=>lr(se));break}}else{const ue=N;L=m.method,x=$e(m,ue)}const ge={jsonrpc:z,method:L,params:x};return yi(ge),E.write(ge).catch(ue=>{throw S.error("Sending notification failed."),ue})},"sendNotification"),onNotification:i((m,N)=>{or();let L;return r.func(m)?J=m:N&&(r.string(m)?(L=m,te.set(m,{type:void 0,handler:N})):(L=m.method,te.set(m.method,{type:m,handler:N}))),{dispose:i(()=>{L!==void 0?te.delete(L):J=void 0},"dispose")}},"onNotification"),onProgress:i((m,N,L)=>{if(fe.has(N))throw new Error(`Progress handler for token ${N} already registered`);return fe.set(N,L),{dispose:i(()=>{fe.delete(N)},"dispose")}},"onProgress"),sendProgress:i((m,N,L)=>W.sendNotification(u.type,{token:N,value:L}),"sendProgress"),onUnhandledProgress:ni.event,sendRequest:i((m,...N)=>{or(),$i();let L,x,ge;if(r.string(m)){L=m;const re=N[0],Ee=N[N.length-1];let se=0,De=n.ParameterStructures.auto;n.ParameterStructures.is(re)&&(se=1,De=re);let We=N.length;o.CancellationToken.is(Ee)&&(We=We-1,ge=Ee);const Kt=We-se;switch(Kt){case 0:x=void 0;break;case 1:x=ae(De,N[se]);break;default:if(De===n.ParameterStructures.byName)throw new Error(`Received ${Kt} parameters for 'by Name' request parameter structure.`);x=N.slice(se,We).map(Jb=>lr(Jb));break}}else{const re=N;L=m.method,x=$e(m,re);const Ee=m.numberOfParams;ge=o.CancellationToken.is(re[Ee])?re[Ee]:void 0}const ue=O++;let be;ge&&(be=ge.onCancellationRequested(()=>{const re=kt.sender.sendCancellation(W,ue);return re===void 0?(S.log(`Received no promise from cancellation strategy when cancelling id ${ue}`),Promise.resolve()):re.catch(()=>{S.log(`Sending cancellation messages for id ${ue} failed`)})}));const ke={jsonrpc:z,id:ue,method:L,params:x};return gi(ke),typeof kt.sender.enableCancellation=="function"&&kt.sender.enableCancellation(ke),new Promise(async(re,Ee)=>{const se=i(Kt=>{re(Kt),kt.sender.cleanup(ue),be?.dispose()},"resolveWithCleanup"),De=i(Kt=>{Ee(Kt),kt.sender.cleanup(ue),be?.dispose()},"rejectWithCleanup"),We={method:L,timerStart:Date.now(),resolve:se,reject:De};try{await E.write(ke),Oe.set(ue,We)}catch(Kt){throw S.error("Sending request failed."),We.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Kt.message?Kt.message:"Unknown reason")),Kt}})},"sendRequest"),onRequest:i((m,N)=>{or();let L=null;return d.is(m)?(L=void 0,B=m):r.string(m)?(L=null,N!==void 0&&(L=m,Z.set(m,{handler:N,type:void 0}))):N!==void 0&&(L=m.method,Z.set(m.method,{type:m,handler:N})),{dispose:i(()=>{L!==null&&(L!==void 0?Z.delete(L):B=void 0)},"dispose")}},"onRequest"),hasPendingResponse:i(()=>Oe.size>0,"hasPendingResponse"),trace:i(async(m,N,L)=>{let x=!1,ge=v.Text;L!==void 0&&(r.boolean(L)?x=L:(x=L.sendNotification||!1,ge=L.traceFormat||v.Text)),Q=m,rt=ge,Q===h.Off?me=void 0:me=N,x&&!ea()&&!zt()&&await W.sendNotification(C.type,{value:h.toString(m)})},"trace"),onError:Jn.event,onClose:ti.event,onUnhandledNotification:ri.event,onDispose:ai.event,end:i(()=>{E.end()},"end"),dispose:i(()=>{if(zt())return;Nt=P.Disposed,ai.fire(void 0);const m=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const N of Oe.values())N.reject(m);Oe=new Map,Se=new Map,qe=new Set,Re=new a.LinkedMap,r.func(E.dispose)&&E.dispose(),r.func(g.dispose)&&g.dispose()},"dispose"),listen:i(()=>{or(),Ri(),Nt=P.Listening,g.listen(Ks)},"listen"),inspect:i(()=>{(0,t.default)().console.log("inspect")},"inspect")};return W.onNotification(b.type,m=>{if(Q===h.Off||!me)return;const N=Q===h.Verbose||Q===h.Compact;me.log(m.message,N?m.verbose:void 0)}),W.onNotification(u.type,m=>{const N=fe.get(m.token);N?N(m.value):ni.fire(m)}),W}i(_,"createMessageConnection"),e.createMessageConnection=_}}),Qu=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=wg();Object.defineProperty(e,"Message",{enumerable:!0,get:i(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:i(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:i(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:i(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:i(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:i(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:i(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:i(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:i(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:i(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:i(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:i(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:i(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:i(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:i(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:i(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:i(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:i(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:i(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:i(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:i(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:i(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:i(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:i(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:i(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:i(function(){return t.ParameterStructures},"get")});var r=Ng();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:i(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:i(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:i(function(){return r.Touch},"get")});var n=nw();Object.defineProperty(e,"Disposable",{enumerable:!0,get:i(function(){return n.Disposable},"get")});var a=Ka();Object.defineProperty(e,"Event",{enumerable:!0,get:i(function(){return a.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:i(function(){return a.Emitter},"get")});var s=Al();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:i(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:i(function(){return s.CancellationToken},"get")});var o=aw();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:i(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:i(function(){return o.SharedArrayReceiverStrategy},"get")});var l=iw();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:i(function(){return l.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:i(function(){return l.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:i(function(){return l.ReadableStreamMessageReader},"get")});var c=sw();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:i(function(){return c.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:i(function(){return c.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:i(function(){return c.WriteableStreamMessageWriter},"get")});var u=ow();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:i(function(){return u.AbstractMessageBuffer},"get")});var f=lw();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:i(function(){return f.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:i(function(){return f.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:i(function(){return f.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:i(function(){return f.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:i(function(){return f.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:i(function(){return f.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:i(function(){return f.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:i(function(){return f.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:i(function(){return f.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:i(function(){return f.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:i(function(){return f.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:i(function(){return f.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:i(function(){return f.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:i(function(){return f.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:i(function(){return f.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:i(function(){return f.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:i(function(){return f.MessageStrategy},"get")});var d=Nn();e.RAL=d.default}}),cw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Qu(),r=class Og extends t.AbstractMessageBuffer{static{i(this,"MessageBuffer")}constructor(u="utf-8"){super(u),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Og.emptyBuffer}fromString(u,f){return new TextEncoder().encode(u)}toString(u,f){return f==="ascii"?this.asciiDecoder.decode(u):new TextDecoder(f).decode(u)}asNative(u,f){return f===void 0?u:u.slice(0,f)}allocNative(u){return new Uint8Array(u)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{i(this,"ReadableStreamWrapper")}constructor(c){this.socket=c,this._onData=new t.Emitter,this._messageListener=u=>{u.data.arrayBuffer().then(d=>{this._onData.fire(new Uint8Array(d))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}onData(c){return this._onData.event(c)}},a=class{static{i(this,"WritableStreamWrapper")}constructor(c){this.socket=c}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}write(c,u){if(typeof c=="string"){if(u!==void 0&&u!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`);this.socket.send(c)}else this.socket.send(c);return Promise.resolve()}end(){this.socket.close()}},s=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:i(c=>new r(c),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:i((c,u)=>{if(u.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`);return Promise.resolve(s.encode(JSON.stringify(c,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:i((c,u)=>{if(!(c instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(c)))},"decode")})}),stream:Object.freeze({asReadableStream:i(c=>new n(c),"asReadableStream"),asWritableStream:i(c=>new a(c),"asWritableStream")}),console,timer:Object.freeze({setTimeout(c,u,...f){const d=setTimeout(c,u,...f);return{dispose:i(()=>clearTimeout(d),"dispose")}},setImmediate(c,...u){const f=setTimeout(c,0,...u);return{dispose:i(()=>clearTimeout(f),"dispose")}},setInterval(c,u,...f){const d=setInterval(c,u,...f);return{dispose:i(()=>clearInterval(d),"dispose")}}})});function l(){return o}i(l,"RIL"),(function(c){function u(){t.RAL.install(o)}i(u,"install"),c.install=u})(l||(l={})),e.default=l}}),qa=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(c,u,f,d){d===void 0&&(d=f);var h=Object.getOwnPropertyDescriptor(u,f);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:i(function(){return u[f]},"get")}),Object.defineProperty(c,d,h)}):(function(c,u,f,d){d===void 0&&(d=f),c[d]=u[f]})),r=e&&e.__exportStar||function(c,u){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=cw();n.default.install();var a=Qu();r(Qu(),e);var s=class extends a.AbstractMessageReader{static{i(this,"BrowserMessageReader")}constructor(c){super(),this._onData=new a.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}};e.BrowserMessageReader=s;var o=class extends a.AbstractMessageWriter{static{i(this,"BrowserMessageWriter")}constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function l(c,u,f,d){return f===void 0&&(f=a.NullLogger),a.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,a.createMessageConnection)(c,u,f,d)}i(l,"createMessageConnection"),e.createMessageConnection=l}}),Mh=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){t.exports=qa()}}),Ce=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=qa(),r;(function(c){c.clientToServer="clientToServer",c.serverToClient="serverToClient",c.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{i(this,"RegistrationType")}constructor(c){this.method=c}};e.RegistrationType=n;var a=class extends t.RequestType0{static{i(this,"ProtocolRequestType0")}constructor(c){super(c)}};e.ProtocolRequestType0=a;var s=class extends t.RequestType{static{i(this,"ProtocolRequestType")}constructor(c){super(c,t.ParameterStructures.byName)}};e.ProtocolRequestType=s;var o=class extends t.NotificationType0{static{i(this,"ProtocolNotificationType0")}constructor(c){super(c)}};e.ProtocolNotificationType0=o;var l=class extends t.NotificationType{static{i(this,"ProtocolNotificationType")}constructor(c){super(c,t.ParameterStructures.byName)}};e.ProtocolNotificationType=l}}),Qf=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(f){return f===!0||f===!1}i(t,"boolean"),e.boolean=t;function r(f){return typeof f=="string"||f instanceof String}i(r,"string"),e.string=r;function n(f){return typeof f=="number"||f instanceof Number}i(n,"number"),e.number=n;function a(f){return f instanceof Error}i(a,"error"),e.error=a;function s(f){return typeof f=="function"}i(s,"func"),e.func=s;function o(f){return Array.isArray(f)}i(o,"array"),e.array=o;function l(f){return o(f)&&f.every(d=>r(d))}i(l,"stringArray"),e.stringArray=l;function c(f,d){return Array.isArray(f)&&f.every(d)}i(c,"typedArray"),e.typedArray=c;function u(f){return f!==null&&typeof f=="object"}i(u,"objectLiteral"),e.objectLiteral=u}}),uw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),fw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),dw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ce(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),pw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ce(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),hw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.ColorPresentationRequest=n={}))}}),mw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),gw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),yw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),vw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=qa(),r=Ce(),n;(function(o){o.type=new t.ProgressType;function l(c){return c===o.type}i(l,"is"),o.is=l})(n||(e.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(e.WorkDoneProgressCreateRequest=a={}));var s;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(s||(e.WorkDoneProgressCancelNotification=s={}))}}),Tw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var a;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.CallHierarchyOutgoingCallsRequest=a={}))}}),Rw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ce(),r;(function(c){c.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(c){c.method="textDocument/semanticTokens",c.type=new t.RegistrationType(c.method)})(n||(e.SemanticTokensRegistrationType=n={}));var a;(function(c){c.method="textDocument/semanticTokens/full",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(a||(e.SemanticTokensRequest=a={}));var s;(function(c){c.method="textDocument/semanticTokens/full/delta",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(s||(e.SemanticTokensDeltaRequest=s={}));var o;(function(c){c.method="textDocument/semanticTokens/range",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var l;(function(c){c.method="workspace/semanticTokens/refresh",c.messageDirection=t.MessageDirection.serverToClient,c.type=new t.ProtocolRequestType0(c.method)})(l||(e.SemanticTokensRefreshRequest=l={}))}}),$w=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ce(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),Aw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),Ew=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Ce(),r;(function(u){u.file="file",u.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(e.WillCreateFilesRequest=n={}));var a;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(a||(e.DidCreateFilesNotification=a={}));var s;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(s||(e.WillRenameFilesRequest=s={}));var o;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(o||(e.DidRenameFilesNotification=o={}));var l;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(l||(e.DidDeleteFilesNotification=l={}));var c;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(c||(e.WillDeleteFilesRequest=c={}))}}),_w=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ce(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(e.MonikerKind=n={}));var a;(function(s){s.method="textDocument/moniker",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.MonikerRequest=a={}))}}),Cw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var a;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.TypeHierarchySubtypesRequest=a={}))}}),Sw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),bw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.InlayHintResolveRequest=n={}));var a;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)})(a||(e.InlayHintRefreshRequest=a={}))}}),ww=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=qa(),r=Qf(),n=Ce(),a;(function(u){function f(d){const h=d;return h&&r.boolean(h.retriggerRequest)}i(f,"is"),u.is=f})(a||(e.DiagnosticServerCancellationData=a={}));var s;(function(u){u.Full="full",u.Unchanged="unchanged"})(s||(e.DocumentDiagnosticReportKind=s={}));var o;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(l||(e.WorkspaceDiagnosticRequest=l={}));var c;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(c||(e.DiagnosticRefreshRequest=c={}))}}),Iw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(Es(),Zf($l)),r=Qf(),n=Ce(),a;(function(v){v.Markup=1,v.Code=2;function C(b){return b===1||b===2}i(C,"is"),v.is=C})(a||(e.NotebookCellKind=a={}));var s;(function(v){function C(I,A){const k={executionOrder:I};return(A===!0||A===!1)&&(k.success=A),k}i(C,"create"),v.create=C;function b(I){const A=I;return r.objectLiteral(A)&&t.uinteger.is(A.executionOrder)&&(A.success===void 0||r.boolean(A.success))}i(b,"is"),v.is=b;function w(I,A){return I===A?!0:I==null||A===null||A===void 0?!1:I.executionOrder===A.executionOrder&&I.success===A.success}i(w,"equals"),v.equals=w})(s||(e.ExecutionSummary=s={}));var o;(function(v){function C(A,k){return{kind:A,document:k}}i(C,"create"),v.create=C;function b(A){const k=A;return r.objectLiteral(k)&&a.is(k.kind)&&t.DocumentUri.is(k.document)&&(k.metadata===void 0||r.objectLiteral(k.metadata))}i(b,"is"),v.is=b;function w(A,k){const G=new Set;return A.document!==k.document&&G.add("document"),A.kind!==k.kind&&G.add("kind"),A.executionSummary!==k.executionSummary&&G.add("executionSummary"),(A.metadata!==void 0||k.metadata!==void 0)&&!I(A.metadata,k.metadata)&&G.add("metadata"),(A.executionSummary!==void 0||k.executionSummary!==void 0)&&!s.equals(A.executionSummary,k.executionSummary)&&G.add("executionSummary"),G}i(w,"diff"),v.diff=w;function I(A,k){if(A===k)return!0;if(A==null||k===null||k===void 0||typeof A!=typeof k||typeof A!="object")return!1;const G=Array.isArray(A),H=Array.isArray(k);if(G!==H)return!1;if(G&&H){if(A.length!==k.length)return!1;for(let X=0;X0}i(ae,"hasId"),p.hasId=ae})(O||(e.StaticRegistrationOptions=O={}));var M;(function(p){function ae($e){const W=$e;return W&&(W.documentSelector===null||_.is(W.documentSelector))}i(ae,"is"),p.is=ae})(M||(e.TextDocumentRegistrationOptions=M={}));var D;(function(p){function ae(W){const m=W;return n.objectLiteral(m)&&(m.workDoneProgress===void 0||n.boolean(m.workDoneProgress))}i(ae,"is"),p.is=ae;function $e(W){const m=W;return m&&n.boolean(m.workDoneProgress)}i($e,"hasWorkDoneProgress"),p.hasWorkDoneProgress=$e})(D||(e.WorkDoneProgressOptions=D={}));var z;(function(p){p.method="initialize",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(z||(e.InitializeRequest=z={}));var B;(function(p){p.unknownProtocolVersion=1})(B||(e.InitializeErrorCodes=B={}));var Z;(function(p){p.method="initialized",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Z||(e.InitializedNotification=Z={}));var J;(function(p){p.method="shutdown",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType0(p.method)})(J||(e.ShutdownRequest=J={}));var te;(function(p){p.method="exit",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType0(p.method)})(te||(e.ExitNotification=te={}));var fe;(function(p){p.method="workspace/didChangeConfiguration",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(fe||(e.DidChangeConfigurationNotification=fe={}));var ct;(function(p){p.Error=1,p.Warning=2,p.Info=3,p.Log=4,p.Debug=5})(ct||(e.MessageType=ct={}));var Re;(function(p){p.method="window/showMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Re||(e.ShowMessageNotification=Re={}));var Oe;(function(p){p.method="window/showMessageRequest",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType(p.method)})(Oe||(e.ShowMessageRequest=Oe={}));var qe;(function(p){p.method="window/logMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(qe||(e.LogMessageNotification=qe={}));var Se;(function(p){p.method="telemetry/event",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Se||(e.TelemetryEventNotification=Se={}));var Q;(function(p){p.None=0,p.Full=1,p.Incremental=2})(Q||(e.TextDocumentSyncKind=Q={}));var rt;(function(p){p.method="textDocument/didOpen",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(rt||(e.DidOpenTextDocumentNotification=rt={}));var me;(function(p){function ae(W){let m=W;return m!=null&&typeof m.text=="string"&&m.range!==void 0&&(m.rangeLength===void 0||typeof m.rangeLength=="number")}i(ae,"isIncremental"),p.isIncremental=ae;function $e(W){let m=W;return m!=null&&typeof m.text=="string"&&m.range===void 0&&m.rangeLength===void 0}i($e,"isFull"),p.isFull=$e})(me||(e.TextDocumentContentChangeEvent=me={}));var Nt;(function(p){p.method="textDocument/didChange",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Nt||(e.DidChangeTextDocumentNotification=Nt={}));var Jn;(function(p){p.method="textDocument/didClose",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Jn||(e.DidCloseTextDocumentNotification=Jn={}));var ti;(function(p){p.method="textDocument/didSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ti||(e.DidSaveTextDocumentNotification=ti={}));var ri;(function(p){p.Manual=1,p.AfterDelay=2,p.FocusOut=3})(ri||(e.TextDocumentSaveReason=ri={}));var ni;(function(p){p.method="textDocument/willSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ni||(e.WillSaveTextDocumentNotification=ni={}));var ai;(function(p){p.method="textDocument/willSaveWaitUntil",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ai||(e.WillSaveTextDocumentWaitUntilRequest=ai={}));var kt;(function(p){p.method="workspace/didChangeWatchedFiles",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(kt||(e.DidChangeWatchedFilesNotification=kt={}));var Zn;(function(p){p.Created=1,p.Changed=2,p.Deleted=3})(Zn||(e.FileChangeType=Zn={}));var ii;(function(p){function ae($e){const W=$e;return n.objectLiteral(W)&&(r.URI.is(W.baseUri)||r.WorkspaceFolder.is(W.baseUri))&&n.string(W.pattern)}i(ae,"is"),p.is=ae})(ii||(e.RelativePattern=ii={}));var si;(function(p){p.Create=1,p.Change=2,p.Delete=4})(si||(e.WatchKind=si={}));var oi;(function(p){p.method="textDocument/publishDiagnostics",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(oi||(e.PublishDiagnosticsNotification=oi={}));var li;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.TriggerForIncompleteCompletions=3})(li||(e.CompletionTriggerKind=li={}));var Qn;(function(p){p.method="textDocument/completion",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Qn||(e.CompletionRequest=Qn={}));var ea;(function(p){p.method="completionItem/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ea||(e.CompletionResolveRequest=ea={}));var zt;(function(p){p.method="textDocument/hover",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(zt||(e.HoverRequest=zt={}));var ta;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.ContentChange=3})(ta||(e.SignatureHelpTriggerKind=ta={}));var ci;(function(p){p.method="textDocument/signatureHelp",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ci||(e.SignatureHelpRequest=ci={}));var ui;(function(p){p.method="textDocument/definition",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ui||(e.DefinitionRequest=ui={}));var ra;(function(p){p.method="textDocument/references",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ra||(e.ReferencesRequest=ra={}));var na;(function(p){p.method="textDocument/documentHighlight",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(na||(e.DocumentHighlightRequest=na={}));var fi;(function(p){p.method="textDocument/documentSymbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(fi||(e.DocumentSymbolRequest=fi={}));var Ks;(function(p){p.method="textDocument/codeAction",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ks||(e.CodeActionRequest=Ks={}));var di;(function(p){p.method="codeAction/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(di||(e.CodeActionResolveRequest=di={}));var pi;(function(p){p.method="workspace/symbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(pi||(e.WorkspaceSymbolRequest=pi={}));var hi;(function(p){p.method="workspaceSymbol/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(hi||(e.WorkspaceSymbolResolveRequest=hi={}));var mi;(function(p){p.method="textDocument/codeLens",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(mi||(e.CodeLensRequest=mi={}));var $t;(function(p){p.method="codeLens/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($t||(e.CodeLensResolveRequest=$t={}));var gi;(function(p){p.method="workspace/codeLens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(gi||(e.CodeLensRefreshRequest=gi={}));var yi;(function(p){p.method="textDocument/documentLink",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(yi||(e.DocumentLinkRequest=yi={}));var kr;(function(p){p.method="documentLink/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(kr||(e.DocumentLinkResolveRequest=kr={}));var vi;(function(p){p.method="textDocument/formatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(vi||(e.DocumentFormattingRequest=vi={}));var Hr;(function(p){p.method="textDocument/rangeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Hr||(e.DocumentRangeFormattingRequest=Hr={}));var Ti;(function(p){p.method="textDocument/rangesFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ti||(e.DocumentRangesFormattingRequest=Ti={}));var Bt;(function(p){p.method="textDocument/onTypeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Bt||(e.DocumentOnTypeFormattingRequest=Bt={}));var or;(function(p){p.Identifier=1})(or||(e.PrepareSupportDefaultBehavior=or={}));var Ri;(function(p){p.method="textDocument/rename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ri||(e.RenameRequest=Ri={}));var $i;(function(p){p.method="textDocument/prepareRename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($i||(e.PrepareRenameRequest=$i={}));var lr;(function(p){p.method="workspace/executeCommand",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(lr||(e.ExecuteCommandRequest=lr={}));var aa;(function(p){p.method="workspace/applyEdit",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType("workspace/applyEdit")})(aa||(e.ApplyWorkspaceEditRequest=aa={}))}}),Pw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=qa();function r(n,a,s,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,a,s,o)}i(r,"createProtocolConnection"),e.createProtocolConnection=r}}),Ow=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(o,l);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,c,u)}):(function(s,o,l,c){c===void 0&&(c=l),s[c]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(qa(),e),r((Es(),Zf($l)),e),r(Ce(),e),r(kw(),e);var n=Pw();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:i(function(){return n.createProtocolConnection},"get")});var a;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))}}),Lw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(o,l);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,c,u)}):(function(s,o,l,c){c===void 0&&(c=l),s[c]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=Mh();r(Mh(),e),r(Ow(),e);function a(s,o,l,c){return(0,n.createMessageConnection)(s,o,l,c)}i(a,"createProtocolConnection"),e.createProtocolConnection=a}}),Lg={};Br(Lg,{AbstractAstReflection:()=>rd,AbstractCstNode:()=>ah,AbstractLangiumParser:()=>sh,AbstractParserErrorMessageProvider:()=>_S,AbstractThreadedAsyncParser:()=>aF,AstUtils:()=>nd,BiMap:()=>gl,Cancellation:()=>pe,CompositeCstNodeImpl:()=>vc,ContextCache:()=>Cc,CstNodeBuilder:()=>RS,CstUtils:()=>ed,DEFAULT_TOKENIZE_OPTIONS:()=>_h,DONE_RESULT:()=>Ve,DatatypeSymbol:()=>dl,DefaultAstNodeDescriptionProvider:()=>eb,DefaultAstNodeLocator:()=>rb,DefaultAsyncParser:()=>Rb,DefaultCommentProvider:()=>Tb,DefaultConfigurationProvider:()=>nb,DefaultDocumentBuilder:()=>ab,DefaultDocumentValidator:()=>QS,DefaultHydrator:()=>Ab,DefaultIndexManager:()=>ib,DefaultJsonSerializer:()=>YS,DefaultLangiumDocumentFactory:()=>jS,DefaultLangiumDocuments:()=>US,DefaultLangiumProfiler:()=>cF,DefaultLexer:()=>Ch,DefaultLexerErrorMessageProvider:()=>ob,DefaultLinker:()=>zS,DefaultNameProvider:()=>BS,DefaultReferenceDescriptionProvider:()=>tb,DefaultReferences:()=>KS,DefaultScopeComputation:()=>qS,DefaultScopeProvider:()=>HS,DefaultServiceRegistry:()=>XS,DefaultTokenBuilder:()=>$c,DefaultValueConverter:()=>ph,DefaultWorkspaceLock:()=>$b,DefaultWorkspaceManager:()=>sb,Deferred:()=>Cr,Disposable:()=>Cn,DisposableCache:()=>_c,DocumentCache:()=>VS,DocumentState:()=>Y,DocumentValidator:()=>Et,EMPTY_SCOPE:()=>eF,EMPTY_STREAM:()=>Pa,EmptyFileSystem:()=>It,EmptyFileSystemProvider:()=>Cb,ErrorWithLocation:()=>kl,GrammarAST:()=>xg,GrammarUtils:()=>Od,IndentationAwareLexer:()=>sF,IndentationAwareTokenBuilder:()=>_b,JSDocDocumentationProvider:()=>vb,LangiumCompletionParser:()=>CS,LangiumParser:()=>ES,LangiumParserErrorMessageProvider:()=>oh,LeafCstNodeImpl:()=>fl,LexingMode:()=>En,MapScope:()=>Q1,Module:()=>Mf,MultiMap:()=>Sr,MultiMapScope:()=>WS,OperationCancelled:()=>Jt,ParserWorker:()=>iF,ProfilingTask:()=>bb,Reduction:()=>ss,RefResolving:()=>an,RegExpUtils:()=>Dd,RootCstNodeImpl:()=>ih,SimpleCache:()=>Th,StreamImpl:()=>Xt,StreamScope:()=>Pf,TextDocument:()=>hl,TreeStreamImpl:()=>Oa,URI:()=>ft,UriTrie:()=>yh,UriUtils:()=>Ye,VALIDATE_EACH_NODE:()=>ZS,ValidationCategory:()=>yl,ValidationRegistry:()=>JS,ValueConverter:()=>Ht,WorkspaceCache:()=>Rh,assertCondition:()=>Ld,assertUnreachable:()=>Kr,createCompletionParser:()=>uh,createDefaultCoreModule:()=>yt,createDefaultSharedCoreModule:()=>vt,createGrammarConfig:()=>Qd,createLangiumParser:()=>fh,createParser:()=>Tc,delayNextTick:()=>Ac,diagnosticData:()=>An,eagerLoad:()=>Ph,getDiagnosticRange:()=>Ah,indentationBuilderDefaultOptions:()=>Ff,inject:()=>Ae,interruptAndCheck:()=>Ge,isAstNode:()=>Le,isAstNodeDescription:()=>td,isAstNodeWithComment:()=>$h,isCompositeCstNode:()=>yr,isIMultiModeLexerDefinition:()=>wc,isJSDoc:()=>bh,isLeafCstNode:()=>kn,isLinkingError:()=>ln,isMultiReference:()=>Zt,isNamed:()=>vh,isOperationCancelled:()=>Xn,isReference:()=>He,isRootCstNode:()=>El,isTokenTypeArray:()=>bc,isTokenTypeDictionary:()=>vl,loadGrammarFromJson:()=>Tt,parseJSDoc:()=>Sh,prepareLangiumParser:()=>dh,setInterruptionPeriod:()=>hh,startCancelableOperation:()=>Ec,stream:()=>oe,toDiagnosticData:()=>Eh,toDiagnosticSeverity:()=>as});var ed={};Br(ed,{DefaultNameRegexp:()=>wd,RangeComparison:()=>Yt,compareRange:()=>Sd,findCommentNode:()=>Id,findDeclarationNodeAtOffset:()=>ry,findLeafNodeAtOffset:()=>Nl,findLeafNodeBeforeOffset:()=>Nd,flattenCst:()=>ty,getDatatypeNode:()=>ey,getInteriorNodes:()=>iy,getNextNode:()=>ny,getPreviousNode:()=>Pd,getStartlineNode:()=>ay,inRange:()=>bd,isChildNode:()=>Cd,isCommentNode:()=>Yo,streamCst:()=>xa,toDocumentSegment:()=>Fa,tokenToRange:()=>os});function Le(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}i(Le,"isAstNode");function He(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}i(He,"isReference");function Zt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}i(Zt,"isMultiReference");function td(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}i(td,"isAstNodeDescription");function ln(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}i(ln,"isLinkingError");var rd=class{static{i(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Le(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const n=r[t];if(n!==void 0)return n;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),n=[];for(const a of r)this.isSubtype(a,e)&&n.push(a);return this.allSubtypes[e]=n,n}}};function yr(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}i(yr,"isCompositeCstNode");function kn(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}i(kn,"isLeafCstNode");function El(e){return yr(e)&&typeof e.fullText=="string"}i(El,"isRootCstNode");var Xt=class fr{static{i(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){const t={state:this.startFn(),next:i(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const t=this.iterator();let r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){const t=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){const n=this.map(a=>[t?t(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(t){return new fr(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ve})}join(t=","){const r=this.iterator();let n="",a,s=!1;do a=r.next(),a.done||(s&&(n+=t),n+=Dg(a.value)),s=!0;while(!a.done);return n}indexOf(t,r=0){const n=this.iterator();let a=0,s=n.next();for(;!s.done;){if(a>=r&&s.value===t)return a;s=n.next(),a++}return-1}every(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)t(a.value,n),a=r.next(),n++}map(t){return new fr(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?Ve:{done:!1,value:t(a)}})}filter(t){return new fr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return Ve})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){const n=this.iterator();let a=r,s=n.next();for(;!s.done;)a===void 0?a=s.value:a=t(a,s.value),s=n.next();return a}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){const a=t.next();if(a.done)return n;const s=this.recursiveReduce(t,r,n);return s===void 0?a.value:r(s,a.value)}find(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(t(a.value))return n;a=r.next(),n++}return-1}includes(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new fr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:a}=this.nextFn(r.this);if(!n){const s=t(a);if(is(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return Ve})}flat(t){if(t===void 0&&(t=1),t<=0)return this;const r=t>1?this.flat(t-1):this;return new fr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:s}=r.nextFn(n.this);if(!a)if(is(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return Ve})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new fr(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?Ve:this.nextFn(r.state)))}distinct(t){return new fr(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=t?t(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return Ve})}exclude(t,r){const n=new Set;for(const a of t){const s=r?r(a):a;n.add(s)}return this.filter(a=>{const s=r?r(a):a;return!n.has(s)})}};function Dg(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}i(Dg,"toString");function is(e){return!!e&&typeof e[Symbol.iterator]=="function"}i(is,"isIterable");var Pa=new Xt(()=>{},()=>Ve),Ve=Object.freeze({done:!0,value:void 0});function oe(...e){if(e.length===1){const t=e[0];if(t instanceof Xt)return t;if(is(t))return new Xt(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new Xt(()=>({index:0}),r=>r.index1?new Xt(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){const s=n.iterators[n.iterators.length-1].next();if(s.done)n.iterators.pop();else return n.iterators.push(t(s.value)[Symbol.iterator]()),s}return Ve})}iterator(){const e={state:this.startFn(),next:i(()=>this.nextFn(e.state),"next"),prune:i(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},ss;(function(e){function t(s){return s.reduce((o,l)=>o+l,0)}i(t,"sum"),e.sum=t;function r(s){return s.reduce((o,l)=>o*l,0)}i(r,"product"),e.product=r;function n(s){return s.reduce((o,l)=>Math.min(o,l))}i(n,"min"),e.min=n;function a(s){return s.reduce((o,l)=>Math.max(o,l))}i(a,"max"),e.max=a})(ss||(ss={}));var nd={};Br(nd,{assignMandatoryProperties:()=>ad,copyAstNode:()=>Do,findRootNode:()=>wa,getContainerOfType:()=>Pn,getDocument:()=>Dt,getReferenceNodes:()=>Oo,hasContainerOfType:()=>Mg,linkContentToContainer:()=>La,streamAllContents:()=>br,streamAst:()=>Mt,streamContents:()=>Cs,streamReferences:()=>Da});function La(e,t={}){for(const[r,n]of Object.entries(e))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,s)=>{Le(a)&&(a.$container=e,a.$containerProperty=r,a.$containerIndex=s,t.deep&&La(a,t))}):Le(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&La(n,t)))}i(La,"linkContentToContainer");function Pn(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}i(Pn,"getContainerOfType");function Mg(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}i(Mg,"hasContainerOfType");function Dt(e){const r=wa(e).$document;if(!r)throw new Error("AST node has no document.");return r}i(Dt,"getDocument");function wa(e){for(;e.$container;)e=e.$container;return e}i(wa,"findRootNode");function Oo(e){return He(e)?e.ref?[e.ref]:[]:Zt(e)?e.items.map(t=>t.ref):[]}i(Oo,"getReferenceNodes");function Cs(e,t){if(!e)throw new Error("Node must be an AstNode.");const r=t?.range;return new Xt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexCs(r,t))}i(br,"streamAllContents");function Mt(e,t){if(e){if(t?.range&&!Lo(e,t.range))return new Oa(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Oa(e,r=>Cs(r,t),{includeRoot:!0})}i(Mt,"streamAst");function Lo(e,t){if(!t)return!0;const r=e.$cstNode?.range;return r?bd(r,t):!1}i(Lo,"isAstNodeInRange");function Da(e){return new Xt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexnt,AbstractParserRule:()=>Ki,AbstractRule:()=>Ra,AbstractType:()=>ut,Action:()=>Or,Alternatives:()=>qi,ArrayLiteral:()=>Mo,ArrayType:()=>xo,Assignment:()=>Lr,BooleanLiteral:()=>Fo,CharacterRange:()=>Dr,Condition:()=>Mr,Conjunction:()=>Wi,CrossReference:()=>xr,Disjunction:()=>Vi,EndOfFile:()=>Go,Grammar:()=>hr,GrammarImport:()=>jo,Group:()=>cn,InferredType:()=>Uo,InfixRule:()=>Vt,InfixRuleOperatorList:()=>Hi,InfixRuleOperators:()=>zo,Interface:()=>$a,Keyword:()=>Aa,LangiumGrammarAstReflection:()=>_d,LangiumGrammarTerminals:()=>Dw,NamedArgument:()=>Ea,NegatedToken:()=>un,Negation:()=>Bo,NumberLiteral:()=>Ko,Parameter:()=>_a,ParameterReference:()=>qo,ParserRule:()=>Pt,ReferenceType:()=>Yi,RegexToken:()=>fn,ReturnType:()=>Wo,RuleCall:()=>dn,SimpleType:()=>Ca,StringLiteral:()=>Vo,TerminalAlternatives:()=>pn,TerminalElement:()=>at,TerminalGroup:()=>hn,TerminalRule:()=>mr,TerminalRuleCall:()=>mn,Type:()=>Xi,TypeAttribute:()=>gn,TypeDefinition:()=>yn,UnionType:()=>Ho,UnorderedGroup:()=>Ji,UntilToken:()=>vn,ValueLiteral:()=>Tn,Wildcard:()=>Sa,isAbstractElement:()=>_l,isAbstractParserRule:()=>On,isAbstractRule:()=>Fg,isAbstractType:()=>Gg,isAction:()=>Fr,isAlternatives:()=>Cl,isArrayLiteral:()=>jg,isArrayType:()=>sd,isAssignment:()=>vr,isBooleanLiteral:()=>od,isCharacterRange:()=>ld,isCondition:()=>Ug,isConjunction:()=>cd,isCrossReference:()=>Ln,isDisjunction:()=>ud,isEndOfFile:()=>fd,isGrammar:()=>zg,isGrammarImport:()=>Bg,isGroup:()=>Dn,isInferredType:()=>Ss,isInfixRule:()=>Ma,isInfixRuleOperatorList:()=>Kg,isInfixRuleOperators:()=>qg,isInterface:()=>dd,isKeyword:()=>Tr,isNamedArgument:()=>Wg,isNegatedToken:()=>pd,isNegation:()=>hd,isNumberLiteral:()=>Vg,isParameter:()=>Hg,isParameterReference:()=>md,isParserRule:()=>Je,isReferenceType:()=>gd,isRegexToken:()=>yd,isReturnType:()=>vd,isRuleCall:()=>Rr,isSimpleType:()=>Sl,isStringLiteral:()=>Yg,isTerminalAlternatives:()=>Td,isTerminalElement:()=>Xg,isTerminalGroup:()=>Rd,isTerminalRule:()=>bt,isTerminalRuleCall:()=>bl,isType:()=>wl,isTypeAttribute:()=>Jg,isTypeDefinition:()=>Zg,isUnionType:()=>$d,isUnorderedGroup:()=>Il,isUntilToken:()=>Ad,isValueLiteral:()=>Qg,isWildcard:()=>Ed,reflection:()=>j});var Dw={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},nt={$type:"AbstractElement",cardinality:"cardinality"};function _l(e){return j.isInstance(e,nt.$type)}i(_l,"isAbstractElement");var Ki={$type:"AbstractParserRule"};function On(e){return j.isInstance(e,Ki.$type)}i(On,"isAbstractParserRule");var Ra={$type:"AbstractRule"};function Fg(e){return j.isInstance(e,Ra.$type)}i(Fg,"isAbstractRule");var ut={$type:"AbstractType"};function Gg(e){return j.isInstance(e,ut.$type)}i(Gg,"isAbstractType");var Or={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Fr(e){return j.isInstance(e,Or.$type)}i(Fr,"isAction");var qi={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Cl(e){return j.isInstance(e,qi.$type)}i(Cl,"isAlternatives");var Mo={$type:"ArrayLiteral",elements:"elements"};function jg(e){return j.isInstance(e,Mo.$type)}i(jg,"isArrayLiteral");var xo={$type:"ArrayType",elementType:"elementType"};function sd(e){return j.isInstance(e,xo.$type)}i(sd,"isArrayType");var Lr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function vr(e){return j.isInstance(e,Lr.$type)}i(vr,"isAssignment");var Fo={$type:"BooleanLiteral",true:"true"};function od(e){return j.isInstance(e,Fo.$type)}i(od,"isBooleanLiteral");var Dr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function ld(e){return j.isInstance(e,Dr.$type)}i(ld,"isCharacterRange");var Mr={$type:"Condition"};function Ug(e){return j.isInstance(e,Mr.$type)}i(Ug,"isCondition");var Wi={$type:"Conjunction",left:"left",right:"right"};function cd(e){return j.isInstance(e,Wi.$type)}i(cd,"isConjunction");var xr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Ln(e){return j.isInstance(e,xr.$type)}i(Ln,"isCrossReference");var Vi={$type:"Disjunction",left:"left",right:"right"};function ud(e){return j.isInstance(e,Vi.$type)}i(ud,"isDisjunction");var Go={$type:"EndOfFile",cardinality:"cardinality"};function fd(e){return j.isInstance(e,Go.$type)}i(fd,"isEndOfFile");var hr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function zg(e){return j.isInstance(e,hr.$type)}i(zg,"isGrammar");var jo={$type:"GrammarImport",path:"path"};function Bg(e){return j.isInstance(e,jo.$type)}i(Bg,"isGrammarImport");var cn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Dn(e){return j.isInstance(e,cn.$type)}i(Dn,"isGroup");var Uo={$type:"InferredType",name:"name"};function Ss(e){return j.isInstance(e,Uo.$type)}i(Ss,"isInferredType");var Vt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ma(e){return j.isInstance(e,Vt.$type)}i(Ma,"isInfixRule");var Hi={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function Kg(e){return j.isInstance(e,Hi.$type)}i(Kg,"isInfixRuleOperatorList");var zo={$type:"InfixRuleOperators",precedences:"precedences"};function qg(e){return j.isInstance(e,zo.$type)}i(qg,"isInfixRuleOperators");var $a={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function dd(e){return j.isInstance(e,$a.$type)}i(dd,"isInterface");var Aa={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Tr(e){return j.isInstance(e,Aa.$type)}i(Tr,"isKeyword");var Ea={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function Wg(e){return j.isInstance(e,Ea.$type)}i(Wg,"isNamedArgument");var un={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function pd(e){return j.isInstance(e,un.$type)}i(pd,"isNegatedToken");var Bo={$type:"Negation",value:"value"};function hd(e){return j.isInstance(e,Bo.$type)}i(hd,"isNegation");var Ko={$type:"NumberLiteral",value:"value"};function Vg(e){return j.isInstance(e,Ko.$type)}i(Vg,"isNumberLiteral");var _a={$type:"Parameter",name:"name"};function Hg(e){return j.isInstance(e,_a.$type)}i(Hg,"isParameter");var qo={$type:"ParameterReference",parameter:"parameter"};function md(e){return j.isInstance(e,qo.$type)}i(md,"isParameterReference");var Pt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Je(e){return j.isInstance(e,Pt.$type)}i(Je,"isParserRule");var Yi={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function gd(e){return j.isInstance(e,Yi.$type)}i(gd,"isReferenceType");var fn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function yd(e){return j.isInstance(e,fn.$type)}i(yd,"isRegexToken");var Wo={$type:"ReturnType",name:"name"};function vd(e){return j.isInstance(e,Wo.$type)}i(vd,"isReturnType");var dn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Rr(e){return j.isInstance(e,dn.$type)}i(Rr,"isRuleCall");var Ca={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Sl(e){return j.isInstance(e,Ca.$type)}i(Sl,"isSimpleType");var Vo={$type:"StringLiteral",value:"value"};function Yg(e){return j.isInstance(e,Vo.$type)}i(Yg,"isStringLiteral");var pn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Td(e){return j.isInstance(e,pn.$type)}i(Td,"isTerminalAlternatives");var at={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Xg(e){return j.isInstance(e,at.$type)}i(Xg,"isTerminalElement");var hn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Rd(e){return j.isInstance(e,hn.$type)}i(Rd,"isTerminalGroup");var mr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function bt(e){return j.isInstance(e,mr.$type)}i(bt,"isTerminalRule");var mn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function bl(e){return j.isInstance(e,mn.$type)}i(bl,"isTerminalRuleCall");var Xi={$type:"Type",name:"name",type:"type"};function wl(e){return j.isInstance(e,Xi.$type)}i(wl,"isType");var gn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function Jg(e){return j.isInstance(e,gn.$type)}i(Jg,"isTypeAttribute");var yn={$type:"TypeDefinition"};function Zg(e){return j.isInstance(e,yn.$type)}i(Zg,"isTypeDefinition");var Ho={$type:"UnionType",types:"types"};function $d(e){return j.isInstance(e,Ho.$type)}i($d,"isUnionType");var Ji={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Il(e){return j.isInstance(e,Ji.$type)}i(Il,"isUnorderedGroup");var vn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Ad(e){return j.isInstance(e,vn.$type)}i(Ad,"isUntilToken");var Tn={$type:"ValueLiteral"};function Qg(e){return j.isInstance(e,Tn.$type)}i(Qg,"isValueLiteral");var Sa={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Ed(e){return j.isInstance(e,Sa.$type)}i(Ed,"isWildcard");var _d=class extends rd{static{i(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:nt.$type,properties:{cardinality:{name:nt.cardinality}},superTypes:[]},AbstractParserRule:{name:Ki.$type,properties:{},superTypes:[Ra.$type,ut.$type]},AbstractRule:{name:Ra.$type,properties:{},superTypes:[]},AbstractType:{name:ut.$type,properties:{},superTypes:[]},Action:{name:Or.$type,properties:{cardinality:{name:Or.cardinality},feature:{name:Or.feature},inferredType:{name:Or.inferredType},operator:{name:Or.operator},type:{name:Or.type,referenceType:ut.$type}},superTypes:[nt.$type]},Alternatives:{name:qi.$type,properties:{cardinality:{name:qi.cardinality},elements:{name:qi.elements,defaultValue:[]}},superTypes:[nt.$type]},ArrayLiteral:{name:Mo.$type,properties:{elements:{name:Mo.elements,defaultValue:[]}},superTypes:[Tn.$type]},ArrayType:{name:xo.$type,properties:{elementType:{name:xo.elementType}},superTypes:[yn.$type]},Assignment:{name:Lr.$type,properties:{cardinality:{name:Lr.cardinality},feature:{name:Lr.feature},operator:{name:Lr.operator},predicate:{name:Lr.predicate},terminal:{name:Lr.terminal}},superTypes:[nt.$type]},BooleanLiteral:{name:Fo.$type,properties:{true:{name:Fo.true,defaultValue:!1}},superTypes:[Mr.$type,Tn.$type]},CharacterRange:{name:Dr.$type,properties:{cardinality:{name:Dr.cardinality},left:{name:Dr.left},lookahead:{name:Dr.lookahead},parenthesized:{name:Dr.parenthesized,defaultValue:!1},right:{name:Dr.right}},superTypes:[at.$type]},Condition:{name:Mr.$type,properties:{},superTypes:[]},Conjunction:{name:Wi.$type,properties:{left:{name:Wi.left},right:{name:Wi.right}},superTypes:[Mr.$type]},CrossReference:{name:xr.$type,properties:{cardinality:{name:xr.cardinality},deprecatedSyntax:{name:xr.deprecatedSyntax,defaultValue:!1},isMulti:{name:xr.isMulti,defaultValue:!1},terminal:{name:xr.terminal},type:{name:xr.type,referenceType:ut.$type}},superTypes:[nt.$type]},Disjunction:{name:Vi.$type,properties:{left:{name:Vi.left},right:{name:Vi.right}},superTypes:[Mr.$type]},EndOfFile:{name:Go.$type,properties:{cardinality:{name:Go.cardinality}},superTypes:[nt.$type]},Grammar:{name:hr.$type,properties:{imports:{name:hr.imports,defaultValue:[]},interfaces:{name:hr.interfaces,defaultValue:[]},isDeclared:{name:hr.isDeclared,defaultValue:!1},name:{name:hr.name},rules:{name:hr.rules,defaultValue:[]},types:{name:hr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:jo.$type,properties:{path:{name:jo.path}},superTypes:[]},Group:{name:cn.$type,properties:{cardinality:{name:cn.cardinality},elements:{name:cn.elements,defaultValue:[]},guardCondition:{name:cn.guardCondition},predicate:{name:cn.predicate}},superTypes:[nt.$type]},InferredType:{name:Uo.$type,properties:{name:{name:Uo.name}},superTypes:[ut.$type]},InfixRule:{name:Vt.$type,properties:{call:{name:Vt.call},dataType:{name:Vt.dataType},inferredType:{name:Vt.inferredType},name:{name:Vt.name},operators:{name:Vt.operators},parameters:{name:Vt.parameters,defaultValue:[]},returnType:{name:Vt.returnType,referenceType:ut.$type}},superTypes:[Ki.$type]},InfixRuleOperatorList:{name:Hi.$type,properties:{associativity:{name:Hi.associativity},operators:{name:Hi.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:zo.$type,properties:{precedences:{name:zo.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:$a.$type,properties:{attributes:{name:$a.attributes,defaultValue:[]},name:{name:$a.name},superTypes:{name:$a.superTypes,defaultValue:[],referenceType:ut.$type}},superTypes:[ut.$type]},Keyword:{name:Aa.$type,properties:{cardinality:{name:Aa.cardinality},predicate:{name:Aa.predicate},value:{name:Aa.value}},superTypes:[nt.$type]},NamedArgument:{name:Ea.$type,properties:{calledByName:{name:Ea.calledByName,defaultValue:!1},parameter:{name:Ea.parameter,referenceType:_a.$type},value:{name:Ea.value}},superTypes:[]},NegatedToken:{name:un.$type,properties:{cardinality:{name:un.cardinality},lookahead:{name:un.lookahead},parenthesized:{name:un.parenthesized,defaultValue:!1},terminal:{name:un.terminal}},superTypes:[at.$type]},Negation:{name:Bo.$type,properties:{value:{name:Bo.value}},superTypes:[Mr.$type]},NumberLiteral:{name:Ko.$type,properties:{value:{name:Ko.value}},superTypes:[Tn.$type]},Parameter:{name:_a.$type,properties:{name:{name:_a.name}},superTypes:[]},ParameterReference:{name:qo.$type,properties:{parameter:{name:qo.parameter,referenceType:_a.$type}},superTypes:[Mr.$type]},ParserRule:{name:Pt.$type,properties:{dataType:{name:Pt.dataType},definition:{name:Pt.definition},entry:{name:Pt.entry,defaultValue:!1},fragment:{name:Pt.fragment,defaultValue:!1},inferredType:{name:Pt.inferredType},name:{name:Pt.name},parameters:{name:Pt.parameters,defaultValue:[]},returnType:{name:Pt.returnType,referenceType:ut.$type}},superTypes:[Ki.$type]},ReferenceType:{name:Yi.$type,properties:{isMulti:{name:Yi.isMulti,defaultValue:!1},referenceType:{name:Yi.referenceType}},superTypes:[yn.$type]},RegexToken:{name:fn.$type,properties:{cardinality:{name:fn.cardinality},lookahead:{name:fn.lookahead},parenthesized:{name:fn.parenthesized,defaultValue:!1},regex:{name:fn.regex}},superTypes:[at.$type]},ReturnType:{name:Wo.$type,properties:{name:{name:Wo.name}},superTypes:[]},RuleCall:{name:dn.$type,properties:{arguments:{name:dn.arguments,defaultValue:[]},cardinality:{name:dn.cardinality},predicate:{name:dn.predicate},rule:{name:dn.rule,referenceType:Ra.$type}},superTypes:[nt.$type]},SimpleType:{name:Ca.$type,properties:{primitiveType:{name:Ca.primitiveType},stringType:{name:Ca.stringType},typeRef:{name:Ca.typeRef,referenceType:ut.$type}},superTypes:[yn.$type]},StringLiteral:{name:Vo.$type,properties:{value:{name:Vo.value}},superTypes:[Tn.$type]},TerminalAlternatives:{name:pn.$type,properties:{cardinality:{name:pn.cardinality},elements:{name:pn.elements,defaultValue:[]},lookahead:{name:pn.lookahead},parenthesized:{name:pn.parenthesized,defaultValue:!1}},superTypes:[at.$type]},TerminalElement:{name:at.$type,properties:{cardinality:{name:at.cardinality},lookahead:{name:at.lookahead},parenthesized:{name:at.parenthesized,defaultValue:!1}},superTypes:[nt.$type]},TerminalGroup:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},elements:{name:hn.elements,defaultValue:[]},lookahead:{name:hn.lookahead},parenthesized:{name:hn.parenthesized,defaultValue:!1}},superTypes:[at.$type]},TerminalRule:{name:mr.$type,properties:{definition:{name:mr.definition},fragment:{name:mr.fragment,defaultValue:!1},hidden:{name:mr.hidden,defaultValue:!1},name:{name:mr.name},type:{name:mr.type}},superTypes:[Ra.$type]},TerminalRuleCall:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},lookahead:{name:mn.lookahead},parenthesized:{name:mn.parenthesized,defaultValue:!1},rule:{name:mn.rule,referenceType:mr.$type}},superTypes:[at.$type]},Type:{name:Xi.$type,properties:{name:{name:Xi.name},type:{name:Xi.type}},superTypes:[ut.$type]},TypeAttribute:{name:gn.$type,properties:{defaultValue:{name:gn.defaultValue},isOptional:{name:gn.isOptional,defaultValue:!1},name:{name:gn.name},type:{name:gn.type}},superTypes:[]},TypeDefinition:{name:yn.$type,properties:{},superTypes:[]},UnionType:{name:Ho.$type,properties:{types:{name:Ho.types,defaultValue:[]}},superTypes:[yn.$type]},UnorderedGroup:{name:Ji.$type,properties:{cardinality:{name:Ji.cardinality},elements:{name:Ji.elements,defaultValue:[]}},superTypes:[nt.$type]},UntilToken:{name:vn.$type,properties:{cardinality:{name:vn.cardinality},lookahead:{name:vn.lookahead},parenthesized:{name:vn.parenthesized,defaultValue:!1},terminal:{name:vn.terminal}},superTypes:[at.$type]},ValueLiteral:{name:Tn.$type,properties:{},superTypes:[]},Wildcard:{name:Sa.$type,properties:{cardinality:{name:Sa.cardinality},lookahead:{name:Sa.lookahead},parenthesized:{name:Sa.parenthesized,defaultValue:!1}},superTypes:[at.$type]}}}},j=new _d;function ey(e){let t=e,r=!1;for(;t;){const n=Pn(t.grammarSource,Je);if(n&&n.dataType)t=t.container,r=!0;else return r?t:void 0}}i(ey,"getDatatypeNode");function xa(e){return new Oa(e,t=>yr(t)?t.content:[],{includeRoot:!0})}i(xa,"streamCst");function ty(e){return xa(e).filter(kn)}i(ty,"flattenCst");function Cd(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}i(Cd,"isChildNode");function os(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}i(os,"tokenToRange");function Fa(e){if(!e)return;const{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}i(Fa,"toDocumentSegment");var Yt;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Yt||(Yt={}));function Sd(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Yt.After;const r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.lineYt.After}i(bd,"inRange");var wd=/^[\w\p{L}]$/u;function ry(e,t,r=wd){if(e){if(t>0){const n=t-e.offset,a=e.text.charAt(n);r.test(a)||t--}return Nl(e,t)}}i(ry,"findDeclarationNodeAtOffset");function Id(e,t){if(e){const r=Pd(e,!0);if(r&&Yo(r,t))return r;if(El(e)){const n=e.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const s=e.content[a];if(Yo(s,t))return s}}}}i(Id,"findCommentNode");function Yo(e,t){return kn(e)&&t.includes(e.tokenType.name)}i(Yo,"isCommentNode");function Nl(e,t){if(kn(e))return e;if(yr(e)){const r=kd(e,t,!1);if(r)return Nl(r,t)}}i(Nl,"findLeafNodeAtOffset");function Nd(e,t){if(kn(e))return e;if(yr(e)){const r=kd(e,t,!0);if(r)return Nd(r,t)}}i(Nd,"findLeafNodeBeforeOffset");function kd(e,t,r){let n=0,a=e.content.length-1,s;for(;n<=a;){const o=Math.floor((n+a)/2),l=e.content[o];if(l.offset<=t&&l.end>t)return l;l.end<=t?(s=r?l:void 0,n=o+1):a=o-1}return s}i(kd,"binarySearch");function Pd(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);for(;n>0;){n--;const a=r.content[n];if(t||!a.hidden)return a}e=r}}i(Pd,"getPreviousNode");function ny(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);const a=r.content.length-1;for(;nWd,findNameAssignment:()=>Fl,findNodeForKeyword:()=>qd,findNodeForProperty:()=>Dl,findNodesForKeyword:()=>hy,findNodesForKeywordInternal:()=>xl,findNodesForProperty:()=>Kd,getActionAtElement:()=>Hd,getActionType:()=>Xd,getAllReachableRules:()=>Ll,getAllRulesUsedForCrossReferences:()=>py,getCrossReferenceTerminal:()=>zd,getEntryRule:()=>Gd,getExplicitRuleType:()=>ws,getHiddenRules:()=>jd,getRuleType:()=>Jd,getRuleTypeName:()=>Ty,getTypeName:()=>Sn,isArrayCardinality:()=>gy,isArrayOperator:()=>yy,isCommentTerminal:()=>Bd,isDataType:()=>vy,isDataTypeRule:()=>bs,isOptionalCardinality:()=>my,terminalRegex:()=>Is});var kl=class extends Error{static{i(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function Kr(e,t="Error: Got unexpected value."){throw new Error(t)}i(Kr,"assertUnreachable");function Ld(e,t="Error: Condition is violated."){if(!e)throw new Error(t)}i(Ld,"assertCondition");var Dd={};Br(Dd,{NEWLINE_REGEXP:()=>cy,escapeRegExp:()=>Wa,getTerminalParts:()=>fy,isMultilineComment:()=>Md,isWhitespace:()=>Ol,partialMatches:()=>xd,partialRegExp:()=>Fd,whitespaceCharacters:()=>dy});function K(e){return e.charCodeAt(0)}i(K,"cc");function vo(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}i(vo,"insertToSet");function pa(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}i(pa,"addFlag");function tn(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}i(tn,"ASSERT_EXISTS");function oy(){throw Error("Internal Error - Should never get here!")}i(oy,"ASSERT_NEVER_REACH_HERE");function tf(e){return e.type==="Character"}i(tf,"isCharacter");var Xo=[];for(let e=K("0");e<=K("9");e++)Xo.push(e);var Jo=[K("_")].concat(Xo);for(let e=K("a");e<=K("z");e++)Jo.push(e);for(let e=K("A");e<=K("Z");e++)Jo.push(e);var xh=[K(" "),K("\f"),K(` +`),K("\r"),K(" "),K("\v"),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K("\u2028"),K("\u2029"),K(" "),K(" "),K(" "),K("\uFEFF")],Mw=/[0-9a-fA-F]/,qs=/[0-9]/,xw=/[1-9]/,ly=class{static{i(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":pa(r,"global");break;case"i":pa(r,"ignoreCase");break;case"m":pa(r,"multiLine");break;case"u":pa(r,"unicode");break;case"y":pa(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}tn(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return oy()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:n,atMost:a}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;tn(t);break}if(!(e===!0&&t===void 0)&&tn(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),tn(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[K(` +`),K("\r"),K("\u2028"),K("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Xo;break;case"D":e=Xo,t=!0;break;case"s":e=xh;break;case"S":e=xh,t=!0;break;case"w":e=Jo;break;case"W":e=Jo,t=!0;break}if(tn(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=K("\f");break;case"n":e=K(` +`);break;case"r":e=K("\r");break;case"t":e=K(" ");break;case"v":e=K("\v");break}if(tn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:K("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:K(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:K(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,tf(r)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,tf(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Pl=class{static{i(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},cy=/\r?\n/gm,uy=new ly,Fw=class extends Pl{static{i(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Wa(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` +`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},Rn=new Fw;function fy(e){try{typeof e!="string"&&(e=e.source),e=`/${e}/`;const t=uy.pattern(e),r=[];for(const n of t.value.value)Rn.reset(e),Rn.visit(n),r.push({start:Rn.startRegexp,end:Rn.endRegex});return r}catch{return[]}}i(fy,"getTerminalParts");function Md(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),Rn.reset(e),Rn.visit(uy.pattern(e)),Rn.multiline}catch{return!1}}i(Md,"isMultilineComment");var dy=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function Ol(e){const t=typeof e=="string"?new RegExp(e):e;return dy.some(r=>t.test(r))}i(Ol,"isWhitespace");function Wa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Wa,"escapeRegExp");function xd(e,t){const r=Fd(e),n=t.match(r);return!!n&&n[0].length>0}i(xd,"partialMatches");function Fd(e){typeof e=="string"&&(e=new RegExp(e));const t=e,r=e.source;let n=0;function a(){let s="",o;function l(u){s+=r.substr(n,u),n+=u}i(l,"appendRaw");function c(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(i(c,"appendOptional");n",n)-n+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?l(o[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=a()+"|$)";break;case"=":s+="(?=",n+=3,s+=a()+")";break;case"!":o=n,n+=3,a(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),s+=r.substr(o,n-o);break;default:l(r.indexOf(">",n)-n+1),s+=a()+"|$)";break}break}else l(1),s+=a()+"|$)";break;case")":return++n,s;default:c(1);break}return s}return i(a,"process"),new RegExp(a(),e.flags)}i(Fd,"partialRegExp");function Gd(e){return e.rules.find(t=>Je(t)&&t.entry)}i(Gd,"getEntryRule");function jd(e){return e.rules.filter(t=>bt(t)&&t.hidden)}i(jd,"getHiddenRules");function Ll(e,t){const r=new Set,n=Gd(e);if(!n)return new Set(e.rules);const a=[n].concat(jd(e));for(const o of a)Ud(o,r,t);const s=new Set;for(const o of e.rules)(r.has(o.name)||bt(o)&&o.hidden)&&s.add(o);return s}i(Ll,"getAllReachableRules");function Ud(e,t,r){t.add(e.name),br(e).forEach(n=>{if(Rr(n)||r&&bl(n)){const a=n.rule.ref;a&&!t.has(a.name)&&Ud(a,t,r)}})}i(Ud,"ruleDfs");function py(e){const t=new Set;return br(e).forEach(r=>{Ln(r)&&(Je(r.type.ref)&&t.add(r.type.ref),Ss(r.type.ref)&&Je(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}i(py,"getAllRulesUsedForCrossReferences");function zd(e){if(e.terminal)return e.terminal;if(e.type.ref)return Fl(e.type.ref)?.terminal}i(zd,"getCrossReferenceTerminal");function Bd(e){return e.hidden&&!Ol(Is(e))}i(Bd,"isCommentTerminal");function Kd(e,t){return!e||!t?[]:Ml(e,t,e.astNode,!0)}i(Kd,"findNodesForProperty");function Dl(e,t,r){if(!e||!t)return;const n=Ml(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Dl,"findNodeForProperty");function Ml(e,t,r,n){if(!n){const a=Pn(e.grammarSource,vr);if(a&&a.feature===t)return[e]}return yr(e)&&e.astNode===r?e.content.flatMap(a=>Ml(a,t,r,!1)):[]}i(Ml,"findNodesForPropertyInternal");function hy(e,t){return e?xl(e,t,e?.astNode):[]}i(hy,"findNodesForKeyword");function qd(e,t,r){if(!e)return;const n=xl(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(qd,"findNodeForKeyword");function xl(e,t,r){if(e.astNode!==r)return[];if(Tr(e.grammarSource)&&e.grammarSource.value===t)return[e];const n=xa(e).iterator();let a;const s=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Tr(o.grammarSource)&&o.grammarSource.value===t&&s.push(o):n.prune()}while(!a.done);return s}i(xl,"findNodesForKeywordInternal");function Wd(e){const t=e.astNode;for(;t===e.container?.astNode;){const r=Pn(e.grammarSource,vr);if(r)return r;e=e.container}}i(Wd,"findAssignment");function Fl(e){let t=e;return Ss(t)&&(Fr(t.$container)?t=t.$container.$container:On(t.$container)?t=t.$container:Kr(t.$container)),Vd(e,t,new Map)}i(Fl,"findNameAssignment");function Vd(e,t,r){function n(a,s){let o;return Pn(a,vr)||(o=Vd(s,s,r)),r.set(e,o),o}if(i(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(const a of br(t)){if(vr(a)&&a.feature.toLowerCase()==="name")return r.set(e,a),a;if(Rr(a)&&Je(a.rule.ref))return n(a,a.rule.ref);if(Sl(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}i(Vd,"findNameAssignmentInternal");function Hd(e){const t=e.$container;if(Dn(t)){const r=t.elements,n=r.indexOf(e);for(let a=n-1;a>=0;a--){const s=r[a];if(Fr(s))return s;{const o=br(r[a]).find(Fr);if(o)return o}}}if(_l(t))return Hd(t)}i(Hd,"getActionAtElement");function my(e,t){return e==="?"||e==="*"||Dn(t)&&!!t.guardCondition}i(my,"isOptionalCardinality");function gy(e){return e==="*"||e==="+"}i(gy,"isArrayCardinality");function yy(e){return e==="+="}i(yy,"isArrayOperator");function bs(e){return Yd(e,new Set)}i(bs,"isDataTypeRule");function Yd(e,t){if(t.has(e))return!0;t.add(e);for(const r of br(e))if(Rr(r)){if(!r.rule.ref||Je(r.rule.ref)&&!Yd(r.rule.ref,t)||Ma(r.rule.ref))return!1}else{if(vr(r))return!1;if(Fr(r))return!1}return!!e.definition}i(Yd,"isDataTypeRuleInternal");function vy(e){return Zo(e.type,new Set)}i(vy,"isDataType");function Zo(e,t){if(t.has(e))return!0;if(t.add(e),sd(e))return!1;if(gd(e))return!1;if($d(e))return e.types.every(r=>Zo(r,t));if(Sl(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){const r=e.typeRef.ref;return wl(r)?Zo(r.type,t):!1}else return!1}else return!1}i(Zo,"isDataTypeInternal");function ws(e){if(!bt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t)return t.name}}}i(ws,"getExplicitRuleType");function Sn(e){if(On(e))return Je(e)&&bs(e)?e.name:ws(e)??e.name;if(dd(e)||wl(e)||vd(e))return e.name;if(Fr(e)){const t=Xd(e);if(t)return t}else if(Ss(e))return e.name;throw new Error("Cannot get name of Unknown Type")}i(Sn,"getTypeName");function Xd(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return Sn(e.type.ref)}i(Xd,"getActionType");function Ty(e){return bt(e)?e.type?.name??"string":Je(e)&&bs(e)?e.name:ws(e)??e.name}i(Ty,"getRuleTypeName");function Jd(e){return bt(e)?e.type?.name??"string":ws(e)??e.name}i(Jd,"getRuleType");function Is(e){const t={s:!1,i:!1,u:!1},r=Mn(e.definition,t),n=Object.entries(t).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}i(Is,"terminalRegex");var Zd=/[\s\S]/.source;function Mn(e,t){if(Td(e))return Ry(e);if(Rd(e))return $y(e);if(ld(e))return _y(e);if(bl(e)){const r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return Qt(Mn(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(pd(e))return Ey(e);if(Ad(e))return Ay(e);if(yd(e)){const r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),a=e.regex.substring(r+1);return t&&(t.i=a.includes("i"),t.s=a.includes("s"),t.u=a.includes("u")),Qt(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(Ed(e))return Qt(Zd,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}i(Mn,"abstractElementToRegex");function Ry(e){return Qt(e.elements.map(t=>Mn(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Ry,"terminalAlternativesToRegex");function $y(e){return Qt(e.elements.map(t=>Mn(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i($y,"terminalGroupToRegex");function Ay(e){return Qt(`${Zd}*?${Mn(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Ay,"untilTokenToRegex");function Ey(e){return Qt(`(?!${Mn(e.terminal)})${Zd}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Ey,"negateTokenToRegex");function _y(e){return e.right?Qt(`[${To(e.left)}-${To(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):Qt(To(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(_y,"characterRangeToRegex");function To(e){return Wa(e.value)}i(To,"keywordToRegex");function Qt(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}i(Qt,"withCardinality");function Qd(e){const t=[],r=e.Grammar;for(const n of r.rules)bt(n)&&Bd(n)&&Md(Is(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:wd}}i(Qd,"createGrammarConfig");var Gw=typeof global=="object"&&global&&global.Object===Object&&global,Cy=Gw,jw=typeof self=="object"&&self&&self.Object===Object&&self,Uw=Cy||jw||Function("return this")(),tr=Uw,zw=tr.Symbol,Ct=zw,Sy=Object.prototype,Bw=Sy.hasOwnProperty,Kw=Sy.toString,Ei=Ct?Ct.toStringTag:void 0;function by(e){var t=Bw.call(e,Ei),r=e[Ei];try{e[Ei]=void 0;var n=!0}catch{}var a=Kw.call(e);return n&&(t?e[Ei]=r:delete e[Ei]),a}i(by,"getRawTag");var qw=by,Ww=Object.prototype,Vw=Ww.toString;function wy(e){return Vw.call(e)}i(wy,"objectToString");var Hw=wy,Yw="[object Null]",Xw="[object Undefined]",Fh=Ct?Ct.toStringTag:void 0;function Iy(e){return e==null?e===void 0?Xw:Yw:Fh&&Fh in Object(e)?qw(e):Hw(e)}i(Iy,"baseGetTag");var qr=Iy;function Ny(e){return e!=null&&typeof e=="object"}i(Ny,"isObjectLike");var Gt=Ny,Jw="[object Symbol]";function ky(e){return typeof e=="symbol"||Gt(e)&&qr(e)==Jw}i(ky,"isSymbol");var Gl=ky;function Py(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r0){if(++t>=OI)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}i(Yy,"shortOut");var MI=Yy;function Xy(e){return function(){return e}}i(Xy,"constant");var xI=Xy,FI=(function(){try{var e=Fn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Qo=FI,GI=Qo?function(e,t){return Qo(e,"toString",{configurable:!0,enumerable:!1,value:xI(t),writable:!0})}:Ga,jI=GI,UI=MI(jI),zI=UI;function Jy(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}i(av,"arrayIncludes");var iv=av,qI=9007199254740991,WI=/^(?:0|[1-9]\d*)$/;function sv(e,t){var r=typeof e;return t=t??qI,!!t&&(r=="number"||r!="symbol"&&WI.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=XI}i(pv,"isLength");var ap=pv;function hv(e){return e!=null&&ap(e.length)&&!wr(e)}i(hv,"isArrayLike");var rr=hv;function mv(e,t,r){if(!St(r))return!1;var n=typeof t;return(n=="number"?rr(r)&&jl(t,r.length):n=="string"&&t in r)?Ps(r[t],e):!1}i(mv,"isIterateeCall");var zl=mv;function gv(e){return np(function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&zl(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n-1}i(Wv,"listCacheHas");var hk=Wv;function Vv(e,t){var r=this.__data__,n=ql(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(Vv,"listCacheSet");var mk=Vv;function jn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(l)?t>1?cp(l,t-1,r,n,a):lp(a,l):n||(a[a.length]=l)}return a}i(cp,"baseFlatten");var up=cp;function cT(e){var t=e==null?0:e.length;return t?up(e,1):[]}i(cT,"flatten");var xt=cT,Lk=Iv(Object.getPrototypeOf,Object),uT=Lk;function fT(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(a);++nl))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,y=r&_0?new hp:void 0;for(s.set(e,t),s.set(t,e);++d2?t[2]:void 0;for(a&&zl(t[0],t[1],a)&&(n=1);++r=yO&&(s=mp,o=!1,t=new hp(t));e:for(;++a-1?a[s?t[o]:o]:void 0}}i(WR,"createFind");var EO=WR,_O=Math.max;function VR(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:ks(r);return a<0&&(a=_O(n+a,0)),ev(e,nr(t),a)}i(VR,"findIndex");var CO=VR,SO=EO(CO),Ua=SO;function HR(e){return e&&e.length?e[0]:void 0}i(HR,"head");var jt=HR;function YR(e,t){var r=-1,n=rr(e)?Array(e.length):[];return Bn(e,function(a,s,o){n[++r]=t(a,s,o)}),n}i(YR,"baseMap");var bO=YR;function XR(e,t){var r=ne(e)?Ns:bO;return r(e,nr(t))}i(XR,"map");var F=XR;function JR(e,t){return up(F(e,t),1)}i(JR,"flatMap");var _t=JR,wO=Object.prototype,IO=wO.hasOwnProperty,NO=hO(function(e,t,r){IO.call(e,r)?e[r].push(t):rp(e,r,[t])}),kO=NO,PO=Object.prototype,OO=PO.hasOwnProperty;function ZR(e,t){return e!=null&&OO.call(e,t)}i(ZR,"baseHas");var LO=ZR;function QR(e,t){return e!=null&&yR(e,t,LO)}i(QR,"has");var U=QR,DO="[object String]";function e$(e){return typeof e=="string"||!ne(e)&&Gt(e)&&qr(e)==DO}i(e$,"isString");var it=e$;function t$(e,t){return Ns(t,function(r){return e[r]})}i(t$,"baseValues");var MO=t$;function r$(e){return e==null?[]:MO(e,dt(e))}i(r$,"values");var xe=r$,xO=Math.max;function n$(e,t,r,n){e=rr(e)?e:xe(e),r=r&&!n?ks(r):0;var a=e.length;return r<0&&(r=xO(a+r,0)),it(e)?r<=a&&e.indexOf(t,r)>-1:!!a&&tp(e,t,r)>-1}i(n$,"includes");var tt=n$,FO=Math.max;function a$(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:ks(r);return a<0&&(a=FO(n+a,0)),tp(e,t,a)}i(a$,"indexOf");var gm=a$,GO="[object Map]",jO="[object Set]",UO=Object.prototype,zO=UO.hasOwnProperty;function i$(e){if(e==null)return!0;if(rr(e)&&(ne(e)||typeof e=="string"||typeof e.splice=="function"||ls(e)||ip(e)||Bl(e)))return!e.length;var t=ja(e);if(t==GO||t==jO)return!e.size;if(Ls(e))return!kv(e).length;for(var r in e)if(zO.call(e,r))return!1;return!0}i(i$,"isEmpty");var he=i$,BO="[object RegExp]";function s$(e){return Gt(e)&&qr(e)==BO}i(s$,"baseIsRegExp");var KO=s$,ym=Gr&&Gr.isRegExp,qO=ym?Ds(ym):KO,$r=qO;function o$(e){return e===void 0}i(o$,"isUndefined");var Ar=o$,WO="Expected a function";function l$(e){if(typeof e!="function")throw new TypeError(WO);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}i(l$,"negate");var VO=l$;function c$(e,t,r,n){if(!St(e))return e;t=Xl(t,e);for(var a=-1,s=t.length,o=s-1,l=e;l!=null&&++a=tL){var u=t?null:eL(e);if(u)return gp(u);o=!1,a=mp,c=new hp}else c=t?[]:l;e:for(;++n{t.accept(e)})}},Ze=class extends ar{static{i(this,"NonTerminal")}constructor(e){super([]),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Va=class extends ar{static{i(this,"Rule")}constructor(e){super(e.definition),this.orgText="",pt(this,Ut(e,t=>t!==void 0))}},st=class extends ar{static{i(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,pt(this,Ut(e,t=>t!==void 0))}},Be=class extends ar{static{i(this,"Option")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},mt=class extends ar{static{i(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},gt=class extends ar{static{i(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},we=class extends ar{static{i(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},ot=class extends ar{static{i(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},lt=class extends ar{static{i(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,pt(this,Ut(e,t=>t!==void 0))}},Te=class{static{i(this,"Terminal")}constructor(e){this.idx=1,pt(this,Ut(e,t=>t!==void 0))}accept(e){e.visit(this)}};function A$(e){return F(e,ts)}i(A$,"serializeGrammar");function ts(e){function t(r){return F(r,ts)}if(i(t,"convertDefinition"),e instanceof Ze){const r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return it(e.label)&&(r.label=e.label),r}else{if(e instanceof st)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Be)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof mt)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof gt)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ts(new Te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ot)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ts(new Te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof we)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof lt)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Te){const r={type:"Terminal",name:e.terminalType.name,label:R$(e.terminalType),idx:e.idx};it(e.label)&&(r.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=$r(n)?n.source:n),r}else{if(e instanceof Va)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}i(ts,"serializeProduction");var Ha=class{static{i(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case Ze:return this.visitNonTerminal(t);case st:return this.visitAlternative(t);case Be:return this.visitOption(t);case mt:return this.visitRepetitionMandatory(t);case gt:return this.visitRepetitionMandatoryWithSeparator(t);case ot:return this.visitRepetitionWithSeparator(t);case we:return this.visitRepetition(t);case lt:return this.visitAlternation(t);case Te:return this.visitTerminal(t);case Va:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function E$(e){return e instanceof st||e instanceof Be||e instanceof we||e instanceof mt||e instanceof gt||e instanceof ot||e instanceof Te||e instanceof Va}i(E$,"isSequenceProd");function ps(e,t=[]){return e instanceof Be||e instanceof we||e instanceof ot?!0:e instanceof lt?y$(e.definition,n=>ps(n,t)):e instanceof Ze&&tt(t,e)?!1:e instanceof ar?(e instanceof Ze&&t.push(e),Ft(e.definition,n=>ps(n,t))):!1}i(ps,"isOptionalProd");function _$(e){return e instanceof lt}i(_$,"isBranchingProd");function Ot(e){if(e instanceof Ze)return"SUBRULE";if(e instanceof Be)return"OPTION";if(e instanceof lt)return"OR";if(e instanceof mt)return"AT_LEAST_ONE";if(e instanceof gt)return"AT_LEAST_ONE_SEP";if(e instanceof ot)return"MANY_SEP";if(e instanceof we)return"MANY";if(e instanceof Te)return"CONSUME";throw Error("non exhaustive match")}i(Ot,"getProductionDslName");var Ql=class{static{i(this,"RestWalker")}walk(e,t=[]){q(e.definition,(r,n)=>{const a=ze(e.definition,n+1);if(r instanceof Ze)this.walkProdRef(r,a,t);else if(r instanceof Te)this.walkTerminal(r,a,t);else if(r instanceof st)this.walkFlat(r,a,t);else if(r instanceof Be)this.walkOption(r,a,t);else if(r instanceof mt)this.walkAtLeastOne(r,a,t);else if(r instanceof gt)this.walkAtLeastOneSep(r,a,t);else if(r instanceof ot)this.walkManySep(r,a,t);else if(r instanceof we)this.walkMany(r,a,t);else if(r instanceof lt)this.walkOr(r,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new Be({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=of(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new Be({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=of(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);q(e.definition,a=>{const s=new st({definition:[a]});this.walk(s,n)})}};function of(e,t,r){return[new Be({definition:[new Te({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}i(of,"restForRepetitionWithSeparator");function Ya(e){if(e instanceof Ze)return Ya(e.referencedRule);if(e instanceof Te)return b$(e);if(E$(e))return C$(e);if(_$(e))return S$(e);throw Error("non exhaustive match")}i(Ya,"first");function C$(e){let t=[];const r=e.definition;let n=0,a=r.length>n,s,o=!0;for(;a&&o;)s=r[n],o=ps(s),t=t.concat(Ya(s)),n=n+1,a=r.length>n;return Tp(t)}i(C$,"firstForSequence");function S$(e){const t=F(e.definition,r=>Ya(r));return Tp(xt(t))}i(S$,"firstForBranching");function b$(e){return[e.terminalType]}i(b$,"firstForTerminal");var w$="_~IN~_",nL=class extends Ql{static{i(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=N$(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(r),s=new st({definition:a}),o=Ya(s);this.follows[n]=o}};function I$(e){const t={};return q(e,r=>{const n=new nL(r).startWalking();pt(t,n)}),t}i(I$,"computeAllProdsFollows");function N$(e,t){return e.name+t+w$}i(N$,"buildBetweenProdsFollowPrefix");var Ro={},aL=new ly;function Fs(e){const t=e.toString();if(Ro.hasOwnProperty(t))return Ro[t];{const r=aL.pattern(t);return Ro[t]=r,r}}i(Fs,"getRegExpAst");function k$(){Ro={}}i(k$,"clearRegExpParserCache");var P$="Complement Sets are not supported for first char optimization",rl=`Unable to use "first char" lexer optimizations: +`;function O$(e,t=!1){try{const r=Fs(e);return nl(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===P$)t&&Rp(`${rl} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),tl(`${rl} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}i(O$,"getOptimizedStartCodesIndices");function nl(e,t,r){switch(e.type){case"Disjunction":for(let a=0;a{if(typeof c=="number")Gi(c,t,r);else{const u=c;if(r===!0)for(let f=u.from;f<=u.to;f++)Gi(f,t,r);else{for(let f=u.from;f<=u.to&&f=Ui){const f=u.from>=Ui?u.from:Ui,d=u.to,h=Er(f),y=Er(d);for(let v=h;v<=y;v++)t[v]=v}}}});break;case"Group":nl(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&al(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return xe(t)}i(nl,"firstCharOptimizedIndices");function Gi(e,t,r){const n=Er(e);t[n]=n,r===!0&&L$(e,t)}i(Gi,"addOptimizedIdxToResult");function L$(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const a=Er(n.charCodeAt(0));t[a]=a}else{const a=r.toLowerCase();if(a!==r){const s=Er(a.charCodeAt(0));t[s]=s}}}i(L$,"handleIgnoreCase");function lf(e,t){return Ua(e.value,r=>{if(typeof r=="number")return tt(t,r);{const n=r;return Ua(t,a=>n.from<=a&&a<=n.to)!==void 0}})}i(lf,"findCode");function al(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?ne(e.value)?Ft(e.value,al):al(e.value):!1}i(al,"isWholeOptional");var iL=class extends Pl{static{i(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){tt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?lf(e,this.targetCharCodes)===void 0&&(this.found=!0):lf(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function ec(e,t){if(t instanceof RegExp){const r=Fs(t),n=new iL(e);return n.visit(r),n.found}else return Ua(t,r=>tt(e,r.charCodeAt(0)))!==void 0}i(ec,"canMatchCharCode");var wn="PATTERN",ji="defaultMode",Vs="modes",D$=typeof new RegExp("(?:)").sticky=="boolean";function M$(e,t){t=vp(t,{useSticky:D$,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:i((I,A)=>A(),"tracer")});const r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{nA()});let n;r("Reject Lexer.NA",()=>{n=Zl(e,I=>I[wn]===Xe.NA)});let a=!1,s;r("Transform Patterns",()=>{a=!1,s=F(n,I=>{const A=I[wn];if($r(A)){const k=A.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!A.ignoreCase?k:k.length===2&&k[0]==="\\"&&!tt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:t.useSticky?uf(A):cf(A)}else{if(wr(A))return a=!0,{exec:A};if(typeof A=="object")return a=!0,A;if(typeof A=="string"){if(A.length===1)return A;{const k=A.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),G=new RegExp(k);return t.useSticky?uf(G):cf(G)}}else throw Error("non exhaustive match")}})});let o,l,c,u,f;r("misc mapping",()=>{o=F(n,I=>I.tokenTypeIdx),l=F(n,I=>{const A=I.GROUP;if(A!==Xe.SKIPPED){if(it(A))return A;if(Ar(A))return!1;throw Error("non exhaustive match")}}),c=F(n,I=>{const A=I.LONGER_ALT;if(A)return ne(A)?F(A,G=>gm(n,G)):[gm(n,A)]}),u=F(n,I=>I.PUSH_MODE),f=F(n,I=>U(I,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const I=Cp(t.lineTerminatorCharacters);d=F(n,A=>!1),t.positionTracking!=="onlyOffset"&&(d=F(n,A=>U(A,"LINE_BREAKS")?!!A.LINE_BREAKS:_p(A,I)===!1&&ec(I,A.PATTERN)))});let h,y,v,C;r("Misc Mapping #2",()=>{h=F(n,Ep),y=F(s,tA),v=ht(n,(I,A)=>{const k=A.GROUP;return it(k)&&k!==Xe.SKIPPED&&(I[k]=[]),I},{}),C=F(s,(I,A)=>({pattern:s[A],longerAlt:c[A],canLineTerminator:d[A],isCustom:h[A],short:y[A],group:l[A],push:u[A],pop:f[A],tokenTypeIdx:o[A],tokenType:n[A]}))});let b=!0,w=[];return t.safeMode||r("First Char Optimization",()=>{w=ht(n,(I,A,k)=>{if(typeof A.PATTERN=="string"){const G=A.PATTERN.charCodeAt(0),H=Er(G);$o(I,H,C[k])}else if(ne(A.START_CHARS_HINT)){let G;q(A.START_CHARS_HINT,H=>{const X=typeof H=="string"?H.charCodeAt(0):H,le=Er(X);G!==le&&(G=le,$o(I,le,C[k]))})}else if($r(A.PATTERN))if(A.PATTERN.unicode)b=!1,t.ensureOptimizations&&tl(`${rl} Unable to analyze < ${A.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const G=O$(A.PATTERN,t.ensureOptimizations);he(G)&&(b=!1),q(G,H=>{$o(I,H,C[k])})}else t.ensureOptimizations&&tl(`${rl} TokenType: <${A.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return I},[])}),{emptyGroups:v,patternIdxToConfig:C,charCodeToPatternIdxToConfig:w,hasCustom:a,canBeOptimized:b}}i(M$,"analyzeTokenTypes");function x$(e,t){let r=[];const n=G$(e);r=r.concat(n.errors);const a=j$(n.valid),s=a.valid;return r=r.concat(a.errors),r=r.concat(F$(s)),r=r.concat(W$(s)),r=r.concat(V$(s,t)),r=r.concat(H$(s)),r}i(x$,"validatePatterns");function F$(e){let t=[];const r=wt(e,n=>$r(n[wn]));return t=t.concat(U$(r)),t=t.concat(B$(r)),t=t.concat(K$(r)),t=t.concat(q$(r)),t=t.concat(z$(r)),t}i(F$,"validateRegExpPattern");function G$(e){const t=wt(e,a=>!U(a,wn)),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:Ie.MISSING_PATTERN,tokenTypes:[a]})),n=Jl(e,t);return{errors:r,valid:n}}i(G$,"findMissingPatterns");function j$(e){const t=wt(e,a=>{const s=a[wn];return!$r(s)&&!wr(s)&&!U(s,"exec")&&!it(s)}),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ie.INVALID_PATTERN,tokenTypes:[a]})),n=Jl(e,t);return{errors:r,valid:n}}i(j$,"findInvalidPatterns");var sL=/[^\\][$]/;function U$(e){class t extends Pl{static{i(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const r=wt(e,a=>{const s=a.PATTERN;try{const o=Fs(s),l=new t;return l.visit(o),l.found}catch{return sL.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ie.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(U$,"findEndOfInputAnchor");function z$(e){const t=wt(e,n=>n.PATTERN.test(""));return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ie.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}i(z$,"findEmptyMatchRegExps");var oL=/[^\\[][\^]|^\^/;function B$(e){class t extends Pl{static{i(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const r=wt(e,a=>{const s=a.PATTERN;try{const o=Fs(s),l=new t;return l.visit(o),l.found}catch{return oL.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ie.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(B$,"findStartOfInputAnchor");function K$(e){const t=wt(e,n=>{const a=n[wn];return a instanceof RegExp&&(a.multiline||a.global)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ie.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}i(K$,"findUnsupportedFlags");function q$(e){const t=[];let r=F(e,s=>ht(e,(o,l)=>(s.PATTERN.source===l.PATTERN.source&&!tt(t,l)&&l.PATTERN!==Xe.NA&&(t.push(l),o.push(l)),o),[]));r=xs(r);const n=wt(r,s=>s.length>1);return F(n,s=>{const o=F(s,c=>c.name);return{message:`The same RegExp pattern ->${jt(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Ie.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}i(q$,"findDuplicatePatterns");function W$(e){const t=wt(e,n=>{if(!U(n,"GROUP"))return!1;const a=n.GROUP;return a!==Xe.SKIPPED&&a!==Xe.NA&&!it(a)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ie.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}i(W$,"findInvalidGroupType");function V$(e,t){const r=wt(e,a=>a.PUSH_MODE!==void 0&&!tt(t,a.PUSH_MODE));return F(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:Ie.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}i(V$,"findModesThatDoNotExist");function H$(e){const t=[],r=ht(e,(n,a,s)=>{const o=a.PATTERN;return o===Xe.NA||(it(o)?n.push({str:o,idx:s,tokenType:a}):$r(o)&&X$(o)&&n.push({str:o.source,idx:s,tokenType:a})),n},[]);return q(e,(n,a)=>{q(r,({str:s,idx:o,tokenType:l})=>{if(a${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:Ie.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}i(H$,"findUnreachablePatterns");function Y$(e,t){if($r(t)){if(J$(t))return!1;const r=t.exec(e);return r!==null&&r.index===0}else{if(wr(t))return t(e,0,[],{});if(U(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}i(Y$,"tryToMatchStrToPattern");function X$(e){return Ua([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}i(X$,"noMetaChar");function J$(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Ie.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),U(e,Vs)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Vs+`> property in its definition +`,type:Ie.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),U(e,Vs)&&U(e,ji)&&!U(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ji}: <${e.defaultMode}>which does not exist +`,type:Ie.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),U(e,Vs)&&q(e.modes,(a,s)=>{q(a,(o,l)=>{if(Ar(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}> +`,type:Ie.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(U(o,"LONGER_ALT")){const c=ne(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];q(c,u=>{!Ar(u)&&!tt(a,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}> +`,type:Ie.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}i(Z$,"performRuntimeChecks");function Q$(e,t,r){const n=[];let a=!1;const s=xs(xt(xe(e.modes))),o=Zl(s,c=>c[wn]===Xe.NA),l=Cp(r);return t&&q(o,c=>{const u=_p(c,l);if(u!==!1){const d={message:rA(c,u),type:u.issue,tokenType:c};n.push(d)}else U(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(a=!0):ec(l,c.PATTERN)&&(a=!0)}),t&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:Ie.NO_LINE_BREAKS_FLAGS}),n}i(Q$,"performWarningRuntimeChecks");function eA(e){const t={},r=dt(e);return q(r,n=>{const a=e[n];if(ne(a))t[n]=[];else throw Error("non exhaustive match")}),t}i(eA,"cloneEmptyGroups");function Ep(e){const t=e.PATTERN;if($r(t))return!1;if(wr(t))return!0;if(U(t,"exec"))return!0;if(it(t))return!1;throw Error("non exhaustive match")}i(Ep,"isCustomPattern");function tA(e){return it(e)&&e.length===1?e.charCodeAt(0):!1}i(tA,"isShortPattern");var lL={test:i(function(e){const t=e.length;for(let r=this.lastIndex;r Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ie.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}i(rA,"buildLineBreakIssueMessage");function Cp(e){return F(e,r=>it(r)?r.charCodeAt(0):r)}i(Cp,"getCharCodes");function $o(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i($o,"addToMapOfArrays");var Ui=256,Ao=[];function Er(e){return e255?255+~~(e/255):e}}i(nA,"initCharCodeToOptimizedIndexMap");function Xa(e,t){const r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}i(Xa,"tokenStructuredMatcher");function hs(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}i(hs,"tokenStructuredMatcherNoCategories");var vm=1,aA={};function Ja(e){const t=iA(e);sA(t),lA(t),oA(t),q(t,r=>{r.isParent=r.categoryMatches.length>0})}i(Ja,"augmentTokenTypes");function iA(e){let t=Ke(e),r=e,n=!0;for(;n;){r=xs(xt(F(r,s=>s.CATEGORIES)));const a=Jl(r,t);t=t.concat(a),he(a)?n=!1:r=a}return t}i(iA,"expandCategories");function sA(e){q(e,t=>{bp(t)||(aA[vm]=t,t.tokenTypeIdx=vm++),ff(t)&&!ne(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),ff(t)||(t.CATEGORIES=[]),cA(t)||(t.categoryMatches=[]),uA(t)||(t.categoryMatchesMap={})})}i(sA,"assignTokenDefaultProps");function oA(e){q(e,t=>{t.categoryMatches=[],q(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(aA[n].tokenTypeIdx)})})}i(oA,"assignCategoriesTokensProp");function lA(e){q(e,t=>{Sp([],t)})}i(lA,"assignCategoriesMapProp");function Sp(e,t){q(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),q(t.CATEGORIES,r=>{const n=e.concat(t);tt(n,r)||Sp(n,r)})}i(Sp,"singleAssignCategoriesToksMap");function bp(e){return U(e,"tokenTypeIdx")}i(bp,"hasShortKeyProperty");function ff(e){return U(e,"CATEGORIES")}i(ff,"hasCategoriesProperty");function cA(e){return U(e,"categoryMatches")}i(cA,"hasExtendingTokensTypesProperty");function uA(e){return U(e,"categoryMatchesMap")}i(uA,"hasExtendingTokensTypesMapProperty");function fA(e){return U(e,"tokenTypeIdx")}i(fA,"isTokenType");var df={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,a,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}},Ie;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ie||(Ie={}));var zi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:df,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(zi);var Xe=class{static{i(this,"Lexer")}constructor(e,t=zi){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);const{time:o,value:l}=$p(a),c=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=pt({},zi,t);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===zi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=lL;else if(this.config.lineTerminatorCharacters===zi.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),ne(e)?n={modes:{defaultMode:Ke(e)},defaultMode:ji}:(a=!1,n=Ke(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Z$(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Q$(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},q(n.modes,(o,l)=>{n.modes[l]=Zl(o,c=>Ar(c))});const s=dt(n.modes);if(q(n.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(x$(o,s))}),he(this.lexerDefinitionErrors)){Ja(o);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=M$(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=pt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=n.defaultMode,!he(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=F(this.lexerDefinitionErrors,c=>c.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}q(this.lexerDefinitionWarning,o=>{Rp(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(D$?(this.chopInput=Ga,this.match=this.matchWithTest):(this.updateLastIndex=Me,this.match=this.matchWithExec),a&&(this.handleModes=Me),this.trackStartLines===!1&&(this.computeNewColumn=Ga),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Me),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=ht(this.canModeBeOptimized,(l,c,u)=>(c===!1&&l.push(u),l),[]);if(t.ensureOptimizations&&!he(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{k$()}),this.TRACE_INIT("toFastProperties",()=>{Ap(this)})})}tokenize(e,t=this.defaultMode){if(!he(this.lexerDefinitionErrors)){const n=F(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,a,s,o,l,c,u,f,d,h,y,v,C,b;const w=e,I=w.length;let A=0,k=0;const G=this.hasCustom?0:Math.floor(e.length/10),H=new Array(G),X=[];let le=this.trackStartLines?1:void 0,ce=this.trackStartLines?1:void 0;const Ne=eA(this.emptyGroups),P=this.trackStartLines,_=this.config.lineTerminatorsPattern;let g=0,E=[],T=[];const R=[],S=[];Object.freeze(S);let O;function M(){return E}i(M,"getPossiblePatternsSlow");function D(te){const fe=Er(te),ct=T[fe];return ct===void 0?S:ct}i(D,"getPossiblePatternsOptimized");const z=i(te=>{if(R.length===1&&te.tokenType.PUSH_MODE===void 0){const fe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(te);X.push({offset:te.startOffset,line:te.startLine,column:te.startColumn,length:te.image.length,message:fe})}else{R.pop();const fe=bn(R);E=this.patternIdxToConfig[fe],T=this.charCodeToPatternIdxToConfig[fe],g=E.length;const ct=this.canModeBeOptimized[fe]&&this.config.safeMode===!1;T&&ct?O=D:O=M}},"pop_mode");function B(te){R.push(te),T=this.charCodeToPatternIdxToConfig[te],E=this.patternIdxToConfig[te],g=E.length,g=E.length;const fe=this.canModeBeOptimized[te]&&this.config.safeMode===!1;T&&fe?O=D:O=M}i(B,"push_mode"),B.call(this,t);let Z;const J=this.config.recoveryEnabled;for(;Al.length){l=s,c=u,Z=Se;break}}}break}}if(l!==null){if(f=l.length,d=Z.group,d!==void 0&&(h=Z.tokenTypeIdx,y=this.createTokenInstance(l,A,h,Z.tokenType,le,ce,f),this.handlePayload(y,c),d===!1?k=this.addToken(H,k,y):Ne[d].push(y)),e=this.chopInput(e,f),A=A+f,ce=this.computeNewColumn(ce,f),P===!0&&Z.canLineTerminator===!0){let Re=0,Oe,qe;_.lastIndex=0;do Oe=_.test(l),Oe===!0&&(qe=_.lastIndex-1,Re++);while(Oe===!0);Re!==0&&(le=le+Re,ce=f-qe,this.updateTokenEndLineColumnLocation(y,d,qe,Re,le,ce,f))}this.handleModes(Z,z,B,y)}else{const Re=A,Oe=le,qe=ce;let Se=J===!1;for(;Se===!1&&A ${_n(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:a}){const s="Expecting: ",l=` +but found: '`+jt(t).image+"'";if(n)return s+n+l;{const c=ht(e,(h,y)=>h.concat(y),[]),u=F(c,h=>`[${F(h,y=>_n(y)).join(", ")}]`),d=`one of these possible Token sequences: +${F(u,(h,y)=>` ${y+1}. ${h}`).join(` +`)}`;return s+d+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+jt(t).image+"'";if(r)return a+r+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${F(e,u=>`[${F(u,f=>_n(f)).join(",")}]`).join(" ,")}>`;return a+c+o}}};Object.freeze(ba);var uL={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- +inside top level rule: ->`+e.name+"<-"}},$n={buildDuplicateFoundError(e,t){function r(f){return f instanceof Te?f.terminalType.name:f instanceof Ze?f.nonTerminalName:""}i(r,"getExtraProductionArgument");const n=e.name,a=jt(t),s=a.idx,o=Ot(a),l=r(a),c=s>0;let u=`->${o}${c?s:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` +`),u},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=F(e.prefixPath,a=>_n(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(e){const t=F(e.prefixPath,a=>_n(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(e){let t=Ot(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name,r=F(e.leftRecursionPath,s=>s.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof Va?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function pA(e,t){const r=new fL(e,t);return r.resolveRefs(),r.errors}i(pA,"resolveGrammar");var fL=class extends Ha{static{i(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){q(xe(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:Qe.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},dL=class extends Ql{static{i(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ke(this.path.ruleStack).reverse(),this.occurrenceStack=Ke(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){he(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},pL=class extends dL{static{i(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(r),a=new st({definition:n});this.possibleTokTypes=Ya(a),this.found=!0}}},tc=class extends Ql{static{i(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},hL=class extends tc{static{i(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},bm=class extends tc{static{i(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},mL=class extends tc{static{i(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},wm=class extends tc{static{i(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};function il(e,t,r=[]){r=Ke(r);let n=[],a=0;function s(l){return l.concat(ze(e,a+1))}i(s,"remainingPathWith");function o(l){const c=il(s(l),t,r);return n.concat(c)}for(i(o,"getAlternativesForProd");r.length{he(c.definition)===!1&&(n=o(c.definition))}),n;if(l instanceof Te)r.push(l.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:ze(e,a)}),n}i(il,"possiblePathsFrom");function Np(e,t,r,n){const a="EXIT_NONE_TERMINAL",s=[a],o="EXIT_ALTERNATIVE";let l=!1;const c=t.length,u=c-n-1,f=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!he(d);){const h=d.pop();if(h===o){l&&bn(d).idx<=u&&d.pop();continue}const y=h.def,v=h.idx,C=h.ruleStack,b=h.occurrenceStack;if(he(y))continue;const w=y[0];if(w===a){const I={idx:v,def:ze(y),ruleStack:ds(C),occurrenceStack:ds(b)};d.push(I)}else if(w instanceof Te)if(v=0;I--){const A=w.definition[I],k={idx:v,def:A.definition.concat(ze(y)),ruleStack:C,occurrenceStack:b};d.push(k),d.push(o)}else if(w instanceof st)d.push({idx:v,def:w.definition.concat(ze(y)),ruleStack:C,occurrenceStack:b});else if(w instanceof Va)d.push(hA(w,v,C,b));else throw Error("non exhaustive match")}return f}i(Np,"nextPossibleTokensAfter");function hA(e,t,r,n){const a=Ke(r);a.push(e.name);const s=Ke(n);return s.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:s}}i(hA,"expandTopLevelRule");var _e;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(_e||(_e={}));function rc(e){if(e instanceof Be||e==="Option")return _e.OPTION;if(e instanceof we||e==="Repetition")return _e.REPETITION;if(e instanceof mt||e==="RepetitionMandatory")return _e.REPETITION_MANDATORY;if(e instanceof gt||e==="RepetitionMandatoryWithSeparator")return _e.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ot||e==="RepetitionWithSeparator")return _e.REPETITION_WITH_SEPARATOR;if(e instanceof lt||e==="Alternation")return _e.ALTERNATION;throw Error("non exhaustive match")}i(rc,"getProdType");function pf(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:a}=e,s=rc(n);return s===_e.ALTERNATION?js(t,r,a):Us(t,r,s,a)}i(pf,"getLookaheadPaths");function mA(e,t,r,n,a,s){const o=js(e,t,r),l=Pp(o)?hs:Xa;return s(o,n,l,a)}i(mA,"buildLookaheadFuncForOr");function gA(e,t,r,n,a,s){const o=Us(e,t,a,r),l=Pp(o)?hs:Xa;return s(o[0],l,n)}i(gA,"buildLookaheadFuncForOptionalProd");function yA(e,t,r,n){const a=e.length,s=Ft(e,o=>Ft(o,l=>l.length===1));if(t)return function(o){const l=F(o,c=>c.GATE);for(let c=0;cxt(c)),l=ht(o,(c,u,f)=>(q(u,d=>{U(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=f),q(d.categoryMatches,h=>{U(c,h)||(c[h]=f)})}),c),{});return function(){const c=this.LA(1);return l[c.tokenTypeIdx]}}else return function(){for(let o=0;os.length===1),a=e.length;if(n&&!r){const s=xt(e);if(s.length===1&&he(s[0].categoryMatches)){const l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{const o=ht(s,(l,c,u)=>(l[c.tokenTypeIdx]=!0,q(c.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){const l=this.LA(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sil([o],1)),n=hf(r.length),a=F(r,o=>{const l={};return q(o,c=>{const u=Eo(c.partialPath);q(u,f=>{l[f]=!0})}),l});let s=r;for(let o=1;o<=t;o++){const l=s;s=hf(l.length);for(let c=0;c{const w=Eo(b.partialPath);q(w,I=>{a[c][I]=!0})})}}}}return n}i(kp,"lookAheadSequenceFromAlternatives");function js(e,t,r,n){const a=new TA(e,_e.ALTERNATION,n);return t.accept(a),kp(a.result,r)}i(js,"getLookaheadPathsForOr");function Us(e,t,r,n){const a=new TA(e,r);t.accept(a);const s=a.result,l=new gL(t,e,r).startWalking(),c=new st({definition:s}),u=new st({definition:l});return kp([c,u],n)}i(Us,"getLookaheadPathsForOptionalProd");function sl(e,t){e:for(let r=0;r{const a=t[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}i($A,"isStrictPrefixOfPath");function Pp(e){return Ft(e,t=>Ft(t,r=>Ft(r,n=>he(n.categoryMatches))))}i(Pp,"areTokenCategoriesNotUsed");function AA(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return F(t,r=>Object.assign({type:Qe.CUSTOM_LOOKAHEAD_VALIDATION},r))}i(AA,"validateLookahead");function EA(e,t,r,n){const a=_t(e,c=>_A(c,r)),s=LA(e,t,r),o=_t(e,c=>NA(c,r)),l=_t(e,c=>SA(c,e,n,r));return a.concat(s,o,l)}i(EA,"validateGrammar");function _A(e,t){const r=new yL;e.accept(r);const n=r.allProductions,a=kO(n,CA),s=Ut(a,l=>l.length>1);return F(xe(s),l=>{const c=jt(l),u=t.buildDuplicateFoundError(e,l),f=Ot(c),d={message:u,type:Qe.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:f,occurrence:c.idx},h=Op(c);return h&&(d.parameter=h),d})}i(_A,"validateDuplicateProductions");function CA(e){return`${Ot(e)}_#_${e.idx}_#_${Op(e)}`}i(CA,"identifyProductionForDuplicates");function Op(e){return e instanceof Te?e.terminalType.name:e instanceof Ze?e.nonTerminalName:""}i(Op,"getExtraProductionArgument");var yL=class extends Ha{static{i(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function SA(e,t,r,n){const a=[];if(ht(t,(o,l)=>l.name===e.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});a.push({message:o,type:Qe.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}i(SA,"validateRuleDoesNotAlreadyExist");function bA(e,t,r){const n=[];let a;return tt(t,e)||(a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:Qe.INVALID_RULE_OVERRIDE,ruleName:e})),n}i(bA,"validateRuleIsOverridden");function Lp(e,t,r,n=[]){const a=[],s=rs(t.definition);if(he(s))return[];{const o=e.name;tt(s,e)&&a.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Qe.LEFT_RECURSION,ruleName:o});const c=Jl(s,n.concat([e])),u=_t(c,f=>{const d=Ke(n);return d.push(f),Lp(e,f,r,d)});return a.concat(u)}}i(Lp,"validateNoLeftRecursion");function rs(e){let t=[];if(he(e))return t;const r=jt(e);if(r instanceof Ze)t.push(r.referencedRule);else if(r instanceof st||r instanceof Be||r instanceof mt||r instanceof gt||r instanceof ot||r instanceof we)t=t.concat(rs(r.definition));else if(r instanceof lt)t=xt(F(r.definition,s=>rs(s.definition)));else if(!(r instanceof Te))throw Error("non exhaustive match");const n=ps(r),a=e.length>1;if(n&&a){const s=ze(e);return t.concat(rs(s))}else return t}i(rs,"getFirstNoneTerminal");var Dp=class extends Ha{static{i(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function wA(e,t){const r=new Dp;e.accept(r);const n=r.alternations;return _t(n,s=>{const o=ds(s.definition);return _t(o,(l,c)=>{const u=Np([l],[],Xa,1);return he(u)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:c}),type:Qe.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:c+1}]:[]})})}i(wA,"validateEmptyOrAlternative");function IA(e,t,r){const n=new Dp;e.accept(n);let a=n.alternations;return a=Zl(a,o=>o.ignoreAmbiguities===!0),_t(a,o=>{const l=o.idx,c=o.maxLookahead||t,u=js(l,e,c,o),f=PA(u,o,e,r),d=OA(u,o,e,r);return f.concat(d)})}i(IA,"validateAmbiguousAlternationAlternatives");var vL=class extends Ha{static{i(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function NA(e,t){const r=new Dp;e.accept(r);const n=r.alternations;return _t(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:Qe.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}i(NA,"validateTooManyAlts");function kA(e,t,r){const n=[];return q(e,a=>{const s=new vL;a.accept(s);const o=s.allProductions;q(o,l=>{const c=rc(l),u=l.maxLookahead||t,f=l.idx,h=Us(f,a,c,u)[0];if(he(xt(h))){const y=r.buildEmptyRepetitionError({topLevelRule:a,repetition:l});n.push({message:y,type:Qe.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}i(kA,"validateSomeNonEmptyLookaheadPath");function PA(e,t,r,n){const a=[],s=ht(e,(l,c,u)=>(t.definition[u].ignoreAmbiguities===!0||q(c,f=>{const d=[u];q(e,(h,y)=>{u!==y&&sl(h,f)&&t.definition[y].ignoreAmbiguities!==!0&&d.push(y)}),d.length>1&&!sl(a,f)&&(a.push(f),l.push({alts:d,path:f}))}),l),[]);return F(s,l=>{const c=F(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:c,prefixPath:l.path}),type:Qe.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:l.alts}})}i(PA,"checkAlternativesAmbiguities");function OA(e,t,r,n){const a=ht(e,(o,l,c)=>{const u=F(l,f=>({idx:c,path:f}));return o.concat(u)},[]);return xs(_t(a,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,f=wt(a,h=>t.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{const y=[h.idx+1,c+1],v=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:y,prefixPath:h.path}),type:Qe.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:v,alternatives:y}})}))}i(OA,"checkPrefixAlternativesAmbiguities");function LA(e,t,r){const n=[],a=F(t,s=>s.name);return q(e,s=>{const o=s.name;if(tt(a,o)){const l=r.buildNamespaceConflictError(s);n.push({message:l,type:Qe.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}i(LA,"checkTerminalAndNoneTerminalsNameSpace");function DA(e){const t=vp(e,{errMsgProvider:uL}),r={};return q(e.rules,n=>{r[n.name]=n}),pA(r,t.errMsgProvider)}i(DA,"resolveGrammar");function MA(e){return e=vp(e,{errMsgProvider:$n}),EA(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}i(MA,"validateGrammar");var xA="MismatchedTokenException",FA="NoViableAltException",GA="EarlyExitException",jA="NotAllInputParsedException",UA=[xA,FA,GA,jA];Object.freeze(UA);function ms(e){return tt(UA,e.name)}i(ms,"isRecognitionException");var nc=class extends Error{static{i(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},zA=class extends nc{static{i(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=xA}},TL=class extends nc{static{i(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=FA}},RL=class extends nc{static{i(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=jA}},$L=class extends nc{static{i(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=GA}},Lc={},BA="InRuleRecoveryException",AL=class extends Error{static{i(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=BA}},EL=class{static{i(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=U(e,"recoveryEnabled")?e.recoveryEnabled:_r.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=KA)}getTokenToInsert(e){const t=Gs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let u=this.LA(1);const f=i(()=>{const d=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),y=new zA(h,c,this.LA(0));y.resyncedTokens=ds(o),this.SAVE_ERROR(y)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(u,n)){f();return}else if(r.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(u,a)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new AL("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||he(t))return!1;const r=this.LA(1);return Ua(t,a=>this.tokenMatcher(r,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return tt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const n=Ua(e,a=>Ip(t,a));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Lc;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return F(e,(r,n)=>n===0?Lc:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){const e=F(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return xt(e)}getFollowSetFromFollowKey(e){if(e===Lc)return[jr];const t=e.ruleName+e.idxInCallingRule+w$+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,jr)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return ds(t)}attemptInRepetitionRecovery(e,t,r,n,a,s,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),n=Ke(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return F(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function KA(e,t,r,n,a,s,o){const l=this.getKeyForAutomaticLookahead(n,a);let c=this.firstAfterRepMap[l];if(c===void 0){const h=this.getCurrRuleFullName(),y=this.getGAstProductions()[h];c=new s(y,a).startWalking(),this.firstAfterRepMap[l]=c}let u=c.token,f=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=jr,f=1),!(u===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,f,o)&&this.tryInRepetitionRecovery(e,t,r,u)}i(KA,"attemptInRepetitionRecovery");var _L=4,Wr=8,qA=1<Lp(t,t,$n))}validateEmptyOrAlternatives(e){return _t(e,t=>wA(t,$n))}validateAmbiguousAlternationAlternatives(e,t){return _t(e,r=>IA(r,t,$n))}validateSomeNonEmptyLookaheadPath(e,t){return kA(e,t,$n)}buildLookaheadForAlternation(e){return mA(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,yA)}buildLookaheadForOptional(e){return gA(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,rc(e.prodType),vA)}},CL=class{static{i(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=U(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:_r.dynamicTokensEnabled,this.maxLookahead=U(e,"maxLookahead")?e.maxLookahead:_r.maxLookahead,this.lookaheadStrategy=U(e,"lookaheadStrategy")?e.lookaheadStrategy:new Mp({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){q(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:n,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=VA(t);q(r,c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Ot(c)}${u}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:t,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Co(this.fullRuleNameToShort[t.name],qA,c.idx);this.setLaFuncCache(d,f)})}),q(n,c=>{this.computeLookaheadFunc(t,c.idx,mf,"Repetition",c.maxLookahead,Ot(c))}),q(a,c=>{this.computeLookaheadFunc(t,c.idx,WA,"Option",c.maxLookahead,Ot(c))}),q(s,c=>{this.computeLookaheadFunc(t,c.idx,gf,"RepetitionMandatory",c.maxLookahead,Ot(c))}),q(o,c=>{this.computeLookaheadFunc(t,c.idx,_o,"RepetitionMandatoryWithSeparator",c.maxLookahead,Ot(c))}),q(l,c=>{this.computeLookaheadFunc(t,c.idx,yf,"RepetitionWithSeparator",c.maxLookahead,Ot(c))})})})}computeLookaheadFunc(e,t,r,n,a,s){this.TRACE_INIT(`${s}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),l=Co(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Co(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},SL=class extends Ha{static{i(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Hs=new SL;function VA(e){Hs.reset(),e.accept(Hs);const t=Hs.dslMethods;return Hs.reset(),t}i(VA,"collectMethods");function vf(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${s.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}i(JA,"createBaseSemanticVisitorConstructor");function ZA(e,t,r){const n=i(function(){},"derivedConstructor");xp(n,e+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return q(t,s=>{a[s]=XA}),n.prototype=a,n.prototype.constructor=n,n}i(ZA,"createBaseVisitorConstructorWithDefaults");var Rf;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Rf||(Rf={}));function QA(e,t){return eE(e,t)}i(QA,"validateVisitor");function eE(e,t){const r=wt(t,a=>wr(e[a])===!1),n=F(r,a=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:Rf.MISSING_METHOD,methodName:a}));return xs(n)}i(eE,"validateMissingCstMethods");var wL=class{static{i(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=U(e,"nodeLocationTracking")?e.nodeLocationTracking:_r.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Me,this.cstFinallyStateUpdate=Me,this.cstPostTerminal=Me,this.cstPostNonTerminal=Me,this.cstPostRule=Me;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Tf,this.setNodeLocationFromNode=Tf,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vf,this.setNodeLocationFromNode=vf,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=Me,this.setInitialNodeLocation=Me;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];HA(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];YA(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(Ar(this.baseCstVisitorConstructor)){const e=JA(this.className,dt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ar(this.baseCstVisitorWithDefaultsConstructor)){const e=ZA(this.className,dt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},IL=class{static{i(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ol}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ol:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},NL=class{static{i(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,r=ll){if(tt(this.definedRulesNames,e)){const s={message:$n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Qe.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=ll){const n=bA(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const a=this.defineRule(e,t,r);return this[e]=a,a}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(ms(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return A$(xe(this.gastProductionsCache))}},kL=class{static{i(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=hs,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},U(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(ne(e)){if(he(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(ne(e))this.tokensMap=ht(e,(a,s)=>(a[s.name]=s,a),{});else if(U(e,"modes")&&Ft(xt(xe(e.modes)),fA)){const a=xt(xe(e.modes)),s=Tp(a);this.tokensMap=ht(s,(o,l)=>(o[l.name]=l,o),{})}else if(St(e))this.tokensMap=Ke(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=jr;const r=U(e,"modes")?xt(xe(e.modes)):xe(e),n=Ft(r,a=>he(a.categoryMatches));this.tokenMatcher=n?hs:Xa,Ja(xe(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=U(r,"resyncEnabled")?r.resyncEnabled:ll.resyncEnabled,a=U(r,"recoveryValueFunc")?r.recoveryValueFunc:ll.recoveryValueFunc,s=this.ruleShortNameIdx<<_L+Wr;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=i(function(...u){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,u);const f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,n,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):o=i(function(...u){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,u)}catch(f){return this.invokeRuleCatch(f,n,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,r){const n=this.RULE_STACK.length===1,a=t&&!this.isBackTracking()&&this.recoveryEnabled;if(ms(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return r(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(n)return this.moveToTerminatedState(),r(e);throw s}}else throw e}optionInternal(e,t){const r=this.getKeyForAutomaticLookahead(WA,t);return this.optionInternalLogic(e,t,r)}optionInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(n.call(this)===!0)return a.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(gf,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const s=t.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=t;if(n.call(this)===!0){let s=this.doSingleRepetition(a);for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,_e.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,gf,e,mL)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(_o,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,wm],o,_o,e,wm)}else throw this.raiseEarlyExitException(e,_e.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(mf,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=i(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=t;let s=!0;for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,mf,e,hL,s)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(yf,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,bm],o,yf,e,bm)}}repetitionSepSecondInternal(e,t,r,n,a){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,a],r,_o,e,a)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(qA,t),n=ne(e)?e:e.DEF,s=this.getLaFuncFromCache(r).call(this,n);if(s!==void 0)return n[s].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new RL(t,e))}}subruleInternal(e,t,r){let n;try{const a=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,a),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}}subruleInternalError(e,t,r){throw ms(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),n=a):this.consumeInternalError(e,a,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const a=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new zA(n,t,a))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(a){throw a.name===BA?r:a}}else throw r}saveRecogState(){const e=this.errors,t=Ke(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),jr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},PL=class{static{i(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=U(e,"errorMessageProvider")?e.errorMessageProvider:_r.errorMessageProvider}SAVE_ERROR(e){if(ms(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ke(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ke(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],o=Us(e,a,t,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new $L(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=js(e,n,this.maxLookahead),s=[];for(let c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new TL(l,this.LA(1),o))}},OL=class{static{i(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(Ar(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Np([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=jt(e.ruleStack),n=this.getGAstProductions()[t];return new pL(n,e).startWalking()}},ac={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ac);var Im=!0,Nm=Math.pow(2,Wr)-1,tE=Na({name:"RECORDING_PHASE_TOKEN",pattern:Xe.NA});Ja([tE]);var rE=Gs(tE,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(rE);var LL={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},DL=class{static{i(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ol}topLevelRuleRecord(e,t){try{const r=new Va({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return ha.call(this,Be,e,t)}atLeastOneInternalRecord(e,t){ha.call(this,mt,t,e)}atLeastOneSepFirstInternalRecord(e,t){ha.call(this,gt,t,e,Im)}manyInternalRecord(e,t){ha.call(this,we,t,e)}manySepFirstInternalRecord(e,t){ha.call(this,ot,t,e,Im)}orInternalRecord(e,t){return nE.call(this,e,t)}subruleInternalRecord(e,t,r){if(gs(t),!e||U(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=bn(this.recordingProdStack),a=e.ruleName,s=new Ze({idx:t,nonTerminalName:a,label:r?.LABEL,referencedRule:void 0});return n.definition.push(s),this.outputCst?LL:ac}consumeInternalRecord(e,t,r){if(gs(t),!bp(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const n=bn(this.recordingProdStack),a=new Te({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(a),rE}};function ha(e,t,r,n=!1){gs(r);const a=bn(this.recordingProdStack),s=wr(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),U(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),ac}i(ha,"recordProd");function nE(e,t){gs(t);const r=bn(this.recordingProdStack),n=ne(e)===!1,a=n===!1?e:e.DEF,s=new lt({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});U(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=y$(a,l=>wr(l.GATE));return s.hasPredicates=o,r.definition.push(s),q(a,l=>{const c=new st({definition:[]});s.definition.push(c),U(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:U(l,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),l.ALT.call(this),this.recordingProdStack.pop()}),ac}i(nE,"recordOrProd");function $f(e){return e===0?"":`${e}`}i($f,"getIdxSuffix");function gs(e){if(e<0||e>Nm){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${Nm+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}i(gs,"assertMethodIdxIsValid");var ML=class{static{i(this,"PerformanceTracer")}initPerformanceTracer(e){if(U(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=_r.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:n,value:a}=$p(t),s=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,a}else return t()}};function aE(e,t){t.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,a);s&&(s.get||s.set)?Object.defineProperty(e.prototype,a,s):e.prototype[a]=r.prototype[a]})})}i(aE,"applyMixins");var ol=Gs(jr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ol);var _r=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ba,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ll=Object.freeze({recoveryValueFunc:i(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Qe;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Qe||(Qe={}));function Af(e=void 0){return function(){return e}}i(Af,"EMPTY_ALT");var Fp=class iE{static{i(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Ap(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),q(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let l;this.TRACE_INIT(`${a} Rule`,()=>{l=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=DA({rules:xe(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(he(n)&&this.skipValidations===!1){const a=MA({rules:xe(this.gastProductionsCache),tokenTypes:xe(this.tokensMap),errMsgProvider:$n,grammarName:r}),s=AA({lookaheadStrategy:this.lookaheadStrategy,rules:xe(this.gastProductionsCache),tokenTypes:xe(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,s)}}),he(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=I$(xe(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,s;(s=(a=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(a,{rules:xe(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(xe(this.gastProductionsCache))})),!iE.DEFER_DEFINITION_ERRORS_HANDLING&&!he(this.definitionErrors))throw t=F(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${t.join(` +------------------------------- +`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),U(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=U(r,"skipValidations")?r.skipValidations:_r.skipValidations}};Fp.DEFER_DEFINITION_ERRORS_HANDLING=!1;aE(Fp,[EL,CL,wL,IL,kL,NL,PL,OL,DL,ML]);var xL=class extends Fp{static{i(this,"EmbeddedActionsParser")}constructor(e,t=_r){const r=Ke(t);r.outputCst=!1,super(e,r)}};function sE(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r-1}i(hE,"listCacheHas");var BL=hE;function mE(e,t){var r=this.__data__,n=ic(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(mE,"listCacheSet");var KL=mE;function Kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,y=r&XD?new HE:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=kM}i(y_,"isLength");var Up=y_,PM="[object Arguments]",OM="[object Array]",LM="[object Boolean]",DM="[object Date]",MM="[object Error]",xM="[object Function]",FM="[object Map]",GM="[object Number]",jM="[object Object]",UM="[object RegExp]",zM="[object Set]",BM="[object String]",KM="[object WeakMap]",qM="[object ArrayBuffer]",WM="[object DataView]",VM="[object Float32Array]",HM="[object Float64Array]",YM="[object Int8Array]",XM="[object Int16Array]",JM="[object Int32Array]",ZM="[object Uint8Array]",QM="[object Uint8ClampedArray]",ex="[object Uint16Array]",tx="[object Uint32Array]",ve={};ve[VM]=ve[HM]=ve[YM]=ve[XM]=ve[JM]=ve[ZM]=ve[QM]=ve[ex]=ve[tx]=!0;ve[PM]=ve[OM]=ve[qM]=ve[LM]=ve[WM]=ve[DM]=ve[MM]=ve[xM]=ve[FM]=ve[GM]=ve[jM]=ve[UM]=ve[zM]=ve[BM]=ve[KM]=!1;function v_(e){return za(e)&&Up(e.length)&&!!ve[Za(e)]}i(v_,"baseIsTypedArray");var rx=v_;function T_(e){return function(t){return e(t)}}i(T_,"baseUnary");var nx=T_,R_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ns=R_&&typeof module=="object"&&module&&!module.nodeType&&module,ax=ns&&ns.exports===R_,xc=ax&&RE.process,ix=(function(){try{var e=ns&&ns.require&&ns.require("util").types;return e||xc&&xc.binding&&xc.binding("util")}catch{}})(),jm=ix,Um=jm&&jm.isTypedArray,sx=Um?nx(Um):rx,zp=sx,ox=Object.prototype,lx=ox.hasOwnProperty;function $_(e,t){var r=et(e),n=!r&&cc(e),a=!r&&!n&&cl(e),s=!r&&!n&&!a&&zp(e),o=r||n||a||s,l=o?RM(e.length,String):[],c=l.length;for(var u in e)(t||lx.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||g_(u,c)))&&l.push(u);return l}i($_,"arrayLikeKeys");var cx=$_,ux=Object.prototype;function A_(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ux;return e===r}i(A_,"isPrototype");var E_=A_;function __(e,t){return function(r){return e(t(r))}}i(__,"overArg");var fx=__,dx=fx(Object.keys,Object),px=dx,hx=Object.prototype,mx=hx.hasOwnProperty;function C_(e){if(!E_(e))return px(e);var t=[];for(var r in Object(e))mx.call(e,r)&&r!="constructor"&&t.push(r);return t}i(C_,"baseKeys");var S_=C_;function b_(e){return e!=null&&Up(e.length)&&!bE(e)}i(b_,"isArrayLike");var uc=b_;function w_(e){return uc(e)?cx(e):S_(e)}i(w_,"keys");var Bp=w_;function I_(e){return hM(e,Bp,TM)}i(I_,"getAllKeys");var zm=I_,gx=1,yx=Object.prototype,vx=yx.hasOwnProperty;function N_(e,t,r,n,a,s){var o=r&gx,l=zm(e),c=l.length,u=zm(t),f=u.length;if(c!=f&&!o)return!1;for(var d=c;d--;){var h=l[d];if(!(o?h in t:vx.call(t,h)))return!1}var y=s.get(e),v=s.get(t);if(y&&v)return y==t&&v==e;var C=!0;s.set(e,t),s.set(t,e);for(var b=o;++dJp(e,t,o));return Yn(e,t,n,r,...a)}i(AC,"alternation");function EC(e,t,r){const n=Fe(e,t,r,{type:Ur});Nr(e,n);const a=Yn(e,t,n,r,Vr(e,t,r));return _C(e,t,r,a)}i(EC,"option");function Vr(e,t,r){const n=m1(gr(r.definition,a=>Jp(e,t,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:SC(e,n)}i(Vr,"block");function Zp(e,t,r,n,a){const s=n.left,o=n.right,l=Fe(e,t,r,{type:R1});Nr(e,l);const c=Fe(e,t,r,{type:hC});return s.loopback=l,c.loopback=l,e.decisionMap[In(t,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Pe(o,l),a===void 0?(Pe(l,s),Pe(l,c)):(Pe(l,c),Pe(l,a.left),Pe(a.right,s)),{left:s,right:c}}i(Zp,"plus");function Qp(e,t,r,n,a){const s=n.left,o=n.right,l=Fe(e,t,r,{type:T1});Nr(e,l);const c=Fe(e,t,r,{type:hC}),u=Fe(e,t,r,{type:v1});return l.loopback=u,c.loopback=u,Pe(l,s),Pe(l,c),Pe(o,u),a!==void 0?(Pe(u,c),Pe(u,a.left),Pe(a.right,s)):Pe(u,l),e.decisionMap[In(t,a?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:c}}i(Qp,"star");function _C(e,t,r,n){const a=n.left,s=n.right;return Pe(a,s),e.decisionMap[In(t,"Option",r.idx)]=a,n}i(_C,"optional");function Nr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}i(Nr,"defineDecisionState");function Yn(e,t,r,n,...a){const s=Fe(e,t,n,{type:y1,start:r});r.end=s;for(const l of a)l!==void 0?(Pe(r,l.left),Pe(l.right,s)):Pe(r,s);const o={left:r,right:s};return e.decisionMap[In(t,CC(n),n.idx)]=r,o}i(Yn,"makeAlts");function CC(e){if(e instanceof lt)return"Alternation";if(e instanceof Be)return"Option";if(e instanceof we)return"Repetition";if(e instanceof ot)return"RepetitionWithSeparator";if(e instanceof mt)return"RepetitionMandatory";if(e instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}i(CC,"getProdType");function SC(e,t){const r=t.length;for(let s=0;se.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}};function eh(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}i(eh,"getATNConfigKey");function NC(e,t,r){for(var n=-1,a=e.length;++n0&&r(l)?t>1?th(l,t-1,r,n,a):a_(a,l):n||(a[a.length]=l)}return a}i(th,"baseFlatten");var LC=th;function DC(e,t){return LC(gr(e,t),1)}i(DC,"flatMap");var C1=DC;function MC(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s-1}i(jC,"arrayIncludes");var N1=jC;function UC(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=M1){var u=t?null:D1(e);if(u)return jp(u);o=!1,a=JE,c=new HE}else c=t?[]:l;e:for(;++n{const a=n.toString();let s=r[a];return s!==void 0||(s={atnStartState:e,decision:t,states:{}},r[a]=s),s}}i(QC,"createDFACache");var eS=class{static{i(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=gC(e.rules),this.dfas=tS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=In(r,"Alternation",t),u=this.atn.decisionMap[l].decision,f=gr(pf({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),d=>gr(d,h=>h[0]));if(wf(f,!1)&&!a){const d=eg(f,(h,y,v)=>(Fc(y,C=>{C&&(h[C.tokenTypeIdx]=v,Fc(C.categoryMatches,b=>{h[b]=v}))}),h),{});return n?function(h){var y;const v=this.LA(1),C=d[v.tokenTypeIdx];if(h!==void 0&&C!==void 0){const b=(y=h[C])===null||y===void 0?void 0:y.GATE;if(b!==void 0&&b.call(this)===!1)return}return C}:function(){const h=this.LA(1);return d[h.tokenTypeIdx]}}else return n?function(d){const h=new eS,y=d===void 0?0:d.length;for(let C=0;Cgr(d,h=>h[0]));if(wf(f)&&f[0][0]&&!a){const d=f[0],h=G1(d);if(h.length===1&&W1(h[0].categoryMatches)){const v=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const y=eg(h,(v,C)=>(C!==void 0&&(v[C.tokenTypeIdx]=!0,Fc(C.categoryMatches,b=>{v[b]=!0})),v),{});return function(){const v=this.LA(1);return y[v.tokenTypeIdx]===!0}}}return function(){const d=bo.call(this,s,u,tg,o);return typeof d=="object"?!1:d===0}}};function wf(e,t=!0){const r=new Set;for(const n of e){const a=new Set;for(const s of n){if(s===void 0){if(t)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const l of o)if(r.has(l)){if(!a.has(l))return!1}else r.add(l),a.add(l)}}return!0}i(wf,"isLL1Sequence");function tS(e){const t=e.decisionStates.length,r=Array(t);for(let n=0;n_n(a)).join(", "),r=e.production.idx===0?"":e.production.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${sS(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}i(iS,"buildAmbiguityError");function sS(e){if(e instanceof Ze)return"SUBRULE";if(e instanceof Be)return"OPTION";if(e instanceof lt)return"OR";if(e instanceof mt)return"AT_LEAST_ONE";if(e instanceof gt)return"AT_LEAST_ONE_SEP";if(e instanceof ot)return"MANY_SEP";if(e instanceof we)return"MANY";if(e instanceof Te)return"CONSUME";throw Error("non exhaustive match")}i(sS,"getProductionDslName");function oS(e,t,r){const n=C1(t.configs.elements,s=>s.state.transitions),a=F1(n.filter(s=>s instanceof Yp).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:e}}i(oS,"buildAdaptivePredictError");function lS(e,t){return e.edges[t.tokenTypeIdx]}i(lS,"getExistingTargetState");function cS(e,t,r){const n=new bf,a=[];for(const o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===zs){a.push(o);continue}const l=o.state.transitions.length;for(let c=0;c0&&!hS(s))for(const o of a)s.add(o);return s}i(cS,"computeReachSet");function uS(e,t){if(e instanceof Yp&&Ip(t,e.tokenType))return e.target}i(uS,"getReachableTarget");function fS(e,t){let r;for(const n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}i(fS,"getUniqueAlt");function rh(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}i(rh,"newDFAState");function If(e,t,r,n){return n=nh(e,n),t.edges[r.tokenTypeIdx]=n,n}i(If,"addDFAEdge");function nh(e,t){if(t===ul)return t;const r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}i(nh,"addDFAState");function dS(e){const t=new bf,r=e.transitions.length;for(let n=0;n0){const a=[...e.stack],o={state:a.pop(),alt:e.alt,stack:a};Rs(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}i(vS,"hasConflictingAltSet");function TS(e){for(const t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}i(TS,"hasStateAssociatedWithOneAlt");Es();var RS=class{static{i(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new ih(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new vc;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new fl(e.startOffset,e.image.length,os(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const a of e){const s=new fl(a.startOffset,a.image.length,os(a),a.tokenType,!0);s.root=this.rootNode,t.push(s)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const a=r.container.content.indexOf(r);if(a>0){r.container.content.splice(a,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},ah=class{static{i(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},fl=class extends ah{static{i(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,r,n,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},vc=class extends ah{static{i(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new X1(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},X1=class $S extends Array{static{i(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,$S.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(const r of t)r.container=this.parent}},ih=class extends vc{static{i(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},dl=Symbol("Datatype");function wo(e){return e.$type===dl}i(wo,"isDataTypeNode");var rg="​",AS=i(e=>e.endsWith(rg)?e:e+rg,"withRuleSuffix"),sh=class{static{i(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new Z1(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new SS(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},ES=class extends sh{static{i(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new RS,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e);let n;Ma(e)&&(n=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(AS(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,a),Je(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===dl?s.value="":t!==void 0&&(s.$infixName=t)}return r(n),a?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){const n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){const a=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:l}=this.getAssignment(r),c=this.current;if(o){const u=Tr(r)?n.image:this.converter.convert(n.image,s);this.assign(o.operator,o.feature,u,s,l)}else if(wo(c)){let u=n.image;Tr(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,a){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,a)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,n,s))}}performSubruleAssignment(e,t,r){const{assignment:n,crossRef:a}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,a);else if(!n){const s=this.current;if(wo(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const a={$type:e};this.stack.push(a),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):wo(e)?this.converter.convert(e.value,e.$cstNode):(ad(this.astReflection,e),e)}constructInfix(e,t){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let a=0,s=-1;for(let v=0;vs?(s=b.precedence,a=v):b.precedence===s&&(b.rightAssoc||(a=v))}const o=n.slice(0,a),l=n.slice(a+1),c=r.slice(0,a+1),u=r.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:l},h=this.constructInfix(f,t),y=this.constructInfix(d,t);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:n[a],right:y}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=Pn(e,vr);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Ln(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,a){const s=this.current;let o;switch(a==="single"&&typeof r=="string"?o=this.linker.buildReference(s,t,n,r):a==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(s,t,n,r):o=r,e){case"=":{s[t]=o;break}case"?=":{s[t]=!0;break}case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,a]of Object.entries(t)){const s=e[n];s===void 0?e[n]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[n]=a)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},_S=class{static{i(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return ba.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return ba.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return ba.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return ba.buildEarlyExitMessage(e)}},oh=class extends _S{static{i(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},CS=class extends sh{static{i(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const r=this.wrapper.DEFINE_RULE(AS(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,a){this.before(n),this.wrapper.wrapSubrule(e,t,a),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},J1={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new oh},SS=class extends xL{static{i(this,"ChevrotainWrapper")}constructor(e,t){const r=t&&"maxLookahead"in t;super(e,{...J1,lookaheadStrategy:r?new Mp({maxLookahead:t.maxLookahead}):new Y1({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},Z1=class extends SS{static{i(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};function Tc(e,t,r){return bS({parser:t,tokens:r,ruleNames:new Map},e),t}i(Tc,"createParser");function bS(e,t){const r=Ll(t,!1),n=oe(t.rules).filter(Je).filter(s=>r.has(s));for(const s of n){const o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(s,zr(o,s.definition))}const a=oe(t.rules).filter(Ma).filter(s=>r.has(s));for(const s of a)e.parser.rule(s,wS(e,s))}i(bS,"buildRules");function wS(e,t){const r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(bt(r))throw new Error("Cannot use terminal rule in infix expression");const n=t.operators.precedences.flatMap(y=>y.operators),a={$type:"Group",elements:[]},s={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(s,o);const c={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...s,$container:o};o.elements.push(c,u);const d=n.map(y=>e.tokens[y.value]).map((y,v)=>({ALT:i(()=>e.parser.consume(v,y,c),"ALT")}));let h;return y=>{h??(h=Rc(e,r)),e.parser.subrule(0,h,!1,s,y),e.parser.many(0,{DEF:i(()=>{e.parser.alternatives(0,d),e.parser.subrule(1,h,!1,u,y)},"DEF")})}}i(wS,"buildInfixRule");function zr(e,t,r=!1){let n;if(Tr(t))n=DS(e,t);else if(Fr(t))n=IS(e,t);else if(vr(t))n=zr(e,t.terminal);else if(Ln(t))n=lh(e,t);else if(Rr(t))n=NS(e,t);else if(Cl(t))n=PS(e,t);else if(Il(t))n=OS(e,t);else if(Dn(t))n=LS(e,t);else if(fd(t)){const a=e.consume++;n=i(()=>e.parser.consume(a,jr,t),"method")}else throw new kl(t.$cstNode,`Unexpected element type: ${t.$type}`);return ch(e,r?void 0:$s(t),n,t.cardinality)}i(zr,"buildElement");function IS(e,t){const r=Sn(t);return()=>e.parser.action(r,t)}i(IS,"buildAction");function NS(e,t){const r=t.rule.ref;if(On(r)){const n=e.subrule++,a=Je(r)&&r.fragment,s=t.arguments.length>0?kS(r,t.arguments):()=>({});let o;return l=>{o??(o=Rc(e,r)),e.parser.subrule(n,o,a,t,s(l))}}else if(bt(r)){const n=e.consume++,a=pl(e,r.name);return()=>e.parser.consume(n,a,t)}else if(r)Kr();else throw new kl(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}i(NS,"buildRuleCall");function kS(e,t){if(t.some(n=>n.calledByName)){const n=t.map(a=>({parameterName:a.parameter?.ref?.name,predicate:Lt(a.value)}));return a=>{const s={};for(const{parameterName:o,predicate:l}of n)o&&(s[o]=l(a));return s}}else{const n=t.map(a=>Lt(a.value));return a=>{const s={};for(let o=0;ot(n)||r(n)}else if(cd(e)){const t=Lt(e.left),r=Lt(e.right);return n=>t(n)&&r(n)}else if(hd(e)){const t=Lt(e.value);return r=>!t(r)}else if(md(e)){const t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(od(e)){const t=!!e.true;return()=>t}Kr()}i(Lt,"buildPredicate");function PS(e,t){if(t.elements.length===1)return zr(e,t.elements[0]);{const r=[];for(const a of t.elements){const s={ALT:zr(e,a,!0)},o=$s(a);o&&(s.GATE=Lt(o)),r.push(s)}const n=e.or++;return a=>e.parser.alternatives(n,r.map(s=>{const o={ALT:i(()=>s.ALT(a),"ALT")},l=s.GATE;return l&&(o.GATE=()=>l(a)),o}))}}i(PS,"buildAlternatives");function OS(e,t){if(t.elements.length===1)return zr(e,t.elements[0]);const r=[];for(const l of t.elements){const c={ALT:zr(e,l,!0)},u=$s(l);u&&(c.GATE=Lt(u)),r.push(c)}const n=e.or++,a=i((l,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${l}_${u}`},"idFunc"),s=i(l=>e.parser.alternatives(n,r.map((c,u)=>{const f={ALT:i(()=>!0,"ALT")},d=e.parser;f.ALT=()=>{if(c.ALT(l),!d.isRecording()){const y=a(n,d);d.unorderedGroups.get(y)||d.unorderedGroups.set(y,[]);const v=d.unorderedGroups.get(y);typeof v?.[u]>"u"&&(v[u]=!0)}};const h=c.GATE;return h?f.GATE=()=>h(l):f.GATE=()=>!d.unorderedGroups.get(a(n,d))?.[u],f})),"alternatives"),o=ch(e,$s(t),s,"*");return l=>{o(l),e.parser.isRecording()||e.parser.unorderedGroups.delete(a(n,e.parser))}}i(OS,"buildUnorderedGroup");function LS(e,t){const r=t.elements.map(n=>zr(e,n));return n=>r.forEach(a=>a(n))}i(LS,"buildGroup");function $s(e){if(Dn(e))return e.guardCondition}i($s,"getGuardCondition");function lh(e,t,r=t.terminal){if(r)if(Rr(r)&&Je(r.rule.ref)){const n=r.rule.ref,a=e.subrule++;let s;return o=>{s??(s=Rc(e,n)),e.parser.subrule(a,s,!1,t,o)}}else if(Rr(r)&&bt(r.rule.ref)){const n=e.consume++,a=pl(e,r.rule.ref.name);return()=>e.parser.consume(n,a,t)}else if(Tr(r)){const n=e.consume++,a=pl(e,r.value);return()=>e.parser.consume(n,a,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const a=Fl(t.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+Sn(t.type.ref));return lh(e,t,a)}}i(lh,"buildCrossReference");function DS(e,t){const r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}i(DS,"buildKeyword");function ch(e,t,r,n){const a=t&&Lt(t);if(!n)if(a){const s=e.or++;return o=>e.parser.alternatives(s,[{ALT:i(()=>r(o),"ALT"),GATE:i(()=>a(o),"GATE")},{ALT:Af(),GATE:i(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const s=e.many++;return o=>e.parser.many(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const s=e.many++;if(a){const o=e.or++;return l=>e.parser.alternatives(o,[{ALT:i(()=>e.parser.atLeastOne(s,{DEF:i(()=>r(l),"DEF")}),"ALT"),GATE:i(()=>a(l),"GATE")},{ALT:Af(),GATE:i(()=>!a(l),"GATE")}])}else return o=>e.parser.atLeastOne(s,{DEF:i(()=>r(o),"DEF")})}else if(n==="?"){const s=e.optional++;return o=>e.parser.optional(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else Kr()}i(ch,"wrap");function Rc(e,t){const r=MS(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}i(Rc,"getRule");function MS(e,t){if(On(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,a=t.$type;for(;!Je(n);)(Dn(n)||Cl(n)||Il(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,e.ruleNames.set(t,a),a}}i(MS,"getRuleName");function pl(e,t){const r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}i(pl,"getToken");function uh(e){const t=e.Grammar,r=e.parser.Lexer,n=new CS(e);return Tc(t,n,r.definition),n.finalize(),n}i(uh,"createCompletionParser");function fh(e){const t=dh(e);return t.finalize(),t}i(fh,"createLangiumParser");function dh(e){const t=e.Grammar,r=e.parser.Lexer,n=new ES(e);return Tc(t,n,r.definition)}i(dh,"prepareLangiumParser");var $c=class{static{i(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const r=oe(Ll(e,!1)),n=this.buildTerminalTokens(r),a=this.buildKeywordTokens(r,n,t);return a.push(...n),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(bt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Is(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=Ol(t)?Xe.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(On).flatMap(n=>br(n).filter(Tr)).distinct(n=>n.value).toArray().sort((n,a)=>a.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){const n=this.buildKeywordPattern(e,r),a={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,t){return t?new RegExp(Wa(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{const a=n?.PATTERN;return a?.source&&xd("^"+a.source+"$",e.value)&&r.push(n),r},[])}},ph=class{static{i(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(Ln(r)&&(r=zd(r)),Rr(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Ht.convertInt(t);case"STRING":return Ht.convertString(t);case"ID":return Ht.convertID(t)}switch(Jd(e)?.toLowerCase()){case"number":return Ht.convertNumber(t);case"boolean":return Ht.convertBoolean(t);case"bigint":return Ht.convertBigint(t);case"date":return Ht.convertDate(t);default:return t}}},Ht;(function(e){function t(u){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}i(Ac,"delayNextTick");var Io=0,xS=10;function Ec(){return Io=performance.now(),new pe.CancellationTokenSource}i(Ec,"startCancelableOperation");function hh(e){xS=e}i(hh,"setInterruptionPeriod");var Jt=Symbol("OperationCancelled");function Xn(e){return e===Jt}i(Xn,"isOperationCancelled");async function Ge(e){if(e===pe.CancellationToken.None)return;const t=performance.now();if(t-Io>=xS&&(Io=t,await Ac(),Io=performance.now()),e.isCancellationRequested)throw Jt}i(Ge,"interruptAndCheck");var Cr=class{static{i(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},ng=class Nf{static{i(this,"FullTextDocument")}constructor(t,r,n,a){this._uri=t,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(const n of t)if(Nf.isIncremental(n)){const a=gh(n.range),s=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);const l=Math.max(a.start.line,0),c=Math.max(a.end.line,0);let u=this._lineOffsets;const f=kf(n.text,!1,s);if(c-l===f.length)for(let h=0,y=f.length;ht?a=o:n=o+1}const s=n-1;return t=this.ensureBeforeEOL(t,r[s]),{line:s,character:t-r[s]}}offsetAt(t){const r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;const n=r[t.line];if(t.character<=0)return n;const a=t.line+1r&&mh(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},hl;(function(e){function t(a,s,o,l){return new ng(a,s,o,l)}i(t,"create"),e.create=t;function r(a,s,o){if(a instanceof ng)return a.update(s,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}i(r,"update"),e.update=r;function n(a,s){const o=a.getText(),l=ml(s.map(FS),(f,d)=>{const h=f.range.start.line-d.range.start.line;return h===0?f.range.start.character-d.range.start.character:h});let c=0;const u=[];for(const f of l){const d=a.offsetAt(f.range.start);if(dc&&u.push(o.substring(c,d)),f.newText.length&&u.push(f.newText),c=a.offsetAt(f.range.end)}return u.push(o.substr(c)),u.join("")}i(n,"applyEdits"),e.applyEdits=n})(hl||(hl={}));function ml(e,t){if(e.length<=1)return e;const r=e.length/2|0,n=e.slice(0,r),a=e.slice(r);ml(n,t),ml(a,t);let s=0,o=0,l=0;for(;sr.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}i(gh,"getWellformedRange");function FS(e){const t=gh(e.range);return t!==e.range?{newText:e.newText,range:t}:e}i(FS,"getWellformedEdit");var GS;(()=>{var e={975:P=>{function _(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}i(_,"e");function g(T,R){for(var S,O="",M=0,D=-1,z=0,B=0;B<=T.length;++B){if(B2){var Z=O.lastIndexOf("/");if(Z!==O.length-1){Z===-1?(O="",M=0):M=(O=O.slice(0,Z)).length-1-O.lastIndexOf("/"),D=B,z=0;continue}}else if(O.length===2||O.length===1){O="",M=0,D=B,z=0;continue}}R&&(O.length>0?O+="/..":O="..",M=2)}else O.length>0?O+="/"+T.slice(D+1,B):O=T.slice(D+1,B),M=B-D-1;D=B,z=0}else S===46&&z!==-1?++z:z=-1}return O}i(g,"r");var E={resolve:i(function(){for(var T,R="",S=!1,O=arguments.length-1;O>=-1&&!S;O--){var M;O>=0?M=arguments[O]:(T===void 0&&(T=process.cwd()),M=T),_(M),M.length!==0&&(R=M+"/"+R,S=M.charCodeAt(0)===47)}return R=g(R,!S),S?R.length>0?"/"+R:"/":R.length>0?R:"."},"resolve"),normalize:i(function(T){if(_(T),T.length===0)return".";var R=T.charCodeAt(0)===47,S=T.charCodeAt(T.length-1)===47;return(T=g(T,!R)).length!==0||R||(T="."),T.length>0&&S&&(T+="/"),R?"/"+T:T},"normalize"),isAbsolute:i(function(T){return _(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:i(function(){if(arguments.length===0)return".";for(var T,R=0;R0&&(T===void 0?T=S:T+="/"+S)}return T===void 0?".":E.normalize(T)},"join"),relative:i(function(T,R){if(_(T),_(R),T===R||(T=E.resolve(T))===(R=E.resolve(R)))return"";for(var S=1;SB){if(R.charCodeAt(D+J)===47)return R.slice(D+J+1);if(J===0)return R.slice(D+J)}else M>B&&(T.charCodeAt(S+J)===47?Z=J:J===0&&(Z=0));break}var te=T.charCodeAt(S+J);if(te!==R.charCodeAt(D+J))break;te===47&&(Z=J)}var fe="";for(J=S+Z+1;J<=O;++J)J!==O&&T.charCodeAt(J)!==47||(fe.length===0?fe+="..":fe+="/..");return fe.length>0?fe+R.slice(D+Z):(D+=Z,R.charCodeAt(D)===47&&++D,R.slice(D))},"relative"),_makeLong:i(function(T){return T},"_makeLong"),dirname:i(function(T){if(_(T),T.length===0)return".";for(var R=T.charCodeAt(0),S=R===47,O=-1,M=!0,D=T.length-1;D>=1;--D)if((R=T.charCodeAt(D))===47){if(!M){O=D;break}}else M=!1;return O===-1?S?"/":".":S&&O===1?"//":T.slice(0,O)},"dirname"),basename:i(function(T,R){if(R!==void 0&&typeof R!="string")throw new TypeError('"ext" argument must be a string');_(T);var S,O=0,M=-1,D=!0;if(R!==void 0&&R.length>0&&R.length<=T.length){if(R.length===T.length&&R===T)return"";var z=R.length-1,B=-1;for(S=T.length-1;S>=0;--S){var Z=T.charCodeAt(S);if(Z===47){if(!D){O=S+1;break}}else B===-1&&(D=!1,B=S+1),z>=0&&(Z===R.charCodeAt(z)?--z==-1&&(M=S):(z=-1,M=B))}return O===M?M=B:M===-1&&(M=T.length),T.slice(O,M)}for(S=T.length-1;S>=0;--S)if(T.charCodeAt(S)===47){if(!D){O=S+1;break}}else M===-1&&(D=!1,M=S+1);return M===-1?"":T.slice(O,M)},"basename"),extname:i(function(T){_(T);for(var R=-1,S=0,O=-1,M=!0,D=0,z=T.length-1;z>=0;--z){var B=T.charCodeAt(z);if(B!==47)O===-1&&(M=!1,O=z+1),B===46?R===-1?R=z:D!==1&&(D=1):R!==-1&&(D=-1);else if(!M){S=z+1;break}}return R===-1||O===-1||D===0||D===1&&R===O-1&&R===S+1?"":T.slice(R,O)},"extname"),format:i(function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function(R,S){var O=S.dir||S.root,M=S.base||(S.name||"")+(S.ext||"");return O?O===S.root?O+M:O+"/"+M:M})(0,T)},"format"),parse:i(function(T){_(T);var R={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return R;var S,O=T.charCodeAt(0),M=O===47;M?(R.root="/",S=1):S=0;for(var D=-1,z=0,B=-1,Z=!0,J=T.length-1,te=0;J>=S;--J)if((O=T.charCodeAt(J))!==47)B===-1&&(Z=!1,B=J+1),O===46?D===-1?D=J:te!==1&&(te=1):D!==-1&&(te=-1);else if(!Z){z=J+1;break}return D===-1||B===-1||te===0||te===1&&D===B-1&&D===z+1?B!==-1&&(R.base=R.name=z===0&&M?T.slice(1,B):T.slice(z,B)):(z===0&&M?(R.name=T.slice(1,D),R.base=T.slice(1,B)):(R.name=T.slice(z,D),R.base=T.slice(z,B)),R.ext=T.slice(D,B)),z>0?R.dir=T.slice(0,z-1):M&&(R.dir="/"),R},"parse"),sep:"/",delimiter:":",win32:null,posix:null};E.posix=E,P.exports=E}},t={};function r(P){var _=t[P];if(_!==void 0)return _.exports;var g=t[P]={exports:{}};return e[P](g,g.exports,r),g.exports}i(r,"r"),r.d=(P,_)=>{for(var g in _)r.o(_,g)&&!r.o(P,g)&&Object.defineProperty(P,g,{enumerable:!0,get:_[g]})},r.o=(P,_)=>Object.prototype.hasOwnProperty.call(P,_),r.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:i(()=>h,"URI"),Utils:i(()=>Ne,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,l=/^\/\//;function c(P,_){if(!P.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${P.authority}", path: "${P.path}", query: "${P.query}", fragment: "${P.fragment}"}`);if(P.scheme&&!s.test(P.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(P.path){if(P.authority){if(!o.test(P.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(P.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}i(c,"a");const u="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static{i(this,"l")}static isUri(_){return _ instanceof h||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}scheme;authority;path;query;fragment;constructor(_,g,E,T,R,S=!1){typeof _=="object"?(this.scheme=_.scheme||u,this.authority=_.authority||u,this.path=_.path||u,this.query=_.query||u,this.fragment=_.fragment||u):(this.scheme=(function(O,M){return O||M?O:"file"})(_,S),this.authority=g||u,this.path=(function(O,M){switch(O){case"https":case"http":case"file":M?M[0]!==f&&(M=f+M):M=f}return M})(this.scheme,E||u),this.query=T||u,this.fragment=R||u,c(this,S))}get fsPath(){return I(this,!1)}with(_){if(!_)return this;let{scheme:g,authority:E,path:T,query:R,fragment:S}=_;return g===void 0?g=this.scheme:g===null&&(g=u),E===void 0?E=this.authority:E===null&&(E=u),T===void 0?T=this.path:T===null&&(T=u),R===void 0?R=this.query:R===null&&(R=u),S===void 0?S=this.fragment:S===null&&(S=u),g===this.scheme&&E===this.authority&&T===this.path&&R===this.query&&S===this.fragment?this:new v(g,E,T,R,S)}static parse(_,g=!1){const E=d.exec(_);return E?new v(E[2]||u,H(E[4]||u),H(E[5]||u),H(E[7]||u),H(E[9]||u),g):new v(u,u,u,u,u)}static file(_){let g=u;if(a&&(_=_.replace(/\\/g,f)),_[0]===f&&_[1]===f){const E=_.indexOf(f,2);E===-1?(g=_.substring(2),_=f):(g=_.substring(2,E),_=_.substring(E)||f)}return new v("file",g,_,u,u)}static from(_){const g=new v(_.scheme,_.authority,_.path,_.query,_.fragment);return c(g,!0),g}toString(_=!1){return A(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof h)return _;{const g=new v(_);return g._formatted=_.external,g._fsPath=_._sep===y?_.fsPath:null,g}}return _}}const y=a?1:void 0;class v extends h{static{i(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(_=!1){return _?A(this,!0):(this._formatted||(this._formatted=A(this,!1)),this._formatted)}toJSON(){const _={$mid:1};return this._fsPath&&(_.fsPath=this._fsPath,_._sep=y),this._formatted&&(_.external=this._formatted),this.path&&(_.path=this.path),this.scheme&&(_.scheme=this.scheme),this.authority&&(_.authority=this.authority),this.query&&(_.query=this.query),this.fragment&&(_.fragment=this.fragment),_}}const C={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(P,_,g){let E,T=-1;for(let R=0;R=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||_&&S===47||g&&S===91||g&&S===93||g&&S===58)T!==-1&&(E+=encodeURIComponent(P.substring(T,R)),T=-1),E!==void 0&&(E+=P.charAt(R));else{E===void 0&&(E=P.substr(0,R));const O=C[S];O!==void 0?(T!==-1&&(E+=encodeURIComponent(P.substring(T,R)),T=-1),E+=O):T===-1&&(T=R)}}return T!==-1&&(E+=encodeURIComponent(P.substring(T))),E!==void 0?E:P}i(b,"m");function w(P){let _;for(let g=0;g1&&P.scheme==="file"?`//${P.authority}${P.path}`:P.path.charCodeAt(0)===47&&(P.path.charCodeAt(1)>=65&&P.path.charCodeAt(1)<=90||P.path.charCodeAt(1)>=97&&P.path.charCodeAt(1)<=122)&&P.path.charCodeAt(2)===58?_?P.path.substr(1):P.path[1].toLowerCase()+P.path.substr(2):P.path,a&&(g=g.replace(/\//g,"\\")),g}i(I,"v");function A(P,_){const g=_?w:b;let E="",{scheme:T,authority:R,path:S,query:O,fragment:M}=P;if(T&&(E+=T,E+=":"),(R||T==="file")&&(E+=f,E+=f),R){let D=R.indexOf("@");if(D!==-1){const z=R.substr(0,D);R=R.substr(D+1),D=z.lastIndexOf(":"),D===-1?E+=g(z,!1,!1):(E+=g(z.substr(0,D),!1,!1),E+=":",E+=g(z.substr(D+1),!1,!0)),E+="@"}R=R.toLowerCase(),D=R.lastIndexOf(":"),D===-1?E+=g(R,!1,!0):(E+=g(R.substr(0,D),!1,!0),E+=R.substr(D))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){const D=S.charCodeAt(1);D>=65&&D<=90&&(S=`/${String.fromCharCode(D+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){const D=S.charCodeAt(0);D>=65&&D<=90&&(S=`${String.fromCharCode(D+32)}:${S.substr(2)}`)}E+=g(S,!0,!1)}return O&&(E+="?",E+=g(O,!1,!1)),M&&(E+="#",E+=_?M:b(M,!1,!1)),E}i(A,"b");function k(P){try{return decodeURIComponent(P)}catch{return P.length>3?P.substr(0,3)+k(P.substr(3)):P}}i(k,"C");const G=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function H(P){return P.match(G)?P.replace(G,(_=>k(_))):P}i(H,"w");var X=r(975);const le=X.posix||X,ce="/";var Ne;(function(P){P.joinPath=function(_,...g){return _.with({path:le.join(_.path,...g)})},P.resolvePath=function(_,...g){let E=_.path,T=!1;E[0]!==ce&&(E=ce+E,T=!0);let R=le.resolve(E,...g);return T&&R[0]===ce&&!_.authority&&(R=R.substring(1)),_.with({path:R})},P.dirname=function(_){if(_.path.length===0||_.path===ce)return _;let g=le.dirname(_.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),_.with({path:g})},P.basename=function(_){return le.basename(_.path)},P.extname=function(_){return le.extname(_.path)}})(Ne||(Ne={})),GS=n})();var{URI:ft,Utils:Ci}=GS,Ye;(function(e){e.basename=Ci.basename,e.dirname=Ci.dirname,e.extname=Ci.extname,e.joinPath=Ci.joinPath,e.resolvePath=Ci.resolvePath;const t=typeof process=="object"&&process?.platform==="win32";function r(o,l){return o?.toString()===l?.toString()}i(r,"equals"),e.equals=r;function n(o,l){const c=typeof o=="string"?ft.parse(o).path:o.path,u=typeof l=="string"?ft.parse(l).path:l.path,f=c.split("/").filter(C=>C.length>0),d=u.split("/").filter(C=>C.length>0);if(t){const C=/^[A-Z]:$/;if(f[0]&&C.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&C.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return u.substring(1)}let h=0;for(;h({name:n.name,uri:Ye.joinPath(ft.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(Ye.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(const a of r){let s=n.children.get(a);if(!s)if(t)s={name:a,children:new Map,parent:n},n.children.set(a,s);else return;n=s}return n}collectValues(e){const t=[];e.element&&t.push(e.element);for(const r of e.children.values())t.push(...this.collectValues(r));return t}},Y;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(Y||(Y={}));var jS=class{static{i(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=pe.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??ft.parse(e.uri),pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){const n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{const n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{const n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let a;if(r)a={parseResult:e,uri:t,state:Y.Parsed,references:[],textDocument:r};else{const s=this.createTextDocumentGetter(t,n);a={parseResult:e,uri:t,state:Y.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,t){const r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),a=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return r!==a&&(e.parseResult=await this.parseAsync(e.uri,a,t),e.parseResult.value.$document=e),e.state=Y.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let n;return()=>n??(n=hl.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},US=class{static{i(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new yh,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return oe(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,Y.Changed),r}deleteDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=Y.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){const t=e.toString(),r=this.documentTrie.findAll(t);for(const n of r)n.state=Y.Changed;return this.documentTrie.delete(t),r}},an=Symbol("RefResolving"),zS=class{static{i(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=pe.CancellationToken.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const n of Mt(e.parseResult.value))await Ge(t),Da(n).forEach(a=>{const s=`${n.$type}:${a.property}`;r.startSubTask(s);try{this.doLink(a,e)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(const r of Mt(e.parseResult.value))await Ge(t),Da(r).forEach(n=>this.doLink(n,e))}doLink(e,t){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=an;try{const n=this.getCandidate(e);if(ln(n))r._ref=n;else{r._nodeDescription=n;const a=this.loadAstNode(n);r._ref=a??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);const a=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${a}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=an;try{const n=this.getCandidates(e),a=[];if(ln(n))r._linkingError=n;else for(const s of n){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}r._items=a}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(const t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){const a=this,s={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Le(this._ref))return this._ref;if(td(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=an;const o=wa(e).$document,l=a.getLinkedNode({reference:s,container:e,property:t});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:t})}};return s}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(ln(t))return{error:t};const r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=wa(e.container).$document;r&&r.stateLn(t)&&t.isMulti)}findDeclarations(e){if(e){const t=Wd(e),r=e.astNode;if(t&&r){const n=r[t.feature];if(He(n)||Zt(n))return Oo(n);if(Array.isArray(n)){for(const a of n)if((He(a)||Zt(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Oo(a)}}if(r){const n=this.nameProvider.getNameNode(r);if(n&&(n===e||Cd(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(const n of Da(r))if(Zt(n.reference)&&n.reference.items.some(a=>a.ref===e))return n.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const t=this.findDeclarations(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n)??n.$cstNode;a&&r.push(a)}return r}findReferences(e,t){const r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(a=>Ye.equals(a.sourceUri,t.documentUri))),r.push(...n),oe(r)}getSelfReferences(e){const t=this.getSelfNodes(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n);if(a){const s=Dt(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Fa(a),local:!0})}}return r}},Sr=class{static{i(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return ss.sum(oe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?oe(t):Pa}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return oe(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return oe(this.map.keys())}values(){return oe(this.map.values()).flat()}entriesGroupedByKey(){return oe(this.map.entries())}},gl=class{static{i(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},qS=class{static{i(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=Cs,n=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,t);for(const s of r(e))await Ge(n),this.addExportedSymbol(s,a,t);return a}addExportedSymbol(e,t,r){const n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=pe.CancellationToken.None){const r=e.parseResult.value,n=new Sr;for(const a of br(r))await Ge(t),this.addLocalSymbol(a,e,n);return n}addLocalSymbol(e,t,r){const n=e.$container;if(n){const a=this.nameProvider.getName(e);a&&r.add(n,this.descriptions.createDescription(e,a,t))}}},Pf=class{static{i(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},Q1=class{static{i(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?oe(n).concat(this.outerScope.getElements(e)):oe(n)}getAllElements(){let e=oe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},WS=class{static{i(this,"MultiMapScope")}constructor(e,t,r){this.elements=new Sr,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?oe(r).concat(this.outerScope.getElements(e)):oe(r)}getAllElements(){let e=oe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},eF={getElement(){},getElements(){return Pa},getAllElements(){return Pa}},_c=class{static{i(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Th=class extends _c{static{i(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Cc=class extends _c{static{i(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){const a=r();return n.set(t,a),a}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},VS=class extends Cc{static{i(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(const a of n)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{const a=r.concat(n);for(const s of a)this.clear(s)}))}},Rh=class extends Th{static{i(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},HS=class{static{i(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Rh(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),n=Dt(e.container).localSymbols;if(n){let s=e.container;do n.has(s)&&t.push(n.getStream(s).filter(o=>this.reflection.isSubtype(o.type,r))),s=s.$container;while(s)}let a=this.getGlobalScope(r,e);for(let s=t.length-1;s>=0;s--)a=this.createScope(t[s],a);return a}createScope(e,t,r){return new Pf(oe(e),t,r)}createScopeForNodes(e,t,r){const n=oe(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Pf(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new WS(this.indexManager.allElements(e)))}};function $h(e){return typeof e.$comment=="string"}i($h,"isAstNodeWithComment");function Of(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}i(Of,"isIntermediateReference");var YS=class{static{i(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const r=t??{},n=t?.replacer,a=i((o,l)=>this.replacer(o,l,r),"defaultReplacer"),s=n?(o,l)=>n(o,l,a):a;try{return this.currentDocument=Dt(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(He(t)){const l=t.ref,c=r?t.$refText:void 0;if(l){const u=Dt(l);let f="";this.currentDocument&&this.currentDocument!==u&&(o?f=o(u.uri,l):f=u.uri.toString());const d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:c}}else return{$error:t.error?.message??"Could not resolve reference",$refText:c}}else if(Zt(t)){const l=r?t.$refText:void 0,c=[];for(const u of t.items){const f=u.ref,d=Dt(u.ref);let h="";this.currentDocument&&this.currentDocument!==d&&(o?h=o(d.uri,f):h=d.uri.toString());const y=this.astNodeLocator.getAstNodePath(f);c.push(`${h}#${y}`)}return{$refs:c,$refText:l}}else if(Le(t)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(l??(l={...t}),l.$sourceText=t.$cstNode?.text),s){l??(l={...t});const c=this.commentProvider.getComment(t);c&&(l.$comment=c.replace(/\r/g,""))}return l??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=i(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=Kd(e.$cstNode,a).map(t);s.length!==0&&(n[a]=s)}),e}}linkNode(e,t,r,n,a,s){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u{await this.handleException(()=>e.call(t,r,n,a),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(a){if(Xn(a))throw a;console.error(`${t}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);r("error",`${t}: ${s}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=oe(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(n,a,s,o)=>{await this.handleException(()=>e.call(r,n,a,s,o),t,a,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},ZS=Object.freeze({validateNode:!0,validateChildren:!0}),QS=class{static{i(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=pe.CancellationToken.None){const n=e.parseResult,a=[];if(await Ge(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,a,t),t.stopAfterLexingErrors&&a.some(s=>s.data?.code===Et.LexingError)||(this.processParsingErrors(n,a,t),t.stopAfterParsingErrors&&a.some(s=>s.data?.code===Et.ParsingError))||(this.processLinkingErrors(e,a,t),t.stopAfterLinkingErrors&&a.some(s=>s.data?.code===Et.LinkingError))))return a;try{a.push(...await this.validateAst(n.value,t,r))}catch(s){if(Xn(s))throw s;console.error("An error occurred during validation:",s)}return await Ge(r),a}processLexingErrors(e,t,r){const n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of n){const s=a.severity??"error",o={severity:as(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Eh(s),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(const n of e.parserErrors){let a;if(isNaN(n.token.startOffset)){if("previousToken"in n){const s=n.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=os(n.token);if(a){const s={severity:as("error"),range:a,message:n.message,data:An(Et.ParsingError),source:this.getSource()};t.push(s)}}}processLinkingErrors(e,t,r){for(const n of e.references){const a=n.error;if(a){const s={node:a.info.container,range:n.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:Et.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};t.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,t,r=pe.CancellationToken.None){const n=[],a=i((s,o,l)=>{n.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,t,a,r),await this.validateAstNodes(e,t,a,r),await this.validateAstAfter(e,t,a,r),n}async validateAstBefore(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Ge(n),await s(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=pe.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=Mt(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,t);if(l.validateNode)try{const c=this.validationRegistry.getChecks(o.$type,t.categories);for(const u of c)await u(o,r,n)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=Mt(e).iterator();for(const s of a){await Ge(n);const o=this.validateSingleNodeOptions(s,t);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,t.categories);for(const c of l)await c(s,r,n)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,t){return ZS}async validateAstAfter(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Ge(n),await s(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:Ah(r),severity:as(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Ah(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Dl(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=qd(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}i(Ah,"getDiagnosticRange");function as(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}i(as,"toDiagnosticSeverity");function Eh(e){switch(e){case"error":return An(Et.LexingError);case"warning":return An(Et.LexingWarning);case"info":return An(Et.LexingInfo);case"hint":return An(Et.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}i(Eh,"toDiagnosticData");var Et;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(Et||(Et={}));var eb=class{static{i(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const n=r??Dt(e);t??(t=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${a} has no name.`);let s;const o=i(()=>s??(s=Fa(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Fa(e.$cstNode),type:e.$type,documentUri:n.uri,path:a}}},tb=class{static{i(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=pe.CancellationToken.None){const r=[],n=e.parseResult.value;for(const a of Mt(n))await Ge(t),Da(a).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode)return[];let r=[];He(t)&&t.$nodeDescription?r=[t.$nodeDescription]:Zt(t)&&(r=t.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const n=Dt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Fa(t.$refNode);for(const l of r)s.push({sourceUri:n,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Ye.equals(l.documentUri,n)});return s}},rb=class{static{i(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,a)=>{if(!n||a.length===0)return n;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return n[o]?.[l]}return n[a]},e)}},Sc={};Rl(Sc,Jf(Ka()));var nb=class{static{i(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new Cr,this.onConfigurationSectionUpdateEmitter=new Sc.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,a)=>{this.updateSectionConfiguration(n.section,r[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},Xs=Jf(Lw()),Cn;(function(e){function t(r){return{dispose:i(async()=>await r(),"dispose")}}i(t,"create"),e.create=t})(Cn||(Cn={}));var ab=class{static{i(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Sr,this.documentPhaseListeners=new Sr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Y.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=pe.CancellationToken.None){for(const n of e){const a=n.uri.toString();if(n.state===Y.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,Y.IndexedReferences);else if(typeof t.validation=="object"){const s=this.findMissingValidationCategories(n,t);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),n.state=Y.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=Y.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=pe.CancellationToken.None){this.currentState=Y.Changed;const n=[];for(const l of t){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)n.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=Y.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,Y.Changed)}const s=oe(a).concat(n).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Y.ComputedScopes)),await this.emitUpdate(a,n),await Ge(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,t){const r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,s=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return oe(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Cn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case Y.Changed:case Y.Parsed:this.indexManager.removeContent(e.uri);case Y.IndexedContent:e.localSymbols=void 0;case Y.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Y.Linked:this.indexManager.removeReferences(e.uri);case Y.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Y.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Y.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,Y.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,Y.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,Y.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,r)});const n=e.filter(s=>this.shouldLink(s));await this.runCancelable(n,Y.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(n,Y.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Y.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(const r of e){const n=r.uri.toString(),a=this.buildState.get(n);(!a||a.completed)&&this.buildState.set(n,{completed:!1,options:t,result:a?.result})}}async runCancelable(e,t,r,n){for(const s of e)s.states.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Cn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Cn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=pe.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){const n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(Jt);if(this.currentState>=e&&e>n.state)return Promise.reject(new Xs.ResponseError(Xs.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${Y[n.state]}, requiring ${Y[e]}, but workspace state is already ${Y[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Xs.ResponseError(Xs.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Ye.equals(c.uri,t)&&(o.dispose(),l.dispose(),a(c.uri))}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Jt)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(Jt):new Promise((r,n)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),r()}),s=t.onCancellationRequested(()=>{a.dispose(),s.dispose(),n(Jt)})})}async notifyDocumentPhase(e,t,r){const a=this.documentPhaseListeners.get(t).slice();for(const s of a)try{await Ge(r),await s(e,r)}catch(o){if(!Xn(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const a=this.buildPhaseListeners.get(t).slice();for(const s of a)await Ge(r),await s(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),a=typeof n.validation=="object"?{...n.validation}:{};a.categories=this.findMissingValidationCategories(e,n);const s=await r.validateDocument(e,a,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=oe(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},ib=class{static{i(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Cc,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=Dt(e).uri,n=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Ye.equals(s.targetUri,r)&&s.targetPath===t&&n.push(s)})}),oe(n)}allElements(e,t){let r=oe(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),a=e.uri.toString();this.symbolIndex.set(a,n),this.symbolByTypeIndex.clear(a)}async updateReferences(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},sb=class{static{i(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new Cr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=pe.CancellationToken.None){const r=await this.performStartup(e);await Ge(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=[],r=i(s=>{t.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,r);const n=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,n)));const a=oe(n).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{const n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return ft.parse(e.uri)}async traverseFolder(e,t){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){const t=Ye.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},ob=class{static{i(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,a){return df.buildUnexpectedCharactersMessage(e,t,r,n,a)}buildUnableToPopLexerModeMessage(e){return df.buildUnableToPopLexerModeMessage(e)}},_h={mode:"full"},Ch=class{static{i(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=vl(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Xe(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=_h){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(vl(e))return e;const t=wc(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};function bc(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}i(bc,"isTokenTypeArray");function wc(e){return e&&"modes"in e&&"defaultMode"in e}i(wc,"isIMultiModeLexerDefinition");function vl(e){return!bc(e)&&!wc(e)}i(vl,"isTokenTypeDictionary");Es();function Sh(e,t,r){let n,a;typeof e=="string"?(a=t,n=r):(a=e.range.start,n=t),a||(a=ie.create(0,0));const s=wh(e),o=Ic(n),l=lb({lines:s,position:a,options:o});return fb({index:0,tokens:l,position:a})}i(Sh,"parseJSDoc");function bh(e,t){const r=Ic(t),n=wh(e);if(n.length===0)return!1;const a=n[0],s=n[n.length-1],o=r.start,l=r.end;return!!o?.exec(a)&&!!l?.exec(s)}i(bh,"isJSDoc");function wh(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(cy)}i(wh,"getLines");var ag=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,tF=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function lb(e){const t=[];let r=e.position.line,n=e.position.character;for(let a=0;a=l.length){if(t.length>0){const f=ie.create(r,n);t.push({type:"break",content:"",range:ee.create(f,f)})}}else{ag.lastIndex=c;const f=ag.exec(l);if(f){const d=f[0],h=f[1],y=ie.create(r,n+c),v=ie.create(r,n+c+d.length);t.push({type:"tag",content:h,range:ee.create(y,v)}),c+=d.length,c=Tl(l,c)}if(c0&&t[t.length-1].type==="break"?t.slice(0,-1):t}i(lb,"tokenize");function cb(e,t,r,n){const a=[];if(e.length===0){const s=ie.create(r,n),o=ie.create(r,n+t.length);a.push({type:"text",content:t,range:ee.create(s,o)})}else{let s=0;for(const l of e){const c=l.index,u=t.substring(s,c);u.length>0&&a.push({type:"text",content:t.substring(s,c),range:ee.create(ie.create(r,s+n),ie.create(r,c+n))});let f=u.length+1;const d=l[1];if(a.push({type:"inline-tag",content:d,range:ee.create(ie.create(r,s+f+n),ie.create(r,s+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;const h=l[3];a.push({type:"text",content:h,range:ee.create(ie.create(r,s+f+n),ie.create(r,s+f+h.length+n))})}else a.push({type:"text",content:"",range:ee.create(ie.create(r,s+f+n),ie.create(r,s+f+n))});s=c+l[0].length}const o=t.substring(s);o.length>0&&a.push({type:"text",content:o,range:ee.create(ie.create(r,s+n),ie.create(r,s+n+o.length))})}return a}i(cb,"buildInlineTokens");var rF=/\S/,nF=/\s*$/;function Tl(e,t){const r=e.substring(t).match(rF);return r?t+r.index:e.length}i(Tl,"skipWhitespace");function ub(e){const t=e.match(nF);if(t&&typeof t.index=="number")return t.index}i(ub,"lastCharacter");function fb(e){const t=ie.create(e.position.line,e.position.character);if(e.tokens.length===0)return new ig([],ee.create(t,t));const r=[];for(;e.indext.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=Df(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const n=r.toMarkdown(e);t+=Df(t)+n}return t.trim()}},Gc=class{static{i(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} +${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const a=mb(this.name,t,e??{});if(typeof a=="string")return a}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} — ${t}`:this.content.inlines.length>1&&(n=`${n} +${t}`),this.inline?`{${n}}`:n}};function mb(e,t,r){if(e==="linkplain"||e==="linkcode"||e==="link"){const n=t.indexOf(" ");let a=t;if(n>0){const o=Tl(t,n);a=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(t,a)??gb(t,a)}}i(mb,"renderInlineTag");function gb(e,t){try{return ft.parse(e,!0),`[${t}](${e})`}catch{return e}}i(gb,"renderLinkDefault");var Lf=class{static{i(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` +`)}return t}},yb=class{static{i(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function Df(e){return e.endsWith(` +`)?` +`:` + +`}i(Df,"fillNewlines");var vb=class{static{i(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&bh(t))return Sh(t).toMarkdown({renderLink:i((n,a)=>this.documentationLinkRenderer(e,n,a),"renderLink"),renderTag:i(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){const n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){const a=n.nameSegment.range.start.line+1,s=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${a},${s}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){const n=Dt(e).localSymbols;if(!n)return;let a=e;do{const o=n.getStream(a).find(l=>l.name===t);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},Tb=class{static{i(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return $h(e)?e.$comment:Id(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},Rb=class{static{i(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},aF=class{static{i(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){const r=await this.acquireParserWorker(t),n=new Cr;let a;const s=t.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{const l=this.hydrator.hydrate(o);n.resolve(l)}).catch(o=>{n.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),n.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(const r of this.workerPool)if(r.ready)return r.lock(),r;const t=new Cr;return e.onCancellationRequested(()=>{const r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(Jt)}),this.queue.push(t),t.promise}},iF=class{static{i(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new Sc.Emitter,this.deferred=new Cr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),r(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Jt),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Cr,this.sendMessage(e),this.deferred.promise}},$b=class{static{i(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=Ec();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=pe.CancellationToken.None){const n=new Cr,a={action:t,deferred:n,cancellationToken:r};return e.push(a),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{const a=await Promise.resolve().then(()=>t(n));r.resolve(a)}catch(a){Xn(a)?r.resolve(void 0):r.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Ab=class{static{i(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new gl,this.tokenTypeIdMap=new gl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const n of Mt(e))t.set(n,{});if(e.$cstNode)for(const n of xa(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Le(o)?s.push(this.dehydrateAstNode(o,t)):He(o)?s.push(this.dehydrateReference(o,t)):s.push(o)}else Le(a)?r[n]=this.dehydrateAstNode(a,t):He(a)?r[n]=this.dehydrateReference(a,t):a!==void 0&&(r[n]=a);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return El(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),yr(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):kn(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const a of Mt(e))t.set(a,{});let n;if(e.$cstNode)for(const a of xa(e.$cstNode)){let s;"fullText"in a?(s=new ih(a.fullText),n=s):"content"in a?s=new vc:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(r.set(a,s),s.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Le(o)?s.push(this.setParent(this.hydrateAstNode(o,t),r)):He(o)?s.push(this.hydrateReference(o,r,n,t)):s.push(o)}else Le(a)?r[n]=this.setParent(this.hydrateAstNode(a,t),r):He(a)?r[n]=this.hydrateReference(a,r,n,t):a!==void 0&&(r[n]=a);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),yr(n))for(const a of e.content){const s=this.hydrateCstNode(a,t,r++);n.content.push(s)}return n}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,c=e.hidden;return new fl(r,n,{start:{line:a,character:s},end:{line:o,character:l}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Mt(this.grammar))_l(t)&&this.grammarElementIdMap.set(t,e++)}};function yt(e){return{documentation:{CommentProvider:i(t=>new Tb(t),"CommentProvider"),DocumentationProvider:i(t=>new vb(t),"DocumentationProvider")},parser:{AsyncParser:i(t=>new Rb(t),"AsyncParser"),GrammarConfig:i(t=>Qd(t),"GrammarConfig"),LangiumParser:i(t=>fh(t),"LangiumParser"),CompletionParser:i(t=>uh(t),"CompletionParser"),ValueConverter:i(()=>new ph,"ValueConverter"),TokenBuilder:i(()=>new $c,"TokenBuilder"),Lexer:i(t=>new Ch(t),"Lexer"),ParserErrorMessageProvider:i(()=>new oh,"ParserErrorMessageProvider"),LexerErrorMessageProvider:i(()=>new ob,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:i(()=>new rb,"AstNodeLocator"),AstNodeDescriptionProvider:i(t=>new eb(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:i(t=>new tb(t),"ReferenceDescriptionProvider")},references:{Linker:i(t=>new zS(t),"Linker"),NameProvider:i(()=>new BS,"NameProvider"),ScopeProvider:i(t=>new HS(t),"ScopeProvider"),ScopeComputation:i(t=>new qS(t),"ScopeComputation"),References:i(t=>new KS(t),"References")},serializer:{Hydrator:i(t=>new Ab(t),"Hydrator"),JsonSerializer:i(t=>new YS(t),"JsonSerializer")},validation:{DocumentValidator:i(t=>new QS(t),"DocumentValidator"),ValidationRegistry:i(t=>new JS(t),"ValidationRegistry")},shared:i(()=>e.shared,"shared")}}i(yt,"createDefaultCoreModule");function vt(e){return{ServiceRegistry:i(t=>new XS(t),"ServiceRegistry"),workspace:{LangiumDocuments:i(t=>new US(t),"LangiumDocuments"),LangiumDocumentFactory:i(t=>new jS(t),"LangiumDocumentFactory"),DocumentBuilder:i(t=>new ab(t),"DocumentBuilder"),IndexManager:i(t=>new ib(t),"IndexManager"),WorkspaceManager:i(t=>new sb(t),"WorkspaceManager"),FileSystemProvider:i(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:i(()=>new $b,"WorkspaceLock"),ConfigurationProvider:i(t=>new nb(t),"ConfigurationProvider")},profilers:{}}}i(vt,"createDefaultSharedCoreModule");var Mf;(function(e){e.merge=(t,r)=>Ba(Ba({},t),r)})(Mf||(Mf={}));function Ae(e,t,r,n,a,s,o,l,c){const u=[e,t,r,n,a,s,o,l,c].reduce(Ba,{});return Oh(u)}i(Ae,"inject");var Eb=Symbol("isProxy");function Ph(e){if(e&&e[Eb])for(const t of Object.values(e))Ph(t);return e}i(Ph,"eagerLoad");function Oh(e,t){const r=new Proxy({},{deleteProperty:i(()=>!1,"deleteProperty"),set:i(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:i((n,a)=>a===Eb?!0:xf(n,a,e,t||r),"get"),getOwnPropertyDescriptor:i((n,a)=>(xf(n,a,e,t||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:i((n,a)=>a in e,"has"),ownKeys:i(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}i(Oh,"_inject");var sg=Symbol();function xf(e,t,r,n){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===sg)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){const a=r[t];e[t]=sg;try{e[t]=typeof a=="function"?a(n):Oh(a,n)}catch(s){throw e[t]=s instanceof Error?s:void 0,s}return e[t]}else return}i(xf,"_resolve");function Ba(e,t){if(t){for(const[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){const a=e[r];typeof a=="object"&&a!==null?e[r]=Ba(a,n):e[r]=Ba({},n)}else e[r]=n}return e}i(Ba,"_merge");var Ff={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},En;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(En||(En={}));var _b=class extends $c{static{i(this,"IndentationAwareTokenBuilder")}constructor(e=Ff){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...Ff,...e},this.indentTokenType=Na({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Na({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){const r=super.buildTokens(e,t);if(!bc(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,c,u;const f=[];for(const d of r){for(const[h,y]of o)d.name===h?d.PUSH_MODE=En.IGNORE_INDENTATION:d.name===y&&(d.POP_MODE=!0);d.name===a?l=d:d.name===n?c=d:d.name===s?u=d:f.push(d)}if(!l||!c||!u)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[En.REGULAR]:[l,c,...f,u],[En.IGNORE_INDENTATION]:[...f,u]},defaultMode:En.REGULAR}:[l,c,u,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r +`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:a?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,t,r,n){const a=this.getLineNumber(t,n);return Gs(e,r,n,n+r.length,a,a,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;const c=this.indentationStack.length-l-1,u=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},sF=class extends Ch{static{i(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof _b)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=_h){const r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,c=[],u=r.tokens.length-1;for(let f=0;f=0&&c.push(r.tokens[u]),r.tokens=c,r}},Lh={};Br(Lh,{AstUtils:()=>nd,BiMap:()=>gl,Cancellation:()=>pe,ContextCache:()=>Cc,CstUtils:()=>ed,DONE_RESULT:()=>Ve,Deferred:()=>Cr,Disposable:()=>Cn,DisposableCache:()=>_c,DocumentCache:()=>VS,EMPTY_STREAM:()=>Pa,ErrorWithLocation:()=>kl,GrammarUtils:()=>Od,MultiMap:()=>Sr,OperationCancelled:()=>Jt,Reduction:()=>ss,RegExpUtils:()=>Dd,SimpleCache:()=>Th,StreamImpl:()=>Xt,TreeStreamImpl:()=>Oa,URI:()=>ft,UriTrie:()=>yh,UriUtils:()=>Ye,WorkspaceCache:()=>Rh,assertCondition:()=>Ld,assertUnreachable:()=>Kr,delayNextTick:()=>Ac,interruptAndCheck:()=>Ge,isOperationCancelled:()=>Xn,loadGrammarFromJson:()=>Tt,setInterruptionPeriod:()=>hh,startCancelableOperation:()=>Ec,stream:()=>oe});Rl(Lh,Sc);var Cb=class{static{i(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},It={fileSystemProvider:i(()=>new Cb,"fileSystemProvider")},oF={Grammar:i(()=>{},"Grammar"),LanguageMetaData:i(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},lF={AstReflection:i(()=>new _d,"AstReflection")};function Sb(){const e=Ae(vt(It),lF),t=Ae(yt({shared:e}),oF);return e.ServiceRegistry.register(t),t}i(Sb,"createMinimalGrammarServices");function Tt(e){const t=Sb(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,ft.parse(`memory:/${r.name??"grammar"}.langium`)),r}i(Tt,"loadGrammarFromJson");Rl(Lg,Lh);var cF=class{static{i(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Sr}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new bb(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const r=[];for(const s of t.entries.keys()){const o=t.entries.get(s),l=o.reduce((c,u)=>c+u);r.push({name:`${t.identifier}.${s}`,count:o.length,duration:l})}const n=t.duration-r.map(s=>s.duration).reduce((s,o)=>s+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return i(a,"Round"),console.table(r.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/t.duration),"Time (ms)":a(s.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},bb=class{static{i(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new Sr,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);const r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);const n=r-t.content;this.entries.add(e,n)}},Gf;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(Gf||(Gf={}));var jf;(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(jf||(jf={}));var Uf;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Uf||(Uf={}));var zf;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(zf||(zf={}));var Bf;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Bf||(Bf={}));var Kf;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Kf||(Kf={}));var qf;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(qf||(qf={}));var Wf;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Wf||(Wf={}));var Vf;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(Vf||(Vf={}));var Hf;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Hf||(Hf={}));({...Gf.Terminals,...jf.Terminals,...Uf.Terminals,...zf.Terminals,...Bf.Terminals,...Kf.Terminals,...qf.Terminals,...Vf.Terminals,...Wf.Terminals,...Hf.Terminals});var Js={$type:"Accelerator",name:"name",x:"x",y:"y"},Zs={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Si={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},jc={$type:"Annotations",x:"x",y:"y"},dr={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function uF(e){return Rt.isInstance(e,dr.$type)}i(uF,"isArchitecture");var Qs={$type:"Axis",label:"label",name:"name"},ko={$type:"Branch",name:"name",order:"order"};function fF(e){return Rt.isInstance(e,ko.$type)}i(fF,"isBranch");var og={$type:"Checkout",branch:"branch"},eo={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Uc={$type:"ClassDefStatement",className:"className",styleText:"styleText"},ma={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function dF(e){return Rt.isInstance(e,ma.$type)}i(dF,"isCommit");var to={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Yr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},ro={$type:"Curve",entries:"entries",label:"label",name:"name"},no={$type:"Deaccelerator",name:"name",x:"x",y:"y"},lg={$type:"Decorator",strategy:"strategy"},ia={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},qt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},sa={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Xr={$type:"EmFrame"},bi={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},cg={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},zc={$type:"EmModelEntity",name:"name"};function pF(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}i(pF,"isEmModelEntityType");var ao={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},pr={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function hF(e){return Rt.isInstance(e,pr.$type)}i(hF,"isEmResetFrame");var Pr={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},Bc={$type:"Entry",axis:"axis",value:"value"},cr={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},ug={$type:"Evolution",stages:"stages"},io={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},Kc={$type:"Evolve",component:"component",target:"target"},sn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function mF(e){return Rt.isInstance(e,sn.$type)}i(mF,"isGitGraph");var wi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Bi={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function gF(e){return Rt.isInstance(e,Bi.$type)}i(gF,"isInfo");var Ii={$type:"Item",classSelector:"classSelector",name:"name"},qc={$type:"Junction",id:"id",in:"in"},Ni={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},so={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Jr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},ga={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function yF(e){return Rt.isInstance(e,ga.$type)}i(yF,"isMerge");var oo={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},Wc={$type:"Option",name:"name",value:"value"},ya={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function vF(e){return Rt.isInstance(e,ya.$type)}i(vF,"isPacket");var va={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function TF(e){return Rt.isInstance(e,va.$type)}i(TF,"isPacketBlock");var on={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function RF(e){return Rt.isInstance(e,on.$type)}i(RF,"isPie");var Po={$type:"PieSection",label:"label",value:"value"};function $F(e){return Rt.isInstance(e,Po.$type)}i($F,"isPieSection");var Vc={$type:"Pipeline",components:"components",parent:"parent"},lo={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Zr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Hc={$type:"Section",classSelector:"classSelector",name:"name"},oa={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Yc={$type:"Size",height:"height",width:"width"},la={$type:"Statement"},Ta={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function AF(e){return Rt.isInstance(e,Ta.$type)}i(AF,"isTreemap");var Xc={$type:"TreemapRow",indent:"indent",item:"item"},Jc={$type:"TreeNode",indent:"indent",name:"name"},ki={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ue={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function EF(e){return Rt.isInstance(e,Ue.$type)}i(EF,"isWardley");var wb=class extends rd{constructor(){super(...arguments),this.types={Accelerator:{name:Js.$type,properties:{name:{name:Js.name},x:{name:Js.x},y:{name:Js.y}},superTypes:[]},Anchor:{name:Zs.$type,properties:{evolution:{name:Zs.evolution},name:{name:Zs.name},visibility:{name:Zs.visibility}},superTypes:[]},Annotation:{name:Si.$type,properties:{number:{name:Si.number},text:{name:Si.text},x:{name:Si.x},y:{name:Si.y}},superTypes:[]},Annotations:{name:jc.$type,properties:{x:{name:jc.x},y:{name:jc.y}},superTypes:[]},Architecture:{name:dr.$type,properties:{accDescr:{name:dr.accDescr},accTitle:{name:dr.accTitle},edges:{name:dr.edges,defaultValue:[]},groups:{name:dr.groups,defaultValue:[]},junctions:{name:dr.junctions,defaultValue:[]},services:{name:dr.services,defaultValue:[]},title:{name:dr.title}},superTypes:[]},Axis:{name:Qs.$type,properties:{label:{name:Qs.label},name:{name:Qs.name}},superTypes:[]},Branch:{name:ko.$type,properties:{name:{name:ko.name},order:{name:ko.order}},superTypes:[la.$type]},Checkout:{name:og.$type,properties:{branch:{name:og.branch}},superTypes:[la.$type]},CherryPicking:{name:eo.$type,properties:{id:{name:eo.id},parent:{name:eo.parent},tags:{name:eo.tags,defaultValue:[]}},superTypes:[la.$type]},ClassDefStatement:{name:Uc.$type,properties:{className:{name:Uc.className},styleText:{name:Uc.styleText}},superTypes:[]},Commit:{name:ma.$type,properties:{id:{name:ma.id},message:{name:ma.message},tags:{name:ma.tags,defaultValue:[]},type:{name:ma.type}},superTypes:[la.$type]},Common:{name:to.$type,properties:{accDescr:{name:to.accDescr},accTitle:{name:to.accTitle},title:{name:to.title}},superTypes:[]},Component:{name:Yr.$type,properties:{decorator:{name:Yr.decorator},evolution:{name:Yr.evolution},inertia:{name:Yr.inertia,defaultValue:!1},label:{name:Yr.label},name:{name:Yr.name},visibility:{name:Yr.visibility}},superTypes:[]},Curve:{name:ro.$type,properties:{entries:{name:ro.entries,defaultValue:[]},label:{name:ro.label},name:{name:ro.name}},superTypes:[]},Deaccelerator:{name:no.$type,properties:{name:{name:no.name},x:{name:no.x},y:{name:no.y}},superTypes:[]},Decorator:{name:lg.$type,properties:{strategy:{name:lg.strategy}},superTypes:[]},Direction:{name:ia.$type,properties:{accDescr:{name:ia.accDescr},accTitle:{name:ia.accTitle},dir:{name:ia.dir},statements:{name:ia.statements,defaultValue:[]},title:{name:ia.title}},superTypes:[sn.$type]},Edge:{name:qt.$type,properties:{lhsDir:{name:qt.lhsDir},lhsGroup:{name:qt.lhsGroup,defaultValue:!1},lhsId:{name:qt.lhsId},lhsInto:{name:qt.lhsInto,defaultValue:!1},rhsDir:{name:qt.rhsDir},rhsGroup:{name:qt.rhsGroup,defaultValue:!1},rhsId:{name:qt.rhsId},rhsInto:{name:qt.rhsInto,defaultValue:!1},title:{name:qt.title}},superTypes:[]},EmDataEntity:{name:sa.$type,properties:{dataBlockValue:{name:sa.dataBlockValue},dataType:{name:sa.dataType},name:{name:sa.name}},superTypes:[]},EmFrame:{name:Xr.$type,properties:{},superTypes:[]},EmGwt:{name:bi.$type,properties:{givenStatements:{name:bi.givenStatements,defaultValue:[]},sourceFrame:{name:bi.sourceFrame,referenceType:Xr.$type},thenStatements:{name:bi.thenStatements,defaultValue:[]},whenStatements:{name:bi.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:cg.$type,properties:{entityIdentifier:{name:cg.entityIdentifier,referenceType:zc.$type}},superTypes:[]},EmModelEntity:{name:zc.$type,properties:{name:{name:zc.name}},superTypes:[]},EmNoteEntity:{name:ao.$type,properties:{dataBlockValue:{name:ao.dataBlockValue},dataType:{name:ao.dataType},sourceFrame:{name:ao.sourceFrame,referenceType:Xr.$type}},superTypes:[]},EmResetFrame:{name:pr.$type,properties:{dataInlineValue:{name:pr.dataInlineValue},dataReference:{name:pr.dataReference,referenceType:sa.$type},dataType:{name:pr.dataType},entityIdentifier:{name:pr.entityIdentifier},modelEntityType:{name:pr.modelEntityType},name:{name:pr.name},sourceFrames:{name:pr.sourceFrames,defaultValue:[],referenceType:Xr.$type}},superTypes:[Xr.$type]},EmTimeFrame:{name:Pr.$type,properties:{dataInlineValue:{name:Pr.dataInlineValue},dataReference:{name:Pr.dataReference,referenceType:sa.$type},dataType:{name:Pr.dataType},entityIdentifier:{name:Pr.entityIdentifier},modelEntityType:{name:Pr.modelEntityType},name:{name:Pr.name},sourceFrames:{name:Pr.sourceFrames,defaultValue:[],referenceType:Xr.$type}},superTypes:[Xr.$type]},Entry:{name:Bc.$type,properties:{axis:{name:Bc.axis,referenceType:Qs.$type},value:{name:Bc.value}},superTypes:[]},EventModel:{name:cr.$type,properties:{accDescr:{name:cr.accDescr},accTitle:{name:cr.accTitle},dataEntities:{name:cr.dataEntities,defaultValue:[]},frames:{name:cr.frames,defaultValue:[]},gwtEntities:{name:cr.gwtEntities,defaultValue:[]},modelEntities:{name:cr.modelEntities,defaultValue:[]},noteEntities:{name:cr.noteEntities,defaultValue:[]},title:{name:cr.title}},superTypes:[]},Evolution:{name:ug.$type,properties:{stages:{name:ug.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:io.$type,properties:{boundary:{name:io.boundary},name:{name:io.name},secondName:{name:io.secondName}},superTypes:[]},Evolve:{name:Kc.$type,properties:{component:{name:Kc.component},target:{name:Kc.target}},superTypes:[]},GitGraph:{name:sn.$type,properties:{accDescr:{name:sn.accDescr},accTitle:{name:sn.accTitle},statements:{name:sn.statements,defaultValue:[]},title:{name:sn.title}},superTypes:[]},Group:{name:wi.$type,properties:{icon:{name:wi.icon},id:{name:wi.id},in:{name:wi.in},title:{name:wi.title}},superTypes:[]},Info:{name:Bi.$type,properties:{accDescr:{name:Bi.accDescr},accTitle:{name:Bi.accTitle},title:{name:Bi.title}},superTypes:[]},Item:{name:Ii.$type,properties:{classSelector:{name:Ii.classSelector},name:{name:Ii.name}},superTypes:[]},Junction:{name:qc.$type,properties:{id:{name:qc.id},in:{name:qc.in}},superTypes:[]},Label:{name:Ni.$type,properties:{negX:{name:Ni.negX,defaultValue:!1},negY:{name:Ni.negY,defaultValue:!1},offsetX:{name:Ni.offsetX},offsetY:{name:Ni.offsetY}},superTypes:[]},Leaf:{name:so.$type,properties:{classSelector:{name:so.classSelector},name:{name:so.name},value:{name:so.value}},superTypes:[Ii.$type]},Link:{name:Jr.$type,properties:{arrow:{name:Jr.arrow},from:{name:Jr.from},fromPort:{name:Jr.fromPort},linkLabel:{name:Jr.linkLabel},to:{name:Jr.to},toPort:{name:Jr.toPort}},superTypes:[]},Merge:{name:ga.$type,properties:{branch:{name:ga.branch},id:{name:ga.id},tags:{name:ga.tags,defaultValue:[]},type:{name:ga.type}},superTypes:[la.$type]},Note:{name:oo.$type,properties:{evolution:{name:oo.evolution},text:{name:oo.text},visibility:{name:oo.visibility}},superTypes:[]},Option:{name:Wc.$type,properties:{name:{name:Wc.name},value:{name:Wc.value,defaultValue:!1}},superTypes:[]},Packet:{name:ya.$type,properties:{accDescr:{name:ya.accDescr},accTitle:{name:ya.accTitle},blocks:{name:ya.blocks,defaultValue:[]},title:{name:ya.title}},superTypes:[]},PacketBlock:{name:va.$type,properties:{bits:{name:va.bits},end:{name:va.end},label:{name:va.label},start:{name:va.start}},superTypes:[]},Pie:{name:on.$type,properties:{accDescr:{name:on.accDescr},accTitle:{name:on.accTitle},sections:{name:on.sections,defaultValue:[]},showData:{name:on.showData,defaultValue:!1},title:{name:on.title}},superTypes:[]},PieSection:{name:Po.$type,properties:{label:{name:Po.label},value:{name:Po.value}},superTypes:[]},Pipeline:{name:Vc.$type,properties:{components:{name:Vc.components,defaultValue:[]},parent:{name:Vc.parent}},superTypes:[]},PipelineComponent:{name:lo.$type,properties:{evolution:{name:lo.evolution},label:{name:lo.label},name:{name:lo.name}},superTypes:[]},Radar:{name:Zr.$type,properties:{accDescr:{name:Zr.accDescr},accTitle:{name:Zr.accTitle},axes:{name:Zr.axes,defaultValue:[]},curves:{name:Zr.curves,defaultValue:[]},options:{name:Zr.options,defaultValue:[]},title:{name:Zr.title}},superTypes:[]},Section:{name:Hc.$type,properties:{classSelector:{name:Hc.classSelector},name:{name:Hc.name}},superTypes:[Ii.$type]},Service:{name:oa.$type,properties:{icon:{name:oa.icon},iconText:{name:oa.iconText},id:{name:oa.id},in:{name:oa.in},title:{name:oa.title}},superTypes:[]},Size:{name:Yc.$type,properties:{height:{name:Yc.height},width:{name:Yc.width}},superTypes:[]},Statement:{name:la.$type,properties:{},superTypes:[]},TreeNode:{name:Jc.$type,properties:{indent:{name:Jc.indent},name:{name:Jc.name}},superTypes:[]},TreeView:{name:ki.$type,properties:{accDescr:{name:ki.accDescr},accTitle:{name:ki.accTitle},nodes:{name:ki.nodes,defaultValue:[]},title:{name:ki.title}},superTypes:[]},Treemap:{name:Ta.$type,properties:{accDescr:{name:Ta.accDescr},accTitle:{name:Ta.accTitle},title:{name:Ta.title},TreemapRows:{name:Ta.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Xc.$type,properties:{indent:{name:Xc.indent},item:{name:Xc.item}},superTypes:[]},Wardley:{name:Ue.$type,properties:{accDescr:{name:Ue.accDescr},accelerators:{name:Ue.accelerators,defaultValue:[]},accTitle:{name:Ue.accTitle},anchors:{name:Ue.anchors,defaultValue:[]},annotation:{name:Ue.annotation,defaultValue:[]},annotations:{name:Ue.annotations,defaultValue:[]},components:{name:Ue.components,defaultValue:[]},deaccelerators:{name:Ue.deaccelerators,defaultValue:[]},evolution:{name:Ue.evolution},evolves:{name:Ue.evolves,defaultValue:[]},links:{name:Ue.links,defaultValue:[]},notes:{name:Ue.notes,defaultValue:[]},pipelines:{name:Ue.pipelines,defaultValue:[]},size:{name:Ue.size},title:{name:Ue.title}},superTypes:[]}}}static{i(this,"MermaidAstReflection")}},Rt=new wb,fg,_F=i(()=>fg??(fg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),dg,CF=i(()=>dg??(dg=Tt('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),pg,SF=i(()=>pg??(pg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),hg,bF=i(()=>hg??(hg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),mg,wF=i(()=>mg??(mg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),gg,IF=i(()=>gg??(gg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),yg,NF=i(()=>yg??(yg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),vg,kF=i(()=>vg??(vg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Tg,PF=i(()=>Tg??(Tg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n * Converted from treemap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Rg,OF=i(()=>Rg??(Rg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),LF={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},DF={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},MF={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xF={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},FF={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},GF={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jF={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},UF={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zF={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BF={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ir={AstReflection:i(()=>new wb,"AstReflection")},KF={Grammar:i(()=>_F(),"Grammar"),LanguageMetaData:i(()=>LF,"LanguageMetaData"),parser:{}},qF={Grammar:i(()=>CF(),"Grammar"),LanguageMetaData:i(()=>DF,"LanguageMetaData"),parser:{}},WF={Grammar:i(()=>SF(),"Grammar"),LanguageMetaData:i(()=>MF,"LanguageMetaData"),parser:{}},VF={Grammar:i(()=>bF(),"Grammar"),LanguageMetaData:i(()=>xF,"LanguageMetaData"),parser:{}},HF={Grammar:i(()=>wF(),"Grammar"),LanguageMetaData:i(()=>FF,"LanguageMetaData"),parser:{}},YF={Grammar:i(()=>IF(),"Grammar"),LanguageMetaData:i(()=>GF,"LanguageMetaData"),parser:{}},XF={Grammar:i(()=>NF(),"Grammar"),LanguageMetaData:i(()=>jF,"LanguageMetaData"),parser:{}},JF={Grammar:i(()=>kF(),"Grammar"),LanguageMetaData:i(()=>UF,"LanguageMetaData"),parser:{}},ZF={Grammar:i(()=>PF(),"Grammar"),LanguageMetaData:i(()=>zF,"LanguageMetaData"),parser:{}},QF={Grammar:i(()=>OF(),"Grammar"),LanguageMetaData:i(()=>BF,"LanguageMetaData"),parser:{}},eG=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,tG=/accTitle[\t ]*:([^\n\r]*)/,rG=/title([\t ][^\n\r]*|)/,nG={ACC_DESCR:eG,ACC_TITLE:tG,TITLE:rG},ei=class extends ph{static{i(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){const n=nG[e.name];if(n===void 0)return;const a=n.exec(t);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},Bs=class extends ei{static{i(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},sr=class extends $c{static{i(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const n=super.buildKeywordTokens(e,t,r);return n.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends sr{static{i(this,"CommonTokenBuilder")}});/*! Bundled license information: + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var aG=class extends sr{static{i(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Ib={parser:{TokenBuilder:i(()=>new aG,"TokenBuilder"),ValueConverter:i(()=>new Bs,"ValueConverter")}};function Nb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),XF,Ib);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}i(Nb,"createRadarServices");var iG=class extends sr{static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},sG=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,oG=class extends ei{static{i(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;const n=sG.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function kb(e){const t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){const n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}i(kb,"registerValidationChecks");var lG=class{static{i(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(const n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},Pb={parser:{TokenBuilder:i(()=>new iG,"TokenBuilder"),ValueConverter:i(()=>new oG,"ValueConverter")},validation:{TreemapValidator:i(()=>new lG,"TreemapValidator")}};function Ob(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),JF,Pb);return t.ServiceRegistry.register(r),kb(r),{shared:t,Treemap:r}}i(Ob,"createTreemapServices");var cG=class extends ei{static{i(this,"WardleyValueConverter")}runCustomConverter(e,t,r){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return}}},Lb={parser:{ValueConverter:i(()=>new cG,"ValueConverter")}};function Db(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),QF,Lb);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}i(Db,"createWardleyServices");var uG=class extends sr{static{i(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Mb={parser:{TokenBuilder:i(()=>new uG,"TokenBuilder"),ValueConverter:i(()=>new Bs,"ValueConverter")}};function xb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),WF,Mb);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}i(xb,"createGitGraphServices");var fG=class extends sr{static{i(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Fb={parser:{TokenBuilder:i(()=>new fG,"TokenBuilder"),ValueConverter:i(()=>new Bs,"ValueConverter")}};function Gb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),VF,Fb);return t.ServiceRegistry.register(r),{shared:t,Info:r}}i(Gb,"createInfoServices");var dG=class extends sr{static{i(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},jb={parser:{TokenBuilder:i(()=>new dG,"TokenBuilder"),ValueConverter:i(()=>new Bs,"ValueConverter")}};function Ub(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),HF,jb);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}i(Ub,"createPacketServices");var pG=class extends sr{static{i(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},hG=class extends ei{static{i(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},zb={parser:{TokenBuilder:i(()=>new pG,"TokenBuilder"),ValueConverter:i(()=>new hG,"ValueConverter")}};function Bb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),YF,zb);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}i(Bb,"createPieServices");var mG=class extends ei{static{i(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="STRING2")return t.substring(1,t.length-1)}},gG=class extends sr{static{i(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},Kb={parser:{TokenBuilder:i(()=>new gG,"TokenBuilder"),ValueConverter:i(()=>new mG,"ValueConverter")}};function qb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),ZF,Kb);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}i(qb,"createTreeViewServices");var yG=class extends sr{static{i(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},vG=class extends ei{static{i(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},Wb={parser:{TokenBuilder:i(()=>new yG,"TokenBuilder"),ValueConverter:i(()=>new vG,"ValueConverter")}};function Vb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),KF,Wb);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}i(Vb,"createArchitectureServices");var TG=class extends sr{static{i(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},$g=new Set(["cmd","command"]),Ag=new Set(["evt","event"]),Zc=new Set(["rmo","readmodel"]),Eg=new Set(["pcr","processor"]),_g=new Set(["ui"]);function Hb(e){const t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){const n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}i(Hb,"registerValidationChecks");var RG=class{static{i(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&($g.has(e.modelEntityType)?this.validateSources(e,new Set([..._g,...Eg]),"command","ui or processor",t):Ag.has(e.modelEntityType)?this.validateSources(e,$g,"event","command",t):Zc.has(e.modelEntityType)?this.validateSources(e,Ag,"read model","event",t):Eg.has(e.modelEntityType)?this.validateSources(e,Zc,"processor","read model",t):_g.has(e.modelEntityType)&&this.validateSources(e,Zc,"ui","read model",t))}validateSources(e,t,r,n,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!t.has(o.modelEntityType)&&a("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},Yb={parser:{TokenBuilder:i(()=>new TG,"TokenBuilder"),ValueConverter:i(()=>new Bs,"ValueConverter")},validation:{EventModelingValidator:i(()=>new RG,"EventModelingValidator")}};function Xb(e=It){const t=Ae(vt(e),ir),r=Ae(yt({shared:t}),qF,Yb);return t.ServiceRegistry.register(r),Hb(r),{shared:t,EventModel:r}}i(Xb,"createEventModelingServices");var At={},$G={info:i(async()=>{const{createInfoServices:e}=await Promise.resolve().then(function(){return _G}),t=e().Info.parser.LangiumParser;At.info=t},"info"),packet:i(async()=>{const{createPacketServices:e}=await Promise.resolve().then(function(){return CG}),t=e().Packet.parser.LangiumParser;At.packet=t},"packet"),pie:i(async()=>{const{createPieServices:e}=await Promise.resolve().then(function(){return SG}),t=e().Pie.parser.LangiumParser;At.pie=t},"pie"),treeView:i(async()=>{const{createTreeViewServices:e}=await Promise.resolve().then(function(){return bG}),t=e().TreeView.parser.LangiumParser;At.treeView=t},"treeView"),architecture:i(async()=>{const{createArchitectureServices:e}=await Promise.resolve().then(function(){return wG}),t=e().Architecture.parser.LangiumParser;At.architecture=t},"architecture"),gitGraph:i(async()=>{const{createGitGraphServices:e}=await Promise.resolve().then(function(){return IG}),t=e().GitGraph.parser.LangiumParser;At.gitGraph=t},"gitGraph"),eventmodeling:i(async()=>{const{createEventModelingServices:e}=await Promise.resolve().then(function(){return NG}),t=e().EventModel.parser.LangiumParser;At.eventmodeling=t},"eventmodeling"),radar:i(async()=>{const{createRadarServices:e}=await Promise.resolve().then(function(){return kG}),t=e().Radar.parser.LangiumParser;At.radar=t},"radar"),treemap:i(async()=>{const{createTreemapServices:e}=await Promise.resolve().then(function(){return PG}),t=e().Treemap.parser.LangiumParser;At.treemap=t},"treemap"),wardley:i(async()=>{const{createWardleyServices:e}=await Promise.resolve().then(function(){return OG}),t=e().Wardley.parser.LangiumParser;At.wardley=t},"wardley")};async function AG(e,t){const r=$G[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);At[e]||await r();const a=At[e].parse(t);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new EG(a);return a.value}i(AG,"parse");var EG=class extends Error{constructor(e){const t=e.lexerErrors.map(n=>{const a=n.line!==void 0&&!isNaN(n.line)?n.line:"?",s=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${a}, column ${s}: ${n.message}`}).join(` +`),r=e.parserErrors.map(n=>{const a=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",s=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${n.message}`}).join(` +`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{i(this,"MermaidParseError")}},_G=Object.freeze({__proto__:null,InfoModule:Fb,createInfoServices:Gb}),CG=Object.freeze({__proto__:null,PacketModule:jb,createPacketServices:Ub}),SG=Object.freeze({__proto__:null,PieModule:zb,createPieServices:Bb}),bG=Object.freeze({__proto__:null,TreeViewModule:Kb,createTreeViewServices:qb}),wG=Object.freeze({__proto__:null,ArchitectureModule:Wb,createArchitectureServices:Vb}),IG=Object.freeze({__proto__:null,GitGraphModule:Mb,createGitGraphServices:xb}),NG=Object.freeze({__proto__:null,EventModelingModule:Yb,createEventModelingServices:Xb}),kG=Object.freeze({__proto__:null,RadarModule:Ib,createRadarServices:Nb}),PG=Object.freeze({__proto__:null,TreemapModule:Pb,createTreemapServices:Ob}),OG=Object.freeze({__proto__:null,WardleyModule:Lb,createWardleyServices:Db});export{hF as i,AG as p}; diff --git a/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-gSV1j6uw.js b/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-gSV1j6uw.js new file mode 100644 index 0000000000..fea7dbfc0e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/wardley-L42UT6IY-gSV1j6uw.js @@ -0,0 +1,173 @@ +import{bR as qt}from"./index-DtRfJ0vw.js";var Qb=Object.create,Es=Object.defineProperty,ew=Object.getOwnPropertyDescriptor,Yd=Object.getOwnPropertyNames,tw=Object.getPrototypeOf,rw=Object.prototype.hasOwnProperty,i=(e,t)=>Es(e,"name",{value:t,configurable:!0}),nw=(e,t)=>function(){return e&&(t=(0,e[Yd(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[Yd(e)[0]])((t={exports:{}}).exports,t),t.exports},Kr=(e,t)=>{for(var r in t)Es(e,r,{get:t[r],enumerable:!0})},Xd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Yd(t))!rw.call(e,a)&&a!==r&&Es(e,a,{get:()=>t[a],enumerable:!(n=ew(t,a))||n.enumerable});return e},$l=(e,t,r)=>(Xd(e,t,"default"),r),Jd=(e,t,r)=>(r=e!=null?Qb(tw(e)):{},Xd(Es(r,"default",{value:e,enumerable:!0}),e)),Zd=e=>Xd(Es({},"__esModule",{value:!0}),e),Al={};Kr(Al,{AnnotatedTextEdit:()=>dr,ChangeAnnotation:()=>tn,ChangeAnnotationIdentifier:()=>je,CodeAction:()=>Ou,CodeActionContext:()=>Pu,CodeActionKind:()=>ku,CodeActionTriggerKind:()=>Gi,CodeDescription:()=>cu,CodeLens:()=>Lu,Color:()=>fo,ColorInformation:()=>nu,ColorPresentation:()=>au,Command:()=>en,CompletionItem:()=>Tu,CompletionItemKind:()=>pu,CompletionItemLabelDetails:()=>vu,CompletionItemTag:()=>mu,CompletionList:()=>Ru,CreateFile:()=>ua,DeleteFile:()=>fa,Diagnostic:()=>Di,DiagnosticRelatedInformation:()=>po,DiagnosticSeverity:()=>ou,DiagnosticTag:()=>lu,DocumentHighlight:()=>Cu,DocumentHighlightKind:()=>_u,DocumentLink:()=>Mu,DocumentSymbol:()=>Nu,DocumentUri:()=>eu,EOL:()=>bg,FoldingRange:()=>su,FoldingRangeKind:()=>iu,FormattingOptions:()=>Du,Hover:()=>$u,InlayHint:()=>qu,InlayHintKind:()=>go,InlayHintLabelPart:()=>yo,InlineCompletionContext:()=>Ju,InlineCompletionItem:()=>Vu,InlineCompletionList:()=>Hu,InlineCompletionTriggerKind:()=>Yu,InlineValueContext:()=>Ku,InlineValueEvaluatableExpression:()=>Bu,InlineValueText:()=>Uu,InlineValueVariableLookup:()=>zu,InsertReplaceEdit:()=>gu,InsertTextFormat:()=>hu,InsertTextMode:()=>yu,Location:()=>Li,LocationLink:()=>ru,MarkedString:()=>Fi,MarkupContent:()=>pa,MarkupKind:()=>mo,OptionalVersionedTextDocumentIdentifier:()=>xi,ParameterInformation:()=>Au,Position:()=>ie,Range:()=>ee,RenameFile:()=>da,SelectedCompletionInfo:()=>Xu,SelectionRange:()=>xu,SemanticTokenModifiers:()=>Gu,SemanticTokenTypes:()=>Fu,SemanticTokens:()=>ju,SignatureInformation:()=>Eu,StringValue:()=>Wu,SymbolInformation:()=>wu,SymbolKind:()=>Su,SymbolTag:()=>bu,TextDocument:()=>Qu,TextDocumentEdit:()=>Mi,TextDocumentIdentifier:()=>uu,TextDocumentItem:()=>fu,TextEdit:()=>Vt,URI:()=>uo,VersionedTextDocumentIdentifier:()=>du,WorkspaceChange:()=>Sg,WorkspaceEdit:()=>ho,WorkspaceFolder:()=>Zu,WorkspaceSymbol:()=>Iu,integer:()=>tu,uinteger:()=>Oi});var eu,uo,tu,Oi,ie,ee,Li,ru,fo,nu,au,iu,su,po,ou,lu,cu,Di,en,Vt,tn,je,dr,Mi,ua,da,fa,ho,Ei,kc,Sg,uu,du,xi,fu,mo,pa,pu,hu,mu,gu,yu,vu,Tu,Ru,Fi,$u,Au,Eu,_u,Cu,Su,bu,wu,Iu,Nu,ku,Gi,Pu,Ou,Lu,Du,Mu,xu,Fu,Gu,ju,Uu,zu,Bu,Ku,go,yo,qu,Wu,Vu,Hu,Yu,Xu,Ju,Zu,bg,Qu,Mh,$,_s=nw({"../../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})(eu||(eu={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(uo||(uo={})),(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})(tu||(tu={})),(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})(Oi||(Oi={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Oi.MAX_VALUE),a===Number.MAX_VALUE&&(a=Oi.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&$.uinteger(a.line)&&$.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if($.uinteger(n)&&$.uinteger(a)&&$.uinteger(s)&&$.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 $.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(ee||(ee={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&ee.is(a.range)&&($.string(a.uri)||$.undefined(a.uri))}i(r,"is"),e.is=r})(Li||(Li={})),(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 $.objectLiteral(a)&&ee.is(a.targetRange)&&$.string(a.targetUri)&&ee.is(a.targetSelectionRange)&&(ee.is(a.originSelectionRange)||$.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(ru||(ru={})),(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 $.objectLiteral(a)&&$.numberRange(a.red,0,1)&&$.numberRange(a.green,0,1)&&$.numberRange(a.blue,0,1)&&$.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(fo||(fo={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&ee.is(a.range)&&fo.is(a.color)}i(r,"is"),e.is=r})(nu||(nu={})),(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 $.objectLiteral(a)&&$.string(a.label)&&($.undefined(a.textEdit)||Vt.is(a))&&($.undefined(a.additionalTextEdits)||$.typedArray(a.additionalTextEdits,Vt.is))}i(r,"is"),e.is=r})(au||(au={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(iu||(iu={})),(function(e){function t(n,a,s,o,l,c){const u={startLine:n,endLine:a};return $.defined(s)&&(u.startCharacter=s),$.defined(o)&&(u.endCharacter=o),$.defined(l)&&(u.kind=l),$.defined(c)&&(u.collapsedText=c),u}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&$.uinteger(a.startLine)&&$.uinteger(a.startLine)&&($.undefined(a.startCharacter)||$.uinteger(a.startCharacter))&&($.undefined(a.endCharacter)||$.uinteger(a.endCharacter))&&($.undefined(a.kind)||$.string(a.kind))}i(r,"is"),e.is=r})(su||(su={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&Li.is(a.location)&&$.string(a.message)}i(r,"is"),e.is=r})(po||(po={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(ou||(ou={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(lu||(lu={})),(function(e){function t(r){const n=r;return $.objectLiteral(n)&&$.string(n.href)}i(t,"is"),e.is=t})(cu||(cu={})),(function(e){function t(n,a,s,o,l,c){let u={range:n,message:a};return $.defined(s)&&(u.severity=s),$.defined(o)&&(u.code=o),$.defined(l)&&(u.source=l),$.defined(c)&&(u.relatedInformation=c),u}i(t,"create"),e.create=t;function r(n){var a;let s=n;return $.defined(s)&&ee.is(s.range)&&$.string(s.message)&&($.number(s.severity)||$.undefined(s.severity))&&($.integer(s.code)||$.string(s.code)||$.undefined(s.code))&&($.undefined(s.codeDescription)||$.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&($.string(s.source)||$.undefined(s.source))&&($.undefined(s.relatedInformation)||$.typedArray(s.relatedInformation,po.is))}i(r,"is"),e.is=r})(Di||(Di={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return $.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.title)&&$.string(a.command)}i(r,"is"),e.is=r})(en||(en={})),(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 $.objectLiteral(o)&&$.string(o.newText)&&ee.is(o.range)}i(a,"is"),e.is=a})(Vt||(Vt={})),(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 $.objectLiteral(a)&&$.string(a.label)&&($.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&($.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(tn||(tn={})),(function(e){function t(r){const n=r;return $.string(n)}i(t,"is"),e.is=t})(je||(je={})),(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 Vt.is(o)&&(tn.is(o.annotationId)||je.is(o.annotationId))}i(a,"is"),e.is=a})(dr||(dr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&xi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(Mi||(Mi={})),(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"&&$.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||$.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||$.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(ua||(ua={})),(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"&&$.string(a.oldUri)&&$.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||$.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||$.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(da||(da={})),(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"&&$.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||$.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||$.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||je.is(a.annotationId))}i(r,"is"),e.is=r})(fa||(fa={})),(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=>$.string(a.kind)?ua.is(a)||da.is(a)||fa.is(a):Mi.is(a)))}i(t,"is"),e.is=t})(ho||(ho={})),Ei=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=Vt.insert(e,t):je.is(r)?(a=r,n=dr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=dr.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=Vt.replace(e,t):je.is(r)?(a=r,n=dr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=dr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Vt.del(e):je.is(t)?(n=t,r=dr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=dr.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.")}},kc=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(je.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()}},Sg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new kc(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Mi.is(t)){const r=new Ei(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new Ei(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(xi.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 Ei(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 Ei(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new kc,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;tn.is(t)||je.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ua.create(e,r):(s=je.is(n)?n:this._changeAnnotations.manage(n),a=ua.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;tn.is(r)||je.is(r)?a=r:n=r;let s,o;if(a===void 0?s=da.create(e,t,n):(o=je.is(a)?a:this._changeAnnotations.manage(a),s=da.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;tn.is(t)||je.is(t)?n=t:r=t;let a,s;if(n===void 0?a=fa.create(e,r):(s=je.is(n)?n:this._changeAnnotations.manage(n),a=fa.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 $.defined(a)&&$.string(a.uri)}i(r,"is"),e.is=r})(uu||(uu={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.uri)&&$.integer(a.version)}i(r,"is"),e.is=r})(du||(du={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.string(a.uri)&&(a.version===null||$.integer(a.version))}i(r,"is"),e.is=r})(xi||(xi={})),(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 $.defined(a)&&$.string(a.uri)&&$.string(a.languageId)&&$.integer(a.version)&&$.string(a.text)}i(r,"is"),e.is=r})(fu||(fu={})),(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})(mo||(mo={})),(function(e){function t(r){const n=r;return $.objectLiteral(r)&&mo.is(n.kind)&&$.string(n.value)}i(t,"is"),e.is=t})(pa||(pa={})),(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})(pu||(pu={})),(function(e){e.PlainText=1,e.Snippet=2})(hu||(hu={})),(function(e){e.Deprecated=1})(mu||(mu={})),(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&&$.string(a.newText)&&ee.is(a.insert)&&ee.is(a.replace)}i(r,"is"),e.is=r})(gu||(gu={})),(function(e){e.asIs=1,e.adjustIndentation=2})(yu||(yu={})),(function(e){function t(r){const n=r;return n&&($.string(n.detail)||n.detail===void 0)&&($.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(vu||(vu={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(Tu||(Tu={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(Ru||(Ru={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return $.string(a)||$.objectLiteral(a)&&$.string(a.language)&&$.string(a.value)}i(r,"is"),e.is=r})(Fi||(Fi={})),(function(e){function t(r){let n=r;return!!n&&$.objectLiteral(n)&&(pa.is(n.contents)||Fi.is(n.contents)||$.typedArray(n.contents,Fi.is))&&(r.range===void 0||ee.is(r.range))}i(t,"is"),e.is=t})($u||($u={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Au||(Au={})),(function(e){function t(r,n,...a){let s={label:r};return $.defined(n)&&(s.documentation=n),$.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Eu||(Eu={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(_u||(_u={})),(function(e){function t(r,n){let a={range:r};return $.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Cu||(Cu={})),(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})(Su||(Su={})),(function(e){e.Deprecated=1})(bu||(bu={})),(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})(wu||(wu={})),(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})(Iu||(Iu={})),(function(e){function t(n,a,s,o,l,c){let u={name:n,detail:a,kind:s,range:o,selectionRange:l};return c!==void 0&&(u.children=c),u}i(t,"create"),e.create=t;function r(n){let a=n;return a&&$.string(a.name)&&$.number(a.kind)&&ee.is(a.range)&&ee.is(a.selectionRange)&&(a.detail===void 0||$.string(a.detail))&&(a.deprecated===void 0||$.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})(Nu||(Nu={})),(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"})(ku||(ku={})),(function(e){e.Invoked=1,e.Automatic=2})(Gi||(Gi={})),(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 $.defined(a)&&$.typedArray(a.diagnostics,Di.is)&&(a.only===void 0||$.typedArray(a.only,$.string))&&(a.triggerKind===void 0||a.triggerKind===Gi.Invoked||a.triggerKind===Gi.Automatic)}i(r,"is"),e.is=r})(Pu||(Pu={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):en.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&&$.string(a.title)&&(a.diagnostics===void 0||$.typedArray(a.diagnostics,Di.is))&&(a.kind===void 0||$.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||en.is(a.command))&&(a.isPreferred===void 0||$.boolean(a.isPreferred))&&(a.edit===void 0||ho.is(a.edit))}i(r,"is"),e.is=r})(Ou||(Ou={})),(function(e){function t(n,a){let s={range:n};return $.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&ee.is(a.range)&&($.undefined(a.command)||en.is(a.command))}i(r,"is"),e.is=r})(Lu||(Lu={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.defined(a)&&$.uinteger(a.tabSize)&&$.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(Du||(Du={})),(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 $.defined(a)&&ee.is(a.range)&&($.undefined(a.target)||$.string(a.target))}i(r,"is"),e.is=r})(Mu||(Mu={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return $.objectLiteral(a)&&ee.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(xu||(xu={})),(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"})(Fu||(Fu={})),(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"})(Gu||(Gu={})),(function(e){function t(r){const n=r;return $.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})(ju||(ju={})),(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&&ee.is(a.range)&&$.string(a.text)}i(r,"is"),e.is=r})(Uu||(Uu={})),(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&&ee.is(a.range)&&$.boolean(a.caseSensitiveLookup)&&($.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(zu||(zu={})),(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&&ee.is(a.range)&&($.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(Bu||(Bu={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return $.defined(a)&&ee.is(n.stoppedLocation)}i(r,"is"),e.is=r})(Ku||(Ku={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(go||(go={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return $.objectLiteral(a)&&(a.tooltip===void 0||$.string(a.tooltip)||pa.is(a.tooltip))&&(a.location===void 0||Li.is(a.location))&&(a.command===void 0||en.is(a.command))}i(r,"is"),e.is=r})(yo||(yo={})),(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 $.objectLiteral(a)&&ie.is(a.position)&&($.string(a.label)||$.typedArray(a.label,yo.is))&&(a.kind===void 0||go.is(a.kind))&&a.textEdits===void 0||$.typedArray(a.textEdits,Vt.is)&&(a.tooltip===void 0||$.string(a.tooltip)||pa.is(a.tooltip))&&(a.paddingLeft===void 0||$.boolean(a.paddingLeft))&&(a.paddingRight===void 0||$.boolean(a.paddingRight))}i(r,"is"),e.is=r})(qu||(qu={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(Wu||(Wu={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(Vu||(Vu={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(Hu||(Hu={})),(function(e){e.Invoked=0,e.Automatic=1})(Yu||(Yu={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(Xu||(Xu={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Ju||(Ju={})),(function(e){function t(r){const n=r;return $.objectLiteral(n)&&uo.is(n.uri)&&$.string(n.name)}i(t,"is"),e.is=t})(Zu||(Zu={})),bg=[` +`,`\r +`,"\r"],(function(e){function t(s,o,l,c){return new Mh(s,o,l,c)}i(t,"create"),e.create=t;function r(s){let o=s;return!!($.defined(o)&&$.string(o.uri)&&($.undefined(o.languageId)||$.string(o.languageId))&&$.uinteger(o.lineCount)&&$.func(o.getText)&&$.func(o.positionAt)&&$.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),c=a(o,(d,f)=>{let h=d.range.start.line-f.range.start.line;return h===0?d.range.start.character-f.range.start.character:h}),u=l.length;for(let d=c.length-1;d>=0;d--){let f=c[d],h=s.offsetAt(f.range.start),y=s.offsetAt(f.range.end);if(y<=u)l=l.substring(0,h)+f.newText+l.substring(y,l.length);else throw new Error("Overlapping edit");u=h}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,c=s.slice(0,l),u=s.slice(l);a(c,o),a(u,o);let d=0,f=0,h=0;for(;d0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,n=t.length;if(n===0)return ie.create(0,e);for(;re?n=s:r=s+1}let a=r-1;return ie.create(a,e-t[a])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1"u"}i(n,"undefined"),e.undefined=n;function a(y){return y===!0||y===!1}i(a,"boolean"),e.boolean=a;function s(y){return t.call(y)==="[object String]"}i(s,"string"),e.string=s;function o(y){return t.call(y)==="[object Number]"}i(o,"number"),e.number=o;function l(y,v,C){return t.call(y)==="[object Number]"&&v<=y&&y<=C}i(l,"numberRange"),e.numberRange=l;function c(y){return t.call(y)==="[object Number]"&&-2147483648<=y&&y<=2147483647}i(c,"integer"),e.integer=c;function u(y){return t.call(y)==="[object Number]"&&0<=y&&y<=2147483647}i(u,"uinteger"),e.uinteger=u;function d(y){return t.call(y)==="[object Function]"}i(d,"func"),e.func=d;function f(y){return y!==null&&typeof y=="object"}i(f,"objectLiteral"),e.objectLiteral=f;function h(y,v){return Array.isArray(y)&&y.every(v)}i(h,"typedArray"),e.typedArray=h})($||($={}))}}),kn=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}i(r,"RAL"),(function(n){function a(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");t=s}i(a,"install"),n.install=a})(r||(r={})),e.default=r}}),Cs=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(c){return c===!0||c===!1}i(t,"boolean"),e.boolean=t;function r(c){return typeof c=="string"||c instanceof String}i(r,"string"),e.string=r;function n(c){return typeof c=="number"||c instanceof Number}i(n,"number"),e.number=n;function a(c){return c instanceof Error}i(a,"error"),e.error=a;function s(c){return typeof c=="function"}i(s,"func"),e.func=s;function o(c){return Array.isArray(c)}i(o,"array"),e.array=o;function l(c){return o(c)&&c.every(u=>r(u))}i(l,"stringArray"),e.stringArray=l}}),qa=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=kn(),r;(function(s){const o={dispose(){}};s.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{i(this,"CallbackList")}add(s,o=null,l){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(l)&&l.push({dispose:i(()=>this.remove(s,o),"dispose")})}remove(s,o=null){if(!this._callbacks)return;let l=!1;for(let c=0,u=this._callbacks.length;c{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,l);const u={dispose:i(()=>{this._callbacks&&(this._callbacks.remove(o,l),u.dispose=wg._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(c)&&c.push(u),u}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=a,a._noop=function(){}}}),El=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=kn(),r=Cs(),n=qa(),a;(function(c){c.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),c.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function u(d){const f=d;return f&&(f===c.None||f===c.Cancelled||r.boolean(f.isCancellationRequested)&&!!f.onCancellationRequested)}i(u,"is"),c.is=u})(a||(e.CancellationToken=a={}));var s=Object.freeze(function(c,u){const d=(0,t.default)().timer.setTimeout(c.bind(u),0);return{dispose(){d.dispose()}}}),o=class{static{i(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{i(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}};e.CancellationTokenSource=l}}),Ig=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Cs(),r;(function(g){g.ParseError=-32700,g.InvalidRequest=-32600,g.MethodNotFound=-32601,g.InvalidParams=-32602,g.InternalError=-32603,g.jsonrpcReservedErrorRangeStart=-32099,g.serverErrorStart=-32099,g.MessageWriteError=-32099,g.MessageReadError=-32098,g.PendingResponseRejected=-32097,g.ConnectionInactive=-32096,g.ServerNotInitialized=-32002,g.UnknownErrorCode=-32001,g.jsonrpcReservedErrorRangeEnd=-32e3,g.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class Ng extends Error{static{i(this,"ResponseError")}constructor(E,T,R){super(T),this.code=t.number(E)?E:r.UnknownErrorCode,this.data=R,Object.setPrototypeOf(this,Ng.prototype)}toJson(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),E}};e.ResponseError=n;var a=class vo{static{i(this,"ParameterStructures")}constructor(E){this.kind=E}static is(E){return E===vo.auto||E===vo.byName||E===vo.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{static{i(this,"AbstractMessageSignature")}constructor(g,E){this.method=g,this.numberOfParams=E}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s;var o=class extends s{static{i(this,"RequestType0")}constructor(g){super(g,0)}};e.RequestType0=o;var l=class extends s{static{i(this,"RequestType")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType=l;var c=class extends s{static{i(this,"RequestType1")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType1=c;var u=class extends s{static{i(this,"RequestType2")}constructor(g){super(g,2)}};e.RequestType2=u;var d=class extends s{static{i(this,"RequestType3")}constructor(g){super(g,3)}};e.RequestType3=d;var f=class extends s{static{i(this,"RequestType4")}constructor(g){super(g,4)}};e.RequestType4=f;var h=class extends s{static{i(this,"RequestType5")}constructor(g){super(g,5)}};e.RequestType5=h;var y=class extends s{static{i(this,"RequestType6")}constructor(g){super(g,6)}};e.RequestType6=y;var v=class extends s{static{i(this,"RequestType7")}constructor(g){super(g,7)}};e.RequestType7=v;var C=class extends s{static{i(this,"RequestType8")}constructor(g){super(g,8)}};e.RequestType8=C;var b=class extends s{static{i(this,"RequestType9")}constructor(g){super(g,9)}};e.RequestType9=b;var w=class extends s{static{i(this,"NotificationType")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType=w;var I=class extends s{static{i(this,"NotificationType0")}constructor(g){super(g,0)}};e.NotificationType0=I;var A=class extends s{static{i(this,"NotificationType1")}constructor(g,E=a.auto){super(g,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=A;var k=class extends s{static{i(this,"NotificationType2")}constructor(g){super(g,2)}};e.NotificationType2=k;var G=class extends s{static{i(this,"NotificationType3")}constructor(g){super(g,3)}};e.NotificationType3=G;var H=class extends s{static{i(this,"NotificationType4")}constructor(g){super(g,4)}};e.NotificationType4=H;var X=class extends s{static{i(this,"NotificationType5")}constructor(g){super(g,5)}};e.NotificationType5=X;var le=class extends s{static{i(this,"NotificationType6")}constructor(g){super(g,6)}};e.NotificationType6=le;var ce=class extends s{static{i(this,"NotificationType7")}constructor(g){super(g,7)}};e.NotificationType7=ce;var Ne=class extends s{static{i(this,"NotificationType8")}constructor(g){super(g,8)}};e.NotificationType8=Ne;var P=class extends s{static{i(this,"NotificationType9")}constructor(g){super(g,9)}};e.NotificationType9=P;var _;(function(g){function E(S){const O=S;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}i(E,"isRequest"),g.isRequest=E;function T(S){const O=S;return O&&t.string(O.method)&&S.id===void 0}i(T,"isNotification"),g.isNotification=T;function R(S){const O=S;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}i(R,"isResponse"),g.isResponse=R})(_||(e.Message=_={}))}}),kg=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(r||(e.Touch=r={}));var n=class{static{i(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=r.None){const l=this._map.get(s);if(l)return o!==r.None&&this.touch(l,o),l.value}set(s,o,l=r.None){let c=this._map.get(s);if(c)c.value=o,l!==r.None&&this.touch(c,l);else{switch(c={key:s,value:o,next:void 0,previous:void 0},l){case r.None:this.addItemLast(c);break;case r.First:this.addItemFirst(c);break;case r.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const l=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==l)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}values(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.value,done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}entries(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,done:!0}},"next")};return l}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,l=this.size;for(;o&&l>s;)this._map.delete(o.key),o=o.next,l--;this._head=o,this._size=l,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,l=s.previous;if(!o||!l)throw new Error("Invalid list");o.previous=l,l.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(s===this._head)return;const l=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(l.previous=c,c.next=l),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===r.Last){if(s===this._tail)return;const l=s.next,c=s.previous;s===this._head?(l.previous=void 0,this._head=l):(l.previous=c,c.next=l),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,l)=>{s.push([l,o])}),s}fromJSON(s){this.clear();for(const[o,l]of s)this.set(o,l)}};e.LinkedMap=n;var a=class extends n{static{i(this,"LRUCache")}constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=r.AsNew){return super.get(s,o)}peek(s){return super.get(s,r.None)}set(s,o){return super.set(s,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=a}}),aw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(a){return{dispose:a}}i(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),iw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=El(),r;(function(l){l.Continue=0,l.Cancelled=1})(r||(r={}));var n=class{static{i(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;const c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=r.Continue,this.buffers.set(l.id,c),l.$cancellationData=c}async sendCancellation(l,c){const u=this.buffers.get(c);if(u===void 0)return;const d=new Int32Array(u,0,1);Atomics.store(d,0,r.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var a=class{static{i(this,"SharedArrayBufferCancellationToken")}constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{static{i(this,"SharedArrayBufferCancellationTokenSource")}constructor(l){this.token=new a(l)}cancel(){}dispose(){}},o=class{static{i(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(l){const c=l.$cancellationData;return c===void 0?new t.CancellationTokenSource:new s(c)}};e.SharedArrayReceiverStrategy=o}}),Pg=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=kn(),r=class{static{i(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((a,s)=>{this._waiting.push({thunk:n,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=n.thunk();a instanceof Promise?a.then(s=>{this._active--,n.resolve(s),this.runNext()},s=>{this._active--,n.reject(s),this.runNext()}):(this._active--,n.resolve(a),this.runNext())}catch(a){this._active--,n.reject(a),this.runNext()}}};e.Semaphore=r}}),sw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=kn(),r=Cs(),n=qa(),a=Pg(),s;(function(u){function d(f){let h=f;return h&&r.func(h.listen)&&r.func(h.dispose)&&r.func(h.onError)&&r.func(h.onClose)&&r.func(h.onPartialMessage)}i(d,"is"),u.is=d})(s||(e.MessageReader=s={}));var o=class{static{i(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${r.string(u.message)?u.message:"unknown"}`)}};e.AbstractMessageReader=o;var l;(function(u){function d(f){let h,y;const v=new Map;let C;const b=new Map;if(f===void 0||typeof f=="string")h=f??"utf-8";else{if(h=f.charset??"utf-8",f.contentDecoder!==void 0&&(y=f.contentDecoder,v.set(y.name,y)),f.contentDecoders!==void 0)for(const w of f.contentDecoders)v.set(w.name,w);if(f.contentTypeDecoder!==void 0&&(C=f.contentTypeDecoder,b.set(C.name,C)),f.contentTypeDecoders!==void 0)for(const w of f.contentTypeDecoders)b.set(w.name,w)}return C===void 0&&(C=(0,t.default)().applicationJson.decoder,b.set(C.name,C)),{charset:h,contentDecoder:y,contentDecoders:v,contentTypeDecoder:C,contentTypeDecoders:b}}i(d,"fromOptions"),u.fromOptions=d})(l||(l={}));var c=class extends o{static{i(this,"ReadableStreamMessageReader")}constructor(u,d){super(),this.readable=u,this.options=l.fromOptions(d),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const d=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),d}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const h=f.get("content-length");if(!h){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(f))}`));return}const y=parseInt(h);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${h}`));return}this.nextMessageLength=y}const d=this.buffer.tryReadBody(this.nextMessageLength);if(d===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(d):d,h=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(h)}).catch(f=>{this.fireError(f)})}}catch(d){this.fireError(d)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,d)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:d}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=c}}),ow=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=kn(),r=Cs(),n=Pg(),a=qa(),s="Content-Length: ",o=`\r +`,l;(function(f){function h(y){let v=y;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}i(h,"is"),f.is=h})(l||(e.MessageWriter=l={}));var c=class{static{i(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,h,y){this.errorEmitter.fire([this.asError(f),h,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}};e.AbstractMessageWriter=c;var u;(function(f){function h(y){return y===void 0||typeof y=="string"?{charset:y??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:y.charset??"utf-8",contentEncoder:y.contentEncoder,contentTypeEncoder:y.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}i(h,"fromOptions"),f.fromOptions=h})(u||(u={}));var d=class extends c{static{i(this,"WriteableStreamMessageWriter")}constructor(f,h){super(),this.writable=f,this.options=u.fromOptions(h),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),o),v.push(o),this.doWrite(f,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(f,h,y){try{return await this.writable.write(h.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,f),Promise.reject(v)}}handleError(f,h){this.errorCount++,this.fireError(f,h,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=d}}),lw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r +`,a=class{static{i(this,"AbstractMessageBuffer")}constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,l=0,c=0,u=0;e:for(;lthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],d=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,d}const o=this.allocNative(s);let l=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const d=u.slice(0,s);o.set(d,l),l+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,l),l+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}};e.AbstractMessageBuffer=a}}),cw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=kn(),r=Cs(),n=Ig(),a=kg(),s=qa(),o=El(),l;(function(g){g.type=new n.NotificationType("$/cancelRequest")})(l||(l={}));var c;(function(g){function E(T){return typeof T=="string"||typeof T=="number"}i(E,"is"),g.is=E})(c||(e.ProgressToken=c={}));var u;(function(g){g.type=new n.NotificationType("$/progress")})(u||(u={}));var d=class{static{i(this,"ProgressType")}constructor(){}};e.ProgressType=d;var f;(function(g){function E(T){return r.func(T)}i(E,"is"),g.is=E})(f||(f={})),e.NullLogger=Object.freeze({error:i(()=>{},"error"),warn:i(()=>{},"warn"),info:i(()=>{},"info"),log:i(()=>{},"log")});var h;(function(g){g[g.Off=0]="Off",g[g.Messages=1]="Messages",g[g.Compact=2]="Compact",g[g.Verbose=3]="Verbose"})(h||(e.Trace=h={}));var y;(function(g){g.Off="off",g.Messages="messages",g.Compact="compact",g.Verbose="verbose"})(y||(e.TraceValues=y={})),(function(g){function E(R){if(!r.string(R))return g.Off;switch(R=R.toLowerCase(),R){case"off":return g.Off;case"messages":return g.Messages;case"compact":return g.Compact;case"verbose":return g.Verbose;default:return g.Off}}i(E,"fromString"),g.fromString=E;function T(R){switch(R){case g.Off:return"off";case g.Messages:return"messages";case g.Compact:return"compact";case g.Verbose:return"verbose";default:return"off"}}i(T,"toString"),g.toString=T})(h||(e.Trace=h={}));var v;(function(g){g.Text="text",g.JSON="json"})(v||(e.TraceFormat=v={})),(function(g){function E(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?g.JSON:g.Text):g.Text}i(E,"fromString"),g.fromString=E})(v||(e.TraceFormat=v={}));var C;(function(g){g.type=new n.NotificationType("$/setTrace")})(C||(e.SetTraceNotification=C={}));var b;(function(g){g.type=new n.NotificationType("$/logTrace")})(b||(e.LogTraceNotification=b={}));var w;(function(g){g[g.Closed=1]="Closed",g[g.Disposed=2]="Disposed",g[g.AlreadyListening=3]="AlreadyListening"})(w||(e.ConnectionErrors=w={}));var I=class Og extends Error{static{i(this,"ConnectionError")}constructor(E,T){super(T),this.code=E,Object.setPrototypeOf(this,Og.prototype)}};e.ConnectionError=I;var A;(function(g){function E(T){const R=T;return R&&r.func(R.cancelUndispatched)}i(E,"is"),g.is=E})(A||(e.ConnectionStrategy=A={}));var k;(function(g){function E(T){const R=T;return R&&(R.kind===void 0||R.kind==="id")&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}i(E,"is"),g.is=E})(k||(e.IdCancellationReceiverStrategy=k={}));var G;(function(g){function E(T){const R=T;return R&&R.kind==="request"&&r.func(R.createCancellationTokenSource)&&(R.dispose===void 0||r.func(R.dispose))}i(E,"is"),g.is=E})(G||(e.RequestCancellationReceiverStrategy=G={}));var H;(function(g){g.Message=Object.freeze({createCancellationTokenSource(T){return new o.CancellationTokenSource}});function E(T){return k.is(T)||G.is(T)}i(E,"is"),g.is=E})(H||(e.CancellationReceiverStrategy=H={}));var X;(function(g){g.Message=Object.freeze({sendCancellation(T,R){return T.sendNotification(l.type,{id:R})},cleanup(T){}});function E(T){const R=T;return R&&r.func(R.sendCancellation)&&r.func(R.cleanup)}i(E,"is"),g.is=E})(X||(e.CancellationSenderStrategy=X={}));var le;(function(g){g.Message=Object.freeze({receiver:H.Message,sender:X.Message});function E(T){const R=T;return R&&H.is(R.receiver)&&X.is(R.sender)}i(E,"is"),g.is=E})(le||(e.CancellationStrategy=le={}));var ce;(function(g){function E(T){const R=T;return R&&r.func(R.handleMessage)}i(E,"is"),g.is=E})(ce||(e.MessageStrategy=ce={}));var Ne;(function(g){function E(T){const R=T;return R&&(le.is(R.cancellationStrategy)||A.is(R.connectionStrategy)||ce.is(R.messageStrategy))}i(E,"is"),g.is=E})(Ne||(e.ConnectionOptions=Ne={}));var P;(function(g){g[g.New=1]="New",g[g.Listening=2]="Listening",g[g.Closed=3]="Closed",g[g.Disposed=4]="Disposed"})(P||(P={}));function _(g,E,T,R){const S=T!==void 0?T:e.NullLogger;let O=0,M=0,D=0;const z="2.0";let B;const Z=new Map;let J;const te=new Map,de=new Map;let ct,Re=new a.LinkedMap,Oe=new Map,qe=new Set,Se=new Map,Q=h.Off,rt=v.Text,me,Nt=P.New;const Zn=new s.Emitter,ri=new s.Emitter,ni=new s.Emitter,ai=new s.Emitter,ii=new s.Emitter,kt=R&&R.cancellationStrategy?R.cancellationStrategy:le.Message;function Qn(m){if(m===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+m.toString()}i(Qn,"createRequestQueueKey");function si(m){return m===null?"res-unknown-"+(++D).toString():"res-"+m.toString()}i(si,"createResponseQueueKey");function oi(){return"not-"+(++M).toString()}i(oi,"createNotificationQueueKey");function li(m,N){n.Message.isRequest(N)?m.set(Qn(N.id),N):n.Message.isResponse(N)?m.set(si(N.id),N):m.set(oi(),N)}i(li,"addMessageToQueue");function ci(m){}i(ci,"cancelUndispatched");function ea(){return Nt===P.Listening}i(ea,"isListening");function ta(){return Nt===P.Closed}i(ta,"isClosed");function zt(){return Nt===P.Disposed}i(zt,"isDisposed");function ra(){(Nt===P.New||Nt===P.Listening)&&(Nt=P.Closed,ri.fire(void 0))}i(ra,"closeHandler");function ui(m){Zn.fire([m,void 0,void 0])}i(ui,"readErrorHandler");function di(m){Zn.fire(m)}i(di,"writeErrorHandler"),g.onClose(ra),g.onError(ui),E.onClose(ra),E.onError(di);function na(){ct||Re.size===0||(ct=(0,t.default)().timer.setImmediate(()=>{ct=void 0,fi()}))}i(na,"triggerMessageQueue");function aa(m){n.Message.isRequest(m)?pi(m):n.Message.isNotification(m)?mi(m):n.Message.isResponse(m)?hi(m):gi(m)}i(aa,"handleMessage");function fi(){if(Re.size===0)return;const m=Re.shift();try{const N=R?.messageStrategy;ce.is(N)?N.handleMessage(m,aa):aa(m)}finally{na()}}i(fi,"processMessageQueue");const qs=i(m=>{try{if(n.Message.isNotification(m)&&m.method===l.type.method){const N=m.params.id,L=Qn(N),x=Re.get(L);if(n.Message.isRequest(x)){const ue=R?.connectionStrategy,be=ue&&ue.cancelUndispatched?ue.cancelUndispatched(x,ci):void 0;if(be&&(be.error!==void 0||be.result!==void 0)){Re.delete(L),Se.delete(N),be.id=x.id,Pr(be,m.method,Date.now()),E.write(be).catch(()=>S.error("Sending response for canceled message failed."));return}}const ge=Se.get(N);if(ge!==void 0){ge.cancel(),Yr(m);return}else qe.add(N)}li(Re,m)}finally{na()}},"callback");function pi(m){if(zt())return;function N(re,Ee,se){const De={jsonrpc:z,id:m.id};re instanceof n.ResponseError?De.error=re.toJson():De.result=re===void 0?null:re,Pr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(N,"reply");function L(re,Ee,se){const De={jsonrpc:z,id:m.id,error:re.toJson()};Pr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(L,"replyError");function x(re,Ee,se){re===void 0&&(re=null);const De={jsonrpc:z,id:m.id,result:re};Pr(De,Ee,se),E.write(De).catch(()=>S.error("Sending response failed."))}i(x,"replySuccess"),Ti(m);const ge=Z.get(m.method);let ue,be;ge&&(ue=ge.type,be=ge.handler);const ke=Date.now();if(be||B){const re=m.id??String(Date.now()),Ee=k.is(kt.receiver)?kt.receiver.createCancellationTokenSource(re):kt.receiver.createCancellationTokenSource(m);m.id!==null&&qe.has(m.id)&&Ee.cancel(),m.id!==null&&Se.set(re,Ee);try{let se;if(be)if(m.params===void 0){if(ue!==void 0&&ue.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines ${ue.numberOfParams} params but received none.`),m.method,ke);return}se=be(Ee.token)}else if(Array.isArray(m.params)){if(ue!==void 0&&ue.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by name but received parameters by position`),m.method,ke);return}se=be(...m.params,Ee.token)}else{if(ue!==void 0&&ue.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${m.method} defines parameters by position but received parameters by name`),m.method,ke);return}se=be(m.params,Ee.token)}else B&&(se=B(m.method,m.params,Ee.token));const De=se;se?De.then?De.then(We=>{Se.delete(re),N(We,m.method,ke)},We=>{Se.delete(re),We instanceof n.ResponseError?L(We,m.method,ke):We&&r.string(We.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${We.message}`),m.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,ke)}):(Se.delete(re),N(se,m.method,ke)):(Se.delete(re),x(se,m.method,ke))}catch(se){Se.delete(re),se instanceof n.ResponseError?N(se,m.method,ke):se&&r.string(se.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed with message: ${se.message}`),m.method,ke):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${m.method} failed unexpectedly without providing any details.`),m.method,ke)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${m.method}`),m.method,ke)}i(pi,"handleRequest");function hi(m){if(!zt())if(m.id===null)m.error?S.error(`Received response message without id: Error is: +${JSON.stringify(m.error,void 0,4)}`):S.error("Received response message without id. No further error information provided.");else{const N=m.id,L=Oe.get(N);if(Ri(m,L),L!==void 0){Oe.delete(N);try{if(m.error){const x=m.error;L.reject(new n.ResponseError(x.code,x.message,x.data))}else if(m.result!==void 0)L.resolve(m.result);else throw new Error("Should never happen.")}catch(x){x.message?S.error(`Response handler '${L.method}' failed with message: ${x.message}`):S.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}i(hi,"handleResponse");function mi(m){if(zt())return;let N,L;if(m.method===l.type.method){const x=m.params.id;qe.delete(x),Yr(m);return}else{const x=te.get(m.method);x&&(L=x.handler,N=x.type)}if(L||J)try{if(Yr(m),L)if(m.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==n.ParameterStructures.byName&&S.error(`Notification ${m.method} defines ${N.numberOfParams} params but received none.`),L();else if(Array.isArray(m.params)){const x=m.params;m.method===u.type.method&&x.length===2&&c.is(x[0])?L({token:x[0],value:x[1]}):(N!==void 0&&(N.parameterStructures===n.ParameterStructures.byName&&S.error(`Notification ${m.method} defines parameters by name but received parameters by position`),N.numberOfParams!==m.params.length&&S.error(`Notification ${m.method} defines ${N.numberOfParams} params but received ${x.length} arguments`)),L(...x))}else N!==void 0&&N.parameterStructures===n.ParameterStructures.byPosition&&S.error(`Notification ${m.method} defines parameters by position but received parameters by name`),L(m.params);else J&&J(m.method,m.params)}catch(x){x.message?S.error(`Notification handler '${m.method}' failed with message: ${x.message}`):S.error(`Notification handler '${m.method}' failed unexpectedly.`)}else ni.fire(m)}i(mi,"handleNotification");function gi(m){if(!m){S.error("Received empty message.");return}S.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(m,null,4)}`);const N=m;if(r.string(N.id)||r.number(N.id)){const L=N.id,x=Oe.get(L);x&&x.reject(new Error("The received response has neither a result nor an error property."))}}i(gi,"handleInvalidMessage");function $t(m){if(m!=null)switch(Q){case h.Verbose:return JSON.stringify(m,null,4);case h.Compact:return JSON.stringify(m);default:return}}i($t,"stringifyTrace");function yi(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&m.params&&(N=`Params: ${$t(m.params)} + +`),me.log(`Sending request '${m.method} - (${m.id})'.`,N)}else Bt("send-request",m)}i(yi,"traceSendingRequest");function vi(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&(m.params?N=`Params: ${$t(m.params)} + +`:N=`No parameters provided. + +`),me.log(`Sending notification '${m.method}'.`,N)}else Bt("send-notification",m)}i(vi,"traceSendingNotification");function Pr(m,N,L){if(!(Q===h.Off||!me))if(rt===v.Text){let x;(Q===h.Verbose||Q===h.Compact)&&(m.error&&m.error.data?x=`Error data: ${$t(m.error.data)} + +`:m.result?x=`Result: ${$t(m.result)} + +`:m.error===void 0&&(x=`No result returned. + +`)),me.log(`Sending response '${N} - (${m.id})'. Processing request took ${Date.now()-L}ms`,x)}else Bt("send-response",m)}i(Pr,"traceSendingResponse");function Ti(m){if(!(Q===h.Off||!me))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&m.params&&(N=`Params: ${$t(m.params)} + +`),me.log(`Received request '${m.method} - (${m.id})'.`,N)}else Bt("receive-request",m)}i(Ti,"traceReceivedRequest");function Yr(m){if(!(Q===h.Off||!me||m.method===b.type.method))if(rt===v.Text){let N;(Q===h.Verbose||Q===h.Compact)&&(m.params?N=`Params: ${$t(m.params)} + +`:N=`No parameters provided. + +`),me.log(`Received notification '${m.method}'.`,N)}else Bt("receive-notification",m)}i(Yr,"traceReceivedNotification");function Ri(m,N){if(!(Q===h.Off||!me))if(rt===v.Text){let L;if((Q===h.Verbose||Q===h.Compact)&&(m.error&&m.error.data?L=`Error data: ${$t(m.error.data)} + +`:m.result?L=`Result: ${$t(m.result)} + +`:m.error===void 0&&(L=`No result returned. + +`)),N){const x=m.error?` Request failed: ${m.error.message} (${m.error.code}).`:"";me.log(`Received response '${N.method} - (${m.id})' in ${Date.now()-N.timerStart}ms.${x}`,L)}else me.log(`Received response ${m.id} without active response promise.`,L)}else Bt("receive-response",m)}i(Ri,"traceReceivedResponse");function Bt(m,N){if(!me||Q===h.Off)return;const L={isLSPMessage:!0,type:m,message:N,timestamp:Date.now()};me.log(L)}i(Bt,"logLSPMessage");function lr(){if(ta())throw new I(w.Closed,"Connection is closed.");if(zt())throw new I(w.Disposed,"Connection is disposed.")}i(lr,"throwIfClosedOrDisposed");function $i(){if(ea())throw new I(w.AlreadyListening,"Connection is already listening")}i($i,"throwIfListening");function Ai(){if(!ea())throw new Error("Call listen() first.")}i(Ai,"throwIfNotListening");function cr(m){return m===void 0?null:m}i(cr,"undefinedToNull");function ia(m){if(m!==null)return m}i(ia,"nullToUndefined");function p(m){return m!=null&&!Array.isArray(m)&&typeof m=="object"}i(p,"isNamedParam");function ae(m,N){switch(m){case n.ParameterStructures.auto:return p(N)?ia(N):[cr(N)];case n.ParameterStructures.byName:if(!p(N))throw new Error("Received parameters by name but param is not an object literal.");return ia(N);case n.ParameterStructures.byPosition:return[cr(N)];default:throw new Error(`Unknown parameter structure ${m.toString()}`)}}i(ae,"computeSingleParam");function $e(m,N){let L;const x=m.numberOfParams;switch(x){case 0:L=void 0;break;case 1:L=ae(m.parameterStructures,N[0]);break;default:L=[];for(let ge=0;ge{lr();let L,x;if(r.string(m)){L=m;const ue=N[0];let be=0,ke=n.ParameterStructures.auto;n.ParameterStructures.is(ue)&&(be=1,ke=ue);let re=N.length;const Ee=re-be;switch(Ee){case 0:x=void 0;break;case 1:x=ae(ke,N[be]);break;default:if(ke===n.ParameterStructures.byName)throw new Error(`Received ${Ee} parameters for 'by Name' notification parameter structure.`);x=N.slice(be,re).map(se=>cr(se));break}}else{const ue=N;L=m.method,x=$e(m,ue)}const ge={jsonrpc:z,method:L,params:x};return vi(ge),E.write(ge).catch(ue=>{throw S.error("Sending notification failed."),ue})},"sendNotification"),onNotification:i((m,N)=>{lr();let L;return r.func(m)?J=m:N&&(r.string(m)?(L=m,te.set(m,{type:void 0,handler:N})):(L=m.method,te.set(m.method,{type:m,handler:N}))),{dispose:i(()=>{L!==void 0?te.delete(L):J=void 0},"dispose")}},"onNotification"),onProgress:i((m,N,L)=>{if(de.has(N))throw new Error(`Progress handler for token ${N} already registered`);return de.set(N,L),{dispose:i(()=>{de.delete(N)},"dispose")}},"onProgress"),sendProgress:i((m,N,L)=>W.sendNotification(u.type,{token:N,value:L}),"sendProgress"),onUnhandledProgress:ai.event,sendRequest:i((m,...N)=>{lr(),Ai();let L,x,ge;if(r.string(m)){L=m;const re=N[0],Ee=N[N.length-1];let se=0,De=n.ParameterStructures.auto;n.ParameterStructures.is(re)&&(se=1,De=re);let We=N.length;o.CancellationToken.is(Ee)&&(We=We-1,ge=Ee);const Kt=We-se;switch(Kt){case 0:x=void 0;break;case 1:x=ae(De,N[se]);break;default:if(De===n.ParameterStructures.byName)throw new Error(`Received ${Kt} parameters for 'by Name' request parameter structure.`);x=N.slice(se,We).map(Zb=>cr(Zb));break}}else{const re=N;L=m.method,x=$e(m,re);const Ee=m.numberOfParams;ge=o.CancellationToken.is(re[Ee])?re[Ee]:void 0}const ue=O++;let be;ge&&(be=ge.onCancellationRequested(()=>{const re=kt.sender.sendCancellation(W,ue);return re===void 0?(S.log(`Received no promise from cancellation strategy when cancelling id ${ue}`),Promise.resolve()):re.catch(()=>{S.log(`Sending cancellation messages for id ${ue} failed`)})}));const ke={jsonrpc:z,id:ue,method:L,params:x};return yi(ke),typeof kt.sender.enableCancellation=="function"&&kt.sender.enableCancellation(ke),new Promise(async(re,Ee)=>{const se=i(Kt=>{re(Kt),kt.sender.cleanup(ue),be?.dispose()},"resolveWithCleanup"),De=i(Kt=>{Ee(Kt),kt.sender.cleanup(ue),be?.dispose()},"rejectWithCleanup"),We={method:L,timerStart:Date.now(),resolve:se,reject:De};try{await E.write(ke),Oe.set(ue,We)}catch(Kt){throw S.error("Sending request failed."),We.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Kt.message?Kt.message:"Unknown reason")),Kt}})},"sendRequest"),onRequest:i((m,N)=>{lr();let L=null;return f.is(m)?(L=void 0,B=m):r.string(m)?(L=null,N!==void 0&&(L=m,Z.set(m,{handler:N,type:void 0}))):N!==void 0&&(L=m.method,Z.set(m.method,{type:m,handler:N})),{dispose:i(()=>{L!==null&&(L!==void 0?Z.delete(L):B=void 0)},"dispose")}},"onRequest"),hasPendingResponse:i(()=>Oe.size>0,"hasPendingResponse"),trace:i(async(m,N,L)=>{let x=!1,ge=v.Text;L!==void 0&&(r.boolean(L)?x=L:(x=L.sendNotification||!1,ge=L.traceFormat||v.Text)),Q=m,rt=ge,Q===h.Off?me=void 0:me=N,x&&!ta()&&!zt()&&await W.sendNotification(C.type,{value:h.toString(m)})},"trace"),onError:Zn.event,onClose:ri.event,onUnhandledNotification:ni.event,onDispose:ii.event,end:i(()=>{E.end()},"end"),dispose:i(()=>{if(zt())return;Nt=P.Disposed,ii.fire(void 0);const m=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const N of Oe.values())N.reject(m);Oe=new Map,Se=new Map,qe=new Set,Re=new a.LinkedMap,r.func(E.dispose)&&E.dispose(),r.func(g.dispose)&&g.dispose()},"dispose"),listen:i(()=>{lr(),$i(),Nt=P.Listening,g.listen(qs)},"listen"),inspect:i(()=>{(0,t.default)().console.log("inspect")},"inspect")};return W.onNotification(b.type,m=>{if(Q===h.Off||!me)return;const N=Q===h.Verbose||Q===h.Compact;me.log(m.message,N?m.verbose:void 0)}),W.onNotification(u.type,m=>{const N=de.get(m.token);N?N(m.value):ai.fire(m)}),W}i(_,"createMessageConnection"),e.createMessageConnection=_}}),ed=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=Ig();Object.defineProperty(e,"Message",{enumerable:!0,get:i(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:i(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:i(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:i(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:i(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:i(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:i(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:i(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:i(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:i(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:i(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:i(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:i(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:i(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:i(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:i(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:i(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:i(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:i(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:i(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:i(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:i(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:i(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:i(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:i(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:i(function(){return t.ParameterStructures},"get")});var r=kg();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:i(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:i(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:i(function(){return r.Touch},"get")});var n=aw();Object.defineProperty(e,"Disposable",{enumerable:!0,get:i(function(){return n.Disposable},"get")});var a=qa();Object.defineProperty(e,"Event",{enumerable:!0,get:i(function(){return a.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:i(function(){return a.Emitter},"get")});var s=El();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:i(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:i(function(){return s.CancellationToken},"get")});var o=iw();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:i(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:i(function(){return o.SharedArrayReceiverStrategy},"get")});var l=sw();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:i(function(){return l.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:i(function(){return l.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:i(function(){return l.ReadableStreamMessageReader},"get")});var c=ow();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:i(function(){return c.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:i(function(){return c.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:i(function(){return c.WriteableStreamMessageWriter},"get")});var u=lw();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:i(function(){return u.AbstractMessageBuffer},"get")});var d=cw();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:i(function(){return d.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:i(function(){return d.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:i(function(){return d.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:i(function(){return d.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:i(function(){return d.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:i(function(){return d.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:i(function(){return d.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:i(function(){return d.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:i(function(){return d.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:i(function(){return d.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:i(function(){return d.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:i(function(){return d.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:i(function(){return d.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:i(function(){return d.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:i(function(){return d.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:i(function(){return d.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:i(function(){return d.MessageStrategy},"get")});var f=kn();e.RAL=f.default}}),uw=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ed(),r=class Lg extends t.AbstractMessageBuffer{static{i(this,"MessageBuffer")}constructor(u="utf-8"){super(u),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Lg.emptyBuffer}fromString(u,d){return new TextEncoder().encode(u)}toString(u,d){return d==="ascii"?this.asciiDecoder.decode(u):new TextDecoder(d).decode(u)}asNative(u,d){return d===void 0?u:u.slice(0,d)}allocNative(u){return new Uint8Array(u)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{i(this,"ReadableStreamWrapper")}constructor(c){this.socket=c,this._onData=new t.Emitter,this._messageListener=u=>{u.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}onData(c){return this._onData.event(c)}},a=class{static{i(this,"WritableStreamWrapper")}constructor(c){this.socket=c}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}write(c,u){if(typeof c=="string"){if(u!==void 0&&u!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`);this.socket.send(c)}else this.socket.send(c);return Promise.resolve()}end(){this.socket.close()}},s=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:i(c=>new r(c),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:i((c,u)=>{if(u.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`);return Promise.resolve(s.encode(JSON.stringify(c,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:i((c,u)=>{if(!(c instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(c)))},"decode")})}),stream:Object.freeze({asReadableStream:i(c=>new n(c),"asReadableStream"),asWritableStream:i(c=>new a(c),"asWritableStream")}),console,timer:Object.freeze({setTimeout(c,u,...d){const f=setTimeout(c,u,...d);return{dispose:i(()=>clearTimeout(f),"dispose")}},setImmediate(c,...u){const d=setTimeout(c,0,...u);return{dispose:i(()=>clearTimeout(d),"dispose")}},setInterval(c,u,...d){const f=setInterval(c,u,...d);return{dispose:i(()=>clearInterval(f),"dispose")}}})});function l(){return o}i(l,"RIL"),(function(c){function u(){t.RAL.install(o)}i(u,"install"),c.install=u})(l||(l={})),e.default=l}}),Wa=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(c,u,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(u,d);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:i(function(){return u[d]},"get")}),Object.defineProperty(c,f,h)}):(function(c,u,d,f){f===void 0&&(f=d),c[f]=u[d]})),r=e&&e.__exportStar||function(c,u){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,c,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=uw();n.default.install();var a=ed();r(ed(),e);var s=class extends a.AbstractMessageReader{static{i(this,"BrowserMessageReader")}constructor(c){super(),this._onData=new a.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}};e.BrowserMessageReader=s;var o=class extends a.AbstractMessageWriter{static{i(this,"BrowserMessageWriter")}constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function l(c,u,d,f){return d===void 0&&(d=a.NullLogger),a.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,a.createMessageConnection)(c,u,d,f)}i(l,"createMessageConnection"),e.createMessageConnection=l}}),xh=V({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){t.exports=Wa()}}),Ce=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=Wa(),r;(function(c){c.clientToServer="clientToServer",c.serverToClient="serverToClient",c.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{i(this,"RegistrationType")}constructor(c){this.method=c}};e.RegistrationType=n;var a=class extends t.RequestType0{static{i(this,"ProtocolRequestType0")}constructor(c){super(c)}};e.ProtocolRequestType0=a;var s=class extends t.RequestType{static{i(this,"ProtocolRequestType")}constructor(c){super(c,t.ParameterStructures.byName)}};e.ProtocolRequestType=s;var o=class extends t.NotificationType0{static{i(this,"ProtocolNotificationType0")}constructor(c){super(c)}};e.ProtocolNotificationType0=o;var l=class extends t.NotificationType{static{i(this,"ProtocolNotificationType")}constructor(c){super(c,t.ParameterStructures.byName)}};e.ProtocolNotificationType=l}}),Qd=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(d){return d===!0||d===!1}i(t,"boolean"),e.boolean=t;function r(d){return typeof d=="string"||d instanceof String}i(r,"string"),e.string=r;function n(d){return typeof d=="number"||d instanceof Number}i(n,"number"),e.number=n;function a(d){return d instanceof Error}i(a,"error"),e.error=a;function s(d){return typeof d=="function"}i(s,"func"),e.func=s;function o(d){return Array.isArray(d)}i(o,"array"),e.array=o;function l(d){return o(d)&&d.every(f=>r(f))}i(l,"stringArray"),e.stringArray=l;function c(d,f){return Array.isArray(d)&&d.every(f)}i(c,"typedArray"),e.typedArray=c;function u(d){return d!==null&&typeof d=="object"}i(u,"objectLiteral"),e.objectLiteral=u}}),dw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),fw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),pw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ce(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),hw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ce(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),mw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.ColorPresentationRequest=n={}))}}),gw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),yw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),vw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),Tw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=Wa(),r=Ce(),n;(function(o){o.type=new t.ProgressType;function l(c){return c===o.type}i(l,"is"),o.is=l})(n||(e.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(e.WorkDoneProgressCreateRequest=a={}));var s;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(s||(e.WorkDoneProgressCancelNotification=s={}))}}),Rw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var a;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.CallHierarchyOutgoingCallsRequest=a={}))}}),$w=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ce(),r;(function(c){c.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(c){c.method="textDocument/semanticTokens",c.type=new t.RegistrationType(c.method)})(n||(e.SemanticTokensRegistrationType=n={}));var a;(function(c){c.method="textDocument/semanticTokens/full",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(a||(e.SemanticTokensRequest=a={}));var s;(function(c){c.method="textDocument/semanticTokens/full/delta",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(s||(e.SemanticTokensDeltaRequest=s={}));var o;(function(c){c.method="textDocument/semanticTokens/range",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method),c.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var l;(function(c){c.method="workspace/semanticTokens/refresh",c.messageDirection=t.MessageDirection.serverToClient,c.type=new t.ProtocolRequestType0(c.method)})(l||(e.SemanticTokensRefreshRequest=l={}))}}),Aw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ce(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),Ew=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ce(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),_w=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Ce(),r;(function(u){u.file="file",u.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(e.WillCreateFilesRequest=n={}));var a;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(a||(e.DidCreateFilesNotification=a={}));var s;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(s||(e.WillRenameFilesRequest=s={}));var o;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(o||(e.DidRenameFilesNotification=o={}));var l;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(l||(e.DidDeleteFilesNotification=l={}));var c;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(c||(e.WillDeleteFilesRequest=c={}))}}),Cw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ce(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(e.MonikerKind=n={}));var a;(function(s){s.method="textDocument/moniker",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.MonikerRequest=a={}))}}),Sw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var a;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.TypeHierarchySubtypesRequest=a={}))}}),bw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ce(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),ww=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ce(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.InlayHintResolveRequest=n={}));var a;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)})(a||(e.InlayHintRefreshRequest=a={}))}}),Iw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=Wa(),r=Qd(),n=Ce(),a;(function(u){function d(f){const h=f;return h&&r.boolean(h.retriggerRequest)}i(d,"is"),u.is=d})(a||(e.DiagnosticServerCancellationData=a={}));var s;(function(u){u.Full="full",u.Unchanged="unchanged"})(s||(e.DocumentDiagnosticReportKind=s={}));var o;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(l||(e.WorkspaceDiagnosticRequest=l={}));var c;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(c||(e.DiagnosticRefreshRequest=c={}))}}),Nw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(_s(),Zd(Al)),r=Qd(),n=Ce(),a;(function(v){v.Markup=1,v.Code=2;function C(b){return b===1||b===2}i(C,"is"),v.is=C})(a||(e.NotebookCellKind=a={}));var s;(function(v){function C(I,A){const k={executionOrder:I};return(A===!0||A===!1)&&(k.success=A),k}i(C,"create"),v.create=C;function b(I){const A=I;return r.objectLiteral(A)&&t.uinteger.is(A.executionOrder)&&(A.success===void 0||r.boolean(A.success))}i(b,"is"),v.is=b;function w(I,A){return I===A?!0:I==null||A===null||A===void 0?!1:I.executionOrder===A.executionOrder&&I.success===A.success}i(w,"equals"),v.equals=w})(s||(e.ExecutionSummary=s={}));var o;(function(v){function C(A,k){return{kind:A,document:k}}i(C,"create"),v.create=C;function b(A){const k=A;return r.objectLiteral(k)&&a.is(k.kind)&&t.DocumentUri.is(k.document)&&(k.metadata===void 0||r.objectLiteral(k.metadata))}i(b,"is"),v.is=b;function w(A,k){const G=new Set;return A.document!==k.document&&G.add("document"),A.kind!==k.kind&&G.add("kind"),A.executionSummary!==k.executionSummary&&G.add("executionSummary"),(A.metadata!==void 0||k.metadata!==void 0)&&!I(A.metadata,k.metadata)&&G.add("metadata"),(A.executionSummary!==void 0||k.executionSummary!==void 0)&&!s.equals(A.executionSummary,k.executionSummary)&&G.add("executionSummary"),G}i(w,"diff"),v.diff=w;function I(A,k){if(A===k)return!0;if(A==null||k===null||k===void 0||typeof A!=typeof k||typeof A!="object")return!1;const G=Array.isArray(A),H=Array.isArray(k);if(G!==H)return!1;if(G&&H){if(A.length!==k.length)return!1;for(let X=0;X0}i(ae,"hasId"),p.hasId=ae})(O||(e.StaticRegistrationOptions=O={}));var M;(function(p){function ae($e){const W=$e;return W&&(W.documentSelector===null||_.is(W.documentSelector))}i(ae,"is"),p.is=ae})(M||(e.TextDocumentRegistrationOptions=M={}));var D;(function(p){function ae(W){const m=W;return n.objectLiteral(m)&&(m.workDoneProgress===void 0||n.boolean(m.workDoneProgress))}i(ae,"is"),p.is=ae;function $e(W){const m=W;return m&&n.boolean(m.workDoneProgress)}i($e,"hasWorkDoneProgress"),p.hasWorkDoneProgress=$e})(D||(e.WorkDoneProgressOptions=D={}));var z;(function(p){p.method="initialize",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(z||(e.InitializeRequest=z={}));var B;(function(p){p.unknownProtocolVersion=1})(B||(e.InitializeErrorCodes=B={}));var Z;(function(p){p.method="initialized",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Z||(e.InitializedNotification=Z={}));var J;(function(p){p.method="shutdown",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType0(p.method)})(J||(e.ShutdownRequest=J={}));var te;(function(p){p.method="exit",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType0(p.method)})(te||(e.ExitNotification=te={}));var de;(function(p){p.method="workspace/didChangeConfiguration",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(de||(e.DidChangeConfigurationNotification=de={}));var ct;(function(p){p.Error=1,p.Warning=2,p.Info=3,p.Log=4,p.Debug=5})(ct||(e.MessageType=ct={}));var Re;(function(p){p.method="window/showMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Re||(e.ShowMessageNotification=Re={}));var Oe;(function(p){p.method="window/showMessageRequest",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType(p.method)})(Oe||(e.ShowMessageRequest=Oe={}));var qe;(function(p){p.method="window/logMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(qe||(e.LogMessageNotification=qe={}));var Se;(function(p){p.method="telemetry/event",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Se||(e.TelemetryEventNotification=Se={}));var Q;(function(p){p.None=0,p.Full=1,p.Incremental=2})(Q||(e.TextDocumentSyncKind=Q={}));var rt;(function(p){p.method="textDocument/didOpen",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(rt||(e.DidOpenTextDocumentNotification=rt={}));var me;(function(p){function ae(W){let m=W;return m!=null&&typeof m.text=="string"&&m.range!==void 0&&(m.rangeLength===void 0||typeof m.rangeLength=="number")}i(ae,"isIncremental"),p.isIncremental=ae;function $e(W){let m=W;return m!=null&&typeof m.text=="string"&&m.range===void 0&&m.rangeLength===void 0}i($e,"isFull"),p.isFull=$e})(me||(e.TextDocumentContentChangeEvent=me={}));var Nt;(function(p){p.method="textDocument/didChange",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Nt||(e.DidChangeTextDocumentNotification=Nt={}));var Zn;(function(p){p.method="textDocument/didClose",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Zn||(e.DidCloseTextDocumentNotification=Zn={}));var ri;(function(p){p.method="textDocument/didSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ri||(e.DidSaveTextDocumentNotification=ri={}));var ni;(function(p){p.Manual=1,p.AfterDelay=2,p.FocusOut=3})(ni||(e.TextDocumentSaveReason=ni={}));var ai;(function(p){p.method="textDocument/willSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ai||(e.WillSaveTextDocumentNotification=ai={}));var ii;(function(p){p.method="textDocument/willSaveWaitUntil",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ii||(e.WillSaveTextDocumentWaitUntilRequest=ii={}));var kt;(function(p){p.method="workspace/didChangeWatchedFiles",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(kt||(e.DidChangeWatchedFilesNotification=kt={}));var Qn;(function(p){p.Created=1,p.Changed=2,p.Deleted=3})(Qn||(e.FileChangeType=Qn={}));var si;(function(p){function ae($e){const W=$e;return n.objectLiteral(W)&&(r.URI.is(W.baseUri)||r.WorkspaceFolder.is(W.baseUri))&&n.string(W.pattern)}i(ae,"is"),p.is=ae})(si||(e.RelativePattern=si={}));var oi;(function(p){p.Create=1,p.Change=2,p.Delete=4})(oi||(e.WatchKind=oi={}));var li;(function(p){p.method="textDocument/publishDiagnostics",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(li||(e.PublishDiagnosticsNotification=li={}));var ci;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.TriggerForIncompleteCompletions=3})(ci||(e.CompletionTriggerKind=ci={}));var ea;(function(p){p.method="textDocument/completion",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ea||(e.CompletionRequest=ea={}));var ta;(function(p){p.method="completionItem/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ta||(e.CompletionResolveRequest=ta={}));var zt;(function(p){p.method="textDocument/hover",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(zt||(e.HoverRequest=zt={}));var ra;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.ContentChange=3})(ra||(e.SignatureHelpTriggerKind=ra={}));var ui;(function(p){p.method="textDocument/signatureHelp",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ui||(e.SignatureHelpRequest=ui={}));var di;(function(p){p.method="textDocument/definition",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(di||(e.DefinitionRequest=di={}));var na;(function(p){p.method="textDocument/references",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(na||(e.ReferencesRequest=na={}));var aa;(function(p){p.method="textDocument/documentHighlight",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(aa||(e.DocumentHighlightRequest=aa={}));var fi;(function(p){p.method="textDocument/documentSymbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(fi||(e.DocumentSymbolRequest=fi={}));var qs;(function(p){p.method="textDocument/codeAction",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(qs||(e.CodeActionRequest=qs={}));var pi;(function(p){p.method="codeAction/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(pi||(e.CodeActionResolveRequest=pi={}));var hi;(function(p){p.method="workspace/symbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(hi||(e.WorkspaceSymbolRequest=hi={}));var mi;(function(p){p.method="workspaceSymbol/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(mi||(e.WorkspaceSymbolResolveRequest=mi={}));var gi;(function(p){p.method="textDocument/codeLens",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(gi||(e.CodeLensRequest=gi={}));var $t;(function(p){p.method="codeLens/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($t||(e.CodeLensResolveRequest=$t={}));var yi;(function(p){p.method="workspace/codeLens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(yi||(e.CodeLensRefreshRequest=yi={}));var vi;(function(p){p.method="textDocument/documentLink",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(vi||(e.DocumentLinkRequest=vi={}));var Pr;(function(p){p.method="documentLink/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Pr||(e.DocumentLinkResolveRequest=Pr={}));var Ti;(function(p){p.method="textDocument/formatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ti||(e.DocumentFormattingRequest=Ti={}));var Yr;(function(p){p.method="textDocument/rangeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Yr||(e.DocumentRangeFormattingRequest=Yr={}));var Ri;(function(p){p.method="textDocument/rangesFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ri||(e.DocumentRangesFormattingRequest=Ri={}));var Bt;(function(p){p.method="textDocument/onTypeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Bt||(e.DocumentOnTypeFormattingRequest=Bt={}));var lr;(function(p){p.Identifier=1})(lr||(e.PrepareSupportDefaultBehavior=lr={}));var $i;(function(p){p.method="textDocument/rename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($i||(e.RenameRequest=$i={}));var Ai;(function(p){p.method="textDocument/prepareRename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ai||(e.PrepareRenameRequest=Ai={}));var cr;(function(p){p.method="workspace/executeCommand",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(cr||(e.ExecuteCommandRequest=cr={}));var ia;(function(p){p.method="workspace/applyEdit",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType("workspace/applyEdit")})(ia||(e.ApplyWorkspaceEditRequest=ia={}))}}),Ow=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=Wa();function r(n,a,s,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,a,s,o)}i(r,"createProtocolConnection"),e.createProtocolConnection=r}}),Lw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(o,l);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,c,u)}):(function(s,o,l,c){c===void 0&&(c=l),s[c]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(Wa(),e),r((_s(),Zd(Al)),e),r(Ce(),e),r(Pw(),e);var n=Ow();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:i(function(){return n.createProtocolConnection},"get")});var a;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))}}),Dw=V({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(o,l);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,c,u)}):(function(s,o,l,c){c===void 0&&(c=l),s[c]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=xh();r(xh(),e),r(Lw(),e);function a(s,o,l,c){return(0,n.createMessageConnection)(s,o,l,c)}i(a,"createProtocolConnection"),e.createProtocolConnection=a}}),Dg={};Kr(Dg,{AbstractAstReflection:()=>rf,AbstractCstNode:()=>ih,AbstractLangiumParser:()=>oh,AbstractParserErrorMessageProvider:()=>CS,AbstractThreadedAsyncParser:()=>iF,AstUtils:()=>nf,BiMap:()=>yl,Cancellation:()=>pe,CompositeCstNodeImpl:()=>Tc,ContextCache:()=>Sc,CstNodeBuilder:()=>$S,CstUtils:()=>ef,DEFAULT_TOKENIZE_OPTIONS:()=>Ch,DONE_RESULT:()=>Ve,DatatypeSymbol:()=>pl,DefaultAstNodeDescriptionProvider:()=>tb,DefaultAstNodeLocator:()=>nb,DefaultAsyncParser:()=>$b,DefaultCommentProvider:()=>Rb,DefaultConfigurationProvider:()=>ab,DefaultDocumentBuilder:()=>ib,DefaultDocumentValidator:()=>eb,DefaultHydrator:()=>Eb,DefaultIndexManager:()=>sb,DefaultJsonSerializer:()=>XS,DefaultLangiumDocumentFactory:()=>US,DefaultLangiumDocuments:()=>zS,DefaultLangiumProfiler:()=>uF,DefaultLexer:()=>Sh,DefaultLexerErrorMessageProvider:()=>lb,DefaultLinker:()=>BS,DefaultNameProvider:()=>KS,DefaultReferenceDescriptionProvider:()=>rb,DefaultReferences:()=>qS,DefaultScopeComputation:()=>WS,DefaultScopeProvider:()=>YS,DefaultServiceRegistry:()=>JS,DefaultTokenBuilder:()=>Ac,DefaultValueConverter:()=>hh,DefaultWorkspaceLock:()=>Ab,DefaultWorkspaceManager:()=>ob,Deferred:()=>Sr,Disposable:()=>Sn,DisposableCache:()=>Cc,DocumentCache:()=>HS,DocumentState:()=>Y,DocumentValidator:()=>Et,EMPTY_SCOPE:()=>tF,EMPTY_STREAM:()=>Oa,EmptyFileSystem:()=>It,EmptyFileSystemProvider:()=>Sb,ErrorWithLocation:()=>Pl,GrammarAST:()=>Fg,GrammarUtils:()=>Lf,IndentationAwareLexer:()=>oF,IndentationAwareTokenBuilder:()=>Cb,JSDocDocumentationProvider:()=>Tb,LangiumCompletionParser:()=>SS,LangiumParser:()=>_S,LangiumParserErrorMessageProvider:()=>lh,LeafCstNodeImpl:()=>fl,LexingMode:()=>_n,MapScope:()=>eF,Module:()=>Md,MultiMap:()=>br,MultiMapScope:()=>VS,OperationCancelled:()=>Zt,ParserWorker:()=>sF,ProfilingTask:()=>wb,Reduction:()=>os,RefResolving:()=>sn,RegExpUtils:()=>Mf,RootCstNodeImpl:()=>sh,SimpleCache:()=>Rh,StreamImpl:()=>Jt,StreamScope:()=>Pd,TextDocument:()=>ml,TreeStreamImpl:()=>La,URI:()=>dt,UriTrie:()=>vh,UriUtils:()=>Ye,VALIDATE_EACH_NODE:()=>QS,ValidationCategory:()=>vl,ValidationRegistry:()=>ZS,ValueConverter:()=>Yt,WorkspaceCache:()=>$h,assertCondition:()=>Df,assertUnreachable:()=>qr,createCompletionParser:()=>dh,createDefaultCoreModule:()=>yt,createDefaultSharedCoreModule:()=>vt,createGrammarConfig:()=>ep,createLangiumParser:()=>fh,createParser:()=>Rc,delayNextTick:()=>Ec,diagnosticData:()=>En,eagerLoad:()=>Oh,getDiagnosticRange:()=>Eh,indentationBuilderDefaultOptions:()=>Fd,inject:()=>Ae,interruptAndCheck:()=>Ge,isAstNode:()=>Le,isAstNodeDescription:()=>tf,isAstNodeWithComment:()=>Ah,isCompositeCstNode:()=>vr,isIMultiModeLexerDefinition:()=>Ic,isJSDoc:()=>wh,isLeafCstNode:()=>Pn,isLinkingError:()=>cn,isMultiReference:()=>Qt,isNamed:()=>Th,isOperationCancelled:()=>Jn,isReference:()=>He,isRootCstNode:()=>_l,isTokenTypeArray:()=>wc,isTokenTypeDictionary:()=>Tl,loadGrammarFromJson:()=>Tt,parseJSDoc:()=>bh,prepareLangiumParser:()=>ph,setInterruptionPeriod:()=>mh,startCancelableOperation:()=>_c,stream:()=>oe,toDiagnosticData:()=>_h,toDiagnosticSeverity:()=>is});var ef={};Kr(ef,{DefaultNameRegexp:()=>If,RangeComparison:()=>Xt,compareRange:()=>bf,findCommentNode:()=>Nf,findDeclarationNodeAtOffset:()=>ny,findLeafNodeAtOffset:()=>kl,findLeafNodeBeforeOffset:()=>kf,flattenCst:()=>ry,getDatatypeNode:()=>ty,getInteriorNodes:()=>sy,getNextNode:()=>ay,getPreviousNode:()=>Of,getStartlineNode:()=>iy,inRange:()=>wf,isChildNode:()=>Sf,isCommentNode:()=>Xo,streamCst:()=>Fa,toDocumentSegment:()=>Ga,tokenToRange:()=>ls});function Le(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}i(Le,"isAstNode");function He(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}i(He,"isReference");function Qt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}i(Qt,"isMultiReference");function tf(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}i(tf,"isAstNodeDescription");function cn(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}i(cn,"isLinkingError");var rf=class{static{i(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Le(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const n=r[t];if(n!==void 0)return n;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),n=[];for(const a of r)this.isSubtype(a,e)&&n.push(a);return this.allSubtypes[e]=n,n}}};function vr(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}i(vr,"isCompositeCstNode");function Pn(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}i(Pn,"isLeafCstNode");function _l(e){return vr(e)&&typeof e.fullText=="string"}i(_l,"isRootCstNode");var Jt=class fr{static{i(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){const t={state:this.startFn(),next:i(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const t=this.iterator();let r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){const t=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){const n=this.map(a=>[t?t(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(t){return new fr(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ve})}join(t=","){const r=this.iterator();let n="",a,s=!1;do a=r.next(),a.done||(s&&(n+=t),n+=Mg(a.value)),s=!0;while(!a.done);return n}indexOf(t,r=0){const n=this.iterator();let a=0,s=n.next();for(;!s.done;){if(a>=r&&s.value===t)return a;s=n.next(),a++}return-1}every(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)t(a.value,n),a=r.next(),n++}map(t){return new fr(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?Ve:{done:!1,value:t(a)}})}filter(t){return new fr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return Ve})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){const n=this.iterator();let a=r,s=n.next();for(;!s.done;)a===void 0?a=s.value:a=t(a,s.value),s=n.next();return a}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){const a=t.next();if(a.done)return n;const s=this.recursiveReduce(t,r,n);return s===void 0?a.value:r(s,a.value)}find(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(t(a.value))return n;a=r.next(),n++}return-1}includes(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new fr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:a}=this.nextFn(r.this);if(!n){const s=t(a);if(ss(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return Ve})}flat(t){if(t===void 0&&(t=1),t<=0)return this;const r=t>1?this.flat(t-1):this;return new fr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:s}=r.nextFn(n.this);if(!a)if(ss(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return Ve})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new fr(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?Ve:this.nextFn(r.state)))}distinct(t){return new fr(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=t?t(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return Ve})}exclude(t,r){const n=new Set;for(const a of t){const s=r?r(a):a;n.add(s)}return this.filter(a=>{const s=r?r(a):a;return!n.has(s)})}};function Mg(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}i(Mg,"toString");function ss(e){return!!e&&typeof e[Symbol.iterator]=="function"}i(ss,"isIterable");var Oa=new Jt(()=>{},()=>Ve),Ve=Object.freeze({done:!0,value:void 0});function oe(...e){if(e.length===1){const t=e[0];if(t instanceof Jt)return t;if(ss(t))return new Jt(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new Jt(()=>({index:0}),r=>r.index1?new Jt(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){const s=n.iterators[n.iterators.length-1].next();if(s.done)n.iterators.pop();else return n.iterators.push(t(s.value)[Symbol.iterator]()),s}return Ve})}iterator(){const e={state:this.startFn(),next:i(()=>this.nextFn(e.state),"next"),prune:i(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},os;(function(e){function t(s){return s.reduce((o,l)=>o+l,0)}i(t,"sum"),e.sum=t;function r(s){return s.reduce((o,l)=>o*l,0)}i(r,"product"),e.product=r;function n(s){return s.reduce((o,l)=>Math.min(o,l))}i(n,"min"),e.min=n;function a(s){return s.reduce((o,l)=>Math.max(o,l))}i(a,"max"),e.max=a})(os||(os={}));var nf={};Kr(nf,{assignMandatoryProperties:()=>af,copyAstNode:()=>Mo,findRootNode:()=>Ia,getContainerOfType:()=>On,getDocument:()=>Dt,getReferenceNodes:()=>Lo,hasContainerOfType:()=>xg,linkContentToContainer:()=>Da,streamAllContents:()=>wr,streamAst:()=>Mt,streamContents:()=>Ss,streamReferences:()=>Ma});function Da(e,t={}){for(const[r,n]of Object.entries(e))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,s)=>{Le(a)&&(a.$container=e,a.$containerProperty=r,a.$containerIndex=s,t.deep&&Da(a,t))}):Le(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&Da(n,t)))}i(Da,"linkContentToContainer");function On(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}i(On,"getContainerOfType");function xg(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}i(xg,"hasContainerOfType");function Dt(e){const r=Ia(e).$document;if(!r)throw new Error("AST node has no document.");return r}i(Dt,"getDocument");function Ia(e){for(;e.$container;)e=e.$container;return e}i(Ia,"findRootNode");function Lo(e){return He(e)?e.ref?[e.ref]:[]:Qt(e)?e.items.map(t=>t.ref):[]}i(Lo,"getReferenceNodes");function Ss(e,t){if(!e)throw new Error("Node must be an AstNode.");const r=t?.range;return new Jt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexSs(r,t))}i(wr,"streamAllContents");function Mt(e,t){if(e){if(t?.range&&!Do(e,t.range))return new La(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new La(e,r=>Ss(r,t),{includeRoot:!0})}i(Mt,"streamAst");function Do(e,t){if(!t)return!0;const r=e.$cstNode?.range;return r?wf(r,t):!1}i(Do,"isAstNodeInRange");function Ma(e){return new Jt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexnt,AbstractParserRule:()=>qi,AbstractRule:()=>$a,AbstractType:()=>ut,Action:()=>Lr,Alternatives:()=>Wi,ArrayLiteral:()=>xo,ArrayType:()=>Fo,Assignment:()=>Dr,BooleanLiteral:()=>Go,CharacterRange:()=>Mr,Condition:()=>xr,Conjunction:()=>Vi,CrossReference:()=>Fr,Disjunction:()=>Hi,EndOfFile:()=>jo,Grammar:()=>mr,GrammarImport:()=>Uo,Group:()=>un,InferredType:()=>zo,InfixRule:()=>Ht,InfixRuleOperatorList:()=>Yi,InfixRuleOperators:()=>Bo,Interface:()=>Aa,Keyword:()=>Ea,LangiumGrammarAstReflection:()=>Cf,LangiumGrammarTerminals:()=>Mw,NamedArgument:()=>_a,NegatedToken:()=>dn,Negation:()=>Ko,NumberLiteral:()=>qo,Parameter:()=>Ca,ParameterReference:()=>Wo,ParserRule:()=>Pt,ReferenceType:()=>Xi,RegexToken:()=>fn,ReturnType:()=>Vo,RuleCall:()=>pn,SimpleType:()=>Sa,StringLiteral:()=>Ho,TerminalAlternatives:()=>hn,TerminalElement:()=>at,TerminalGroup:()=>mn,TerminalRule:()=>gr,TerminalRuleCall:()=>gn,Type:()=>Ji,TypeAttribute:()=>yn,TypeDefinition:()=>vn,UnionType:()=>Yo,UnorderedGroup:()=>Zi,UntilToken:()=>Tn,ValueLiteral:()=>Rn,Wildcard:()=>ba,isAbstractElement:()=>Cl,isAbstractParserRule:()=>Ln,isAbstractRule:()=>Gg,isAbstractType:()=>jg,isAction:()=>Gr,isAlternatives:()=>Sl,isArrayLiteral:()=>Ug,isArrayType:()=>of,isAssignment:()=>Tr,isBooleanLiteral:()=>lf,isCharacterRange:()=>cf,isCondition:()=>zg,isConjunction:()=>uf,isCrossReference:()=>Dn,isDisjunction:()=>df,isEndOfFile:()=>ff,isGrammar:()=>Bg,isGrammarImport:()=>Kg,isGroup:()=>Mn,isInferredType:()=>bs,isInfixRule:()=>xa,isInfixRuleOperatorList:()=>qg,isInfixRuleOperators:()=>Wg,isInterface:()=>pf,isKeyword:()=>Rr,isNamedArgument:()=>Vg,isNegatedToken:()=>hf,isNegation:()=>mf,isNumberLiteral:()=>Hg,isParameter:()=>Yg,isParameterReference:()=>gf,isParserRule:()=>Je,isReferenceType:()=>yf,isRegexToken:()=>vf,isReturnType:()=>Tf,isRuleCall:()=>$r,isSimpleType:()=>bl,isStringLiteral:()=>Xg,isTerminalAlternatives:()=>Rf,isTerminalElement:()=>Jg,isTerminalGroup:()=>$f,isTerminalRule:()=>bt,isTerminalRuleCall:()=>wl,isType:()=>Il,isTypeAttribute:()=>Zg,isTypeDefinition:()=>Qg,isUnionType:()=>Af,isUnorderedGroup:()=>Nl,isUntilToken:()=>Ef,isValueLiteral:()=>ey,isWildcard:()=>_f,reflection:()=>j});var Mw={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},nt={$type:"AbstractElement",cardinality:"cardinality"};function Cl(e){return j.isInstance(e,nt.$type)}i(Cl,"isAbstractElement");var qi={$type:"AbstractParserRule"};function Ln(e){return j.isInstance(e,qi.$type)}i(Ln,"isAbstractParserRule");var $a={$type:"AbstractRule"};function Gg(e){return j.isInstance(e,$a.$type)}i(Gg,"isAbstractRule");var ut={$type:"AbstractType"};function jg(e){return j.isInstance(e,ut.$type)}i(jg,"isAbstractType");var Lr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Gr(e){return j.isInstance(e,Lr.$type)}i(Gr,"isAction");var Wi={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Sl(e){return j.isInstance(e,Wi.$type)}i(Sl,"isAlternatives");var xo={$type:"ArrayLiteral",elements:"elements"};function Ug(e){return j.isInstance(e,xo.$type)}i(Ug,"isArrayLiteral");var Fo={$type:"ArrayType",elementType:"elementType"};function of(e){return j.isInstance(e,Fo.$type)}i(of,"isArrayType");var Dr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Tr(e){return j.isInstance(e,Dr.$type)}i(Tr,"isAssignment");var Go={$type:"BooleanLiteral",true:"true"};function lf(e){return j.isInstance(e,Go.$type)}i(lf,"isBooleanLiteral");var Mr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function cf(e){return j.isInstance(e,Mr.$type)}i(cf,"isCharacterRange");var xr={$type:"Condition"};function zg(e){return j.isInstance(e,xr.$type)}i(zg,"isCondition");var Vi={$type:"Conjunction",left:"left",right:"right"};function uf(e){return j.isInstance(e,Vi.$type)}i(uf,"isConjunction");var Fr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Dn(e){return j.isInstance(e,Fr.$type)}i(Dn,"isCrossReference");var Hi={$type:"Disjunction",left:"left",right:"right"};function df(e){return j.isInstance(e,Hi.$type)}i(df,"isDisjunction");var jo={$type:"EndOfFile",cardinality:"cardinality"};function ff(e){return j.isInstance(e,jo.$type)}i(ff,"isEndOfFile");var mr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function Bg(e){return j.isInstance(e,mr.$type)}i(Bg,"isGrammar");var Uo={$type:"GrammarImport",path:"path"};function Kg(e){return j.isInstance(e,Uo.$type)}i(Kg,"isGrammarImport");var un={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Mn(e){return j.isInstance(e,un.$type)}i(Mn,"isGroup");var zo={$type:"InferredType",name:"name"};function bs(e){return j.isInstance(e,zo.$type)}i(bs,"isInferredType");var Ht={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function xa(e){return j.isInstance(e,Ht.$type)}i(xa,"isInfixRule");var Yi={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function qg(e){return j.isInstance(e,Yi.$type)}i(qg,"isInfixRuleOperatorList");var Bo={$type:"InfixRuleOperators",precedences:"precedences"};function Wg(e){return j.isInstance(e,Bo.$type)}i(Wg,"isInfixRuleOperators");var Aa={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function pf(e){return j.isInstance(e,Aa.$type)}i(pf,"isInterface");var Ea={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Rr(e){return j.isInstance(e,Ea.$type)}i(Rr,"isKeyword");var _a={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function Vg(e){return j.isInstance(e,_a.$type)}i(Vg,"isNamedArgument");var dn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function hf(e){return j.isInstance(e,dn.$type)}i(hf,"isNegatedToken");var Ko={$type:"Negation",value:"value"};function mf(e){return j.isInstance(e,Ko.$type)}i(mf,"isNegation");var qo={$type:"NumberLiteral",value:"value"};function Hg(e){return j.isInstance(e,qo.$type)}i(Hg,"isNumberLiteral");var Ca={$type:"Parameter",name:"name"};function Yg(e){return j.isInstance(e,Ca.$type)}i(Yg,"isParameter");var Wo={$type:"ParameterReference",parameter:"parameter"};function gf(e){return j.isInstance(e,Wo.$type)}i(gf,"isParameterReference");var Pt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Je(e){return j.isInstance(e,Pt.$type)}i(Je,"isParserRule");var Xi={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function yf(e){return j.isInstance(e,Xi.$type)}i(yf,"isReferenceType");var fn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function vf(e){return j.isInstance(e,fn.$type)}i(vf,"isRegexToken");var Vo={$type:"ReturnType",name:"name"};function Tf(e){return j.isInstance(e,Vo.$type)}i(Tf,"isReturnType");var pn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function $r(e){return j.isInstance(e,pn.$type)}i($r,"isRuleCall");var Sa={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function bl(e){return j.isInstance(e,Sa.$type)}i(bl,"isSimpleType");var Ho={$type:"StringLiteral",value:"value"};function Xg(e){return j.isInstance(e,Ho.$type)}i(Xg,"isStringLiteral");var hn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Rf(e){return j.isInstance(e,hn.$type)}i(Rf,"isTerminalAlternatives");var at={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Jg(e){return j.isInstance(e,at.$type)}i(Jg,"isTerminalElement");var mn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function $f(e){return j.isInstance(e,mn.$type)}i($f,"isTerminalGroup");var gr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function bt(e){return j.isInstance(e,gr.$type)}i(bt,"isTerminalRule");var gn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function wl(e){return j.isInstance(e,gn.$type)}i(wl,"isTerminalRuleCall");var Ji={$type:"Type",name:"name",type:"type"};function Il(e){return j.isInstance(e,Ji.$type)}i(Il,"isType");var yn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function Zg(e){return j.isInstance(e,yn.$type)}i(Zg,"isTypeAttribute");var vn={$type:"TypeDefinition"};function Qg(e){return j.isInstance(e,vn.$type)}i(Qg,"isTypeDefinition");var Yo={$type:"UnionType",types:"types"};function Af(e){return j.isInstance(e,Yo.$type)}i(Af,"isUnionType");var Zi={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Nl(e){return j.isInstance(e,Zi.$type)}i(Nl,"isUnorderedGroup");var Tn={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Ef(e){return j.isInstance(e,Tn.$type)}i(Ef,"isUntilToken");var Rn={$type:"ValueLiteral"};function ey(e){return j.isInstance(e,Rn.$type)}i(ey,"isValueLiteral");var ba={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function _f(e){return j.isInstance(e,ba.$type)}i(_f,"isWildcard");var Cf=class extends rf{static{i(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:nt.$type,properties:{cardinality:{name:nt.cardinality}},superTypes:[]},AbstractParserRule:{name:qi.$type,properties:{},superTypes:[$a.$type,ut.$type]},AbstractRule:{name:$a.$type,properties:{},superTypes:[]},AbstractType:{name:ut.$type,properties:{},superTypes:[]},Action:{name:Lr.$type,properties:{cardinality:{name:Lr.cardinality},feature:{name:Lr.feature},inferredType:{name:Lr.inferredType},operator:{name:Lr.operator},type:{name:Lr.type,referenceType:ut.$type}},superTypes:[nt.$type]},Alternatives:{name:Wi.$type,properties:{cardinality:{name:Wi.cardinality},elements:{name:Wi.elements,defaultValue:[]}},superTypes:[nt.$type]},ArrayLiteral:{name:xo.$type,properties:{elements:{name:xo.elements,defaultValue:[]}},superTypes:[Rn.$type]},ArrayType:{name:Fo.$type,properties:{elementType:{name:Fo.elementType}},superTypes:[vn.$type]},Assignment:{name:Dr.$type,properties:{cardinality:{name:Dr.cardinality},feature:{name:Dr.feature},operator:{name:Dr.operator},predicate:{name:Dr.predicate},terminal:{name:Dr.terminal}},superTypes:[nt.$type]},BooleanLiteral:{name:Go.$type,properties:{true:{name:Go.true,defaultValue:!1}},superTypes:[xr.$type,Rn.$type]},CharacterRange:{name:Mr.$type,properties:{cardinality:{name:Mr.cardinality},left:{name:Mr.left},lookahead:{name:Mr.lookahead},parenthesized:{name:Mr.parenthesized,defaultValue:!1},right:{name:Mr.right}},superTypes:[at.$type]},Condition:{name:xr.$type,properties:{},superTypes:[]},Conjunction:{name:Vi.$type,properties:{left:{name:Vi.left},right:{name:Vi.right}},superTypes:[xr.$type]},CrossReference:{name:Fr.$type,properties:{cardinality:{name:Fr.cardinality},deprecatedSyntax:{name:Fr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Fr.isMulti,defaultValue:!1},terminal:{name:Fr.terminal},type:{name:Fr.type,referenceType:ut.$type}},superTypes:[nt.$type]},Disjunction:{name:Hi.$type,properties:{left:{name:Hi.left},right:{name:Hi.right}},superTypes:[xr.$type]},EndOfFile:{name:jo.$type,properties:{cardinality:{name:jo.cardinality}},superTypes:[nt.$type]},Grammar:{name:mr.$type,properties:{imports:{name:mr.imports,defaultValue:[]},interfaces:{name:mr.interfaces,defaultValue:[]},isDeclared:{name:mr.isDeclared,defaultValue:!1},name:{name:mr.name},rules:{name:mr.rules,defaultValue:[]},types:{name:mr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Uo.$type,properties:{path:{name:Uo.path}},superTypes:[]},Group:{name:un.$type,properties:{cardinality:{name:un.cardinality},elements:{name:un.elements,defaultValue:[]},guardCondition:{name:un.guardCondition},predicate:{name:un.predicate}},superTypes:[nt.$type]},InferredType:{name:zo.$type,properties:{name:{name:zo.name}},superTypes:[ut.$type]},InfixRule:{name:Ht.$type,properties:{call:{name:Ht.call},dataType:{name:Ht.dataType},inferredType:{name:Ht.inferredType},name:{name:Ht.name},operators:{name:Ht.operators},parameters:{name:Ht.parameters,defaultValue:[]},returnType:{name:Ht.returnType,referenceType:ut.$type}},superTypes:[qi.$type]},InfixRuleOperatorList:{name:Yi.$type,properties:{associativity:{name:Yi.associativity},operators:{name:Yi.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Bo.$type,properties:{precedences:{name:Bo.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Aa.$type,properties:{attributes:{name:Aa.attributes,defaultValue:[]},name:{name:Aa.name},superTypes:{name:Aa.superTypes,defaultValue:[],referenceType:ut.$type}},superTypes:[ut.$type]},Keyword:{name:Ea.$type,properties:{cardinality:{name:Ea.cardinality},predicate:{name:Ea.predicate},value:{name:Ea.value}},superTypes:[nt.$type]},NamedArgument:{name:_a.$type,properties:{calledByName:{name:_a.calledByName,defaultValue:!1},parameter:{name:_a.parameter,referenceType:Ca.$type},value:{name:_a.value}},superTypes:[]},NegatedToken:{name:dn.$type,properties:{cardinality:{name:dn.cardinality},lookahead:{name:dn.lookahead},parenthesized:{name:dn.parenthesized,defaultValue:!1},terminal:{name:dn.terminal}},superTypes:[at.$type]},Negation:{name:Ko.$type,properties:{value:{name:Ko.value}},superTypes:[xr.$type]},NumberLiteral:{name:qo.$type,properties:{value:{name:qo.value}},superTypes:[Rn.$type]},Parameter:{name:Ca.$type,properties:{name:{name:Ca.name}},superTypes:[]},ParameterReference:{name:Wo.$type,properties:{parameter:{name:Wo.parameter,referenceType:Ca.$type}},superTypes:[xr.$type]},ParserRule:{name:Pt.$type,properties:{dataType:{name:Pt.dataType},definition:{name:Pt.definition},entry:{name:Pt.entry,defaultValue:!1},fragment:{name:Pt.fragment,defaultValue:!1},inferredType:{name:Pt.inferredType},name:{name:Pt.name},parameters:{name:Pt.parameters,defaultValue:[]},returnType:{name:Pt.returnType,referenceType:ut.$type}},superTypes:[qi.$type]},ReferenceType:{name:Xi.$type,properties:{isMulti:{name:Xi.isMulti,defaultValue:!1},referenceType:{name:Xi.referenceType}},superTypes:[vn.$type]},RegexToken:{name:fn.$type,properties:{cardinality:{name:fn.cardinality},lookahead:{name:fn.lookahead},parenthesized:{name:fn.parenthesized,defaultValue:!1},regex:{name:fn.regex}},superTypes:[at.$type]},ReturnType:{name:Vo.$type,properties:{name:{name:Vo.name}},superTypes:[]},RuleCall:{name:pn.$type,properties:{arguments:{name:pn.arguments,defaultValue:[]},cardinality:{name:pn.cardinality},predicate:{name:pn.predicate},rule:{name:pn.rule,referenceType:$a.$type}},superTypes:[nt.$type]},SimpleType:{name:Sa.$type,properties:{primitiveType:{name:Sa.primitiveType},stringType:{name:Sa.stringType},typeRef:{name:Sa.typeRef,referenceType:ut.$type}},superTypes:[vn.$type]},StringLiteral:{name:Ho.$type,properties:{value:{name:Ho.value}},superTypes:[Rn.$type]},TerminalAlternatives:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},elements:{name:hn.elements,defaultValue:[]},lookahead:{name:hn.lookahead},parenthesized:{name:hn.parenthesized,defaultValue:!1}},superTypes:[at.$type]},TerminalElement:{name:at.$type,properties:{cardinality:{name:at.cardinality},lookahead:{name:at.lookahead},parenthesized:{name:at.parenthesized,defaultValue:!1}},superTypes:[nt.$type]},TerminalGroup:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},elements:{name:mn.elements,defaultValue:[]},lookahead:{name:mn.lookahead},parenthesized:{name:mn.parenthesized,defaultValue:!1}},superTypes:[at.$type]},TerminalRule:{name:gr.$type,properties:{definition:{name:gr.definition},fragment:{name:gr.fragment,defaultValue:!1},hidden:{name:gr.hidden,defaultValue:!1},name:{name:gr.name},type:{name:gr.type}},superTypes:[$a.$type]},TerminalRuleCall:{name:gn.$type,properties:{cardinality:{name:gn.cardinality},lookahead:{name:gn.lookahead},parenthesized:{name:gn.parenthesized,defaultValue:!1},rule:{name:gn.rule,referenceType:gr.$type}},superTypes:[at.$type]},Type:{name:Ji.$type,properties:{name:{name:Ji.name},type:{name:Ji.type}},superTypes:[ut.$type]},TypeAttribute:{name:yn.$type,properties:{defaultValue:{name:yn.defaultValue},isOptional:{name:yn.isOptional,defaultValue:!1},name:{name:yn.name},type:{name:yn.type}},superTypes:[]},TypeDefinition:{name:vn.$type,properties:{},superTypes:[]},UnionType:{name:Yo.$type,properties:{types:{name:Yo.types,defaultValue:[]}},superTypes:[vn.$type]},UnorderedGroup:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality},elements:{name:Zi.elements,defaultValue:[]}},superTypes:[nt.$type]},UntilToken:{name:Tn.$type,properties:{cardinality:{name:Tn.cardinality},lookahead:{name:Tn.lookahead},parenthesized:{name:Tn.parenthesized,defaultValue:!1},terminal:{name:Tn.terminal}},superTypes:[at.$type]},ValueLiteral:{name:Rn.$type,properties:{},superTypes:[]},Wildcard:{name:ba.$type,properties:{cardinality:{name:ba.cardinality},lookahead:{name:ba.lookahead},parenthesized:{name:ba.parenthesized,defaultValue:!1}},superTypes:[at.$type]}}}},j=new Cf;function ty(e){let t=e,r=!1;for(;t;){const n=On(t.grammarSource,Je);if(n&&n.dataType)t=t.container,r=!0;else return r?t:void 0}}i(ty,"getDatatypeNode");function Fa(e){return new La(e,t=>vr(t)?t.content:[],{includeRoot:!0})}i(Fa,"streamCst");function ry(e){return Fa(e).filter(Pn)}i(ry,"flattenCst");function Sf(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}i(Sf,"isChildNode");function ls(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}i(ls,"tokenToRange");function Ga(e){if(!e)return;const{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}i(Ga,"toDocumentSegment");var Xt;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Xt||(Xt={}));function bf(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Xt.After;const r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.lineXt.After}i(wf,"inRange");var If=/^[\w\p{L}]$/u;function ny(e,t,r=If){if(e){if(t>0){const n=t-e.offset,a=e.text.charAt(n);r.test(a)||t--}return kl(e,t)}}i(ny,"findDeclarationNodeAtOffset");function Nf(e,t){if(e){const r=Of(e,!0);if(r&&Xo(r,t))return r;if(_l(e)){const n=e.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const s=e.content[a];if(Xo(s,t))return s}}}}i(Nf,"findCommentNode");function Xo(e,t){return Pn(e)&&t.includes(e.tokenType.name)}i(Xo,"isCommentNode");function kl(e,t){if(Pn(e))return e;if(vr(e)){const r=Pf(e,t,!1);if(r)return kl(r,t)}}i(kl,"findLeafNodeAtOffset");function kf(e,t){if(Pn(e))return e;if(vr(e)){const r=Pf(e,t,!0);if(r)return kf(r,t)}}i(kf,"findLeafNodeBeforeOffset");function Pf(e,t,r){let n=0,a=e.content.length-1,s;for(;n<=a;){const o=Math.floor((n+a)/2),l=e.content[o];if(l.offset<=t&&l.end>t)return l;l.end<=t?(s=r?l:void 0,n=o+1):a=o-1}return s}i(Pf,"binarySearch");function Of(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);for(;n>0;){n--;const a=r.content[n];if(t||!a.hidden)return a}e=r}}i(Of,"getPreviousNode");function ay(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);const a=r.content.length-1;for(;nVf,findNameAssignment:()=>Gl,findNodeForKeyword:()=>Wf,findNodeForProperty:()=>Ml,findNodesForKeyword:()=>my,findNodesForKeywordInternal:()=>Fl,findNodesForProperty:()=>qf,getActionAtElement:()=>Yf,getActionType:()=>Jf,getAllReachableRules:()=>Dl,getAllRulesUsedForCrossReferences:()=>hy,getCrossReferenceTerminal:()=>Bf,getEntryRule:()=>jf,getExplicitRuleType:()=>Is,getHiddenRules:()=>Uf,getRuleType:()=>Zf,getRuleTypeName:()=>Ry,getTypeName:()=>bn,isArrayCardinality:()=>yy,isArrayOperator:()=>vy,isCommentTerminal:()=>Kf,isDataType:()=>Ty,isDataTypeRule:()=>ws,isOptionalCardinality:()=>gy,terminalRegex:()=>Ns});var Pl=class extends Error{static{i(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function qr(e,t="Error: Got unexpected value."){throw new Error(t)}i(qr,"assertUnreachable");function Df(e,t="Error: Condition is violated."){if(!e)throw new Error(t)}i(Df,"assertCondition");var Mf={};Kr(Mf,{NEWLINE_REGEXP:()=>uy,escapeRegExp:()=>Va,getTerminalParts:()=>fy,isMultilineComment:()=>xf,isWhitespace:()=>Ll,partialMatches:()=>Ff,partialRegExp:()=>Gf,whitespaceCharacters:()=>py});function K(e){return e.charCodeAt(0)}i(K,"cc");function To(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}i(To,"insertToSet");function ha(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}i(ha,"addFlag");function rn(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}i(rn,"ASSERT_EXISTS");function ly(){throw Error("Internal Error - Should never get here!")}i(ly,"ASSERT_NEVER_REACH_HERE");function rd(e){return e.type==="Character"}i(rd,"isCharacter");var Jo=[];for(let e=K("0");e<=K("9");e++)Jo.push(e);var Zo=[K("_")].concat(Jo);for(let e=K("a");e<=K("z");e++)Zo.push(e);for(let e=K("A");e<=K("Z");e++)Zo.push(e);var Fh=[K(" "),K("\f"),K(` +`),K("\r"),K(" "),K("\v"),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K(" "),K("\u2028"),K("\u2029"),K(" "),K(" "),K(" "),K("\uFEFF")],xw=/[0-9a-fA-F]/,Ws=/[0-9]/,Fw=/[1-9]/,cy=class{static{i(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ha(r,"global");break;case"i":ha(r,"ignoreCase");break;case"m":ha(r,"multiLine");break;case"u":ha(r,"unicode");break;case"y":ha(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}rn(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return ly()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:n,atMost:a}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;rn(t);break}if(!(e===!0&&t===void 0)&&rn(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),rn(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[K(` +`),K("\r"),K("\u2028"),K("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Jo;break;case"D":e=Jo,t=!0;break;case"s":e=Fh;break;case"S":e=Fh,t=!0;break;case"w":e=Zo;break;case"W":e=Zo,t=!0;break}if(rn(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=K("\f");break;case"n":e=K(` +`);break;case"r":e=K("\r");break;case"t":e=K(" ");break;case"v":e=K("\v");break}if(rn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:K("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:K(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:K(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,rd(r)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,rd(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Ol=class{static{i(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},uy=/\r?\n/gm,dy=new cy,Gw=class extends Ol{static{i(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Va(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` +`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},$n=new Gw;function fy(e){try{typeof e!="string"&&(e=e.source),e=`/${e}/`;const t=dy.pattern(e),r=[];for(const n of t.value.value)$n.reset(e),$n.visit(n),r.push({start:$n.startRegexp,end:$n.endRegex});return r}catch{return[]}}i(fy,"getTerminalParts");function xf(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),$n.reset(e),$n.visit(dy.pattern(e)),$n.multiline}catch{return!1}}i(xf,"isMultilineComment");var py=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function Ll(e){const t=typeof e=="string"?new RegExp(e):e;return py.some(r=>t.test(r))}i(Ll,"isWhitespace");function Va(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Va,"escapeRegExp");function Ff(e,t){const r=Gf(e),n=t.match(r);return!!n&&n[0].length>0}i(Ff,"partialMatches");function Gf(e){typeof e=="string"&&(e=new RegExp(e));const t=e,r=e.source;let n=0;function a(){let s="",o;function l(u){s+=r.substr(n,u),n+=u}i(l,"appendRaw");function c(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(i(c,"appendOptional");n",n)-n+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?l(o[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=a()+"|$)";break;case"=":s+="(?=",n+=3,s+=a()+")";break;case"!":o=n,n+=3,a(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),s+=r.substr(o,n-o);break;default:l(r.indexOf(">",n)-n+1),s+=a()+"|$)";break}break}else l(1),s+=a()+"|$)";break;case")":return++n,s;default:c(1);break}return s}return i(a,"process"),new RegExp(a(),e.flags)}i(Gf,"partialRegExp");function jf(e){return e.rules.find(t=>Je(t)&&t.entry)}i(jf,"getEntryRule");function Uf(e){return e.rules.filter(t=>bt(t)&&t.hidden)}i(Uf,"getHiddenRules");function Dl(e,t){const r=new Set,n=jf(e);if(!n)return new Set(e.rules);const a=[n].concat(Uf(e));for(const o of a)zf(o,r,t);const s=new Set;for(const o of e.rules)(r.has(o.name)||bt(o)&&o.hidden)&&s.add(o);return s}i(Dl,"getAllReachableRules");function zf(e,t,r){t.add(e.name),wr(e).forEach(n=>{if($r(n)||r&&wl(n)){const a=n.rule.ref;a&&!t.has(a.name)&&zf(a,t,r)}})}i(zf,"ruleDfs");function hy(e){const t=new Set;return wr(e).forEach(r=>{Dn(r)&&(Je(r.type.ref)&&t.add(r.type.ref),bs(r.type.ref)&&Je(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}i(hy,"getAllRulesUsedForCrossReferences");function Bf(e){if(e.terminal)return e.terminal;if(e.type.ref)return Gl(e.type.ref)?.terminal}i(Bf,"getCrossReferenceTerminal");function Kf(e){return e.hidden&&!Ll(Ns(e))}i(Kf,"isCommentTerminal");function qf(e,t){return!e||!t?[]:xl(e,t,e.astNode,!0)}i(qf,"findNodesForProperty");function Ml(e,t,r){if(!e||!t)return;const n=xl(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Ml,"findNodeForProperty");function xl(e,t,r,n){if(!n){const a=On(e.grammarSource,Tr);if(a&&a.feature===t)return[e]}return vr(e)&&e.astNode===r?e.content.flatMap(a=>xl(a,t,r,!1)):[]}i(xl,"findNodesForPropertyInternal");function my(e,t){return e?Fl(e,t,e?.astNode):[]}i(my,"findNodesForKeyword");function Wf(e,t,r){if(!e)return;const n=Fl(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Wf,"findNodeForKeyword");function Fl(e,t,r){if(e.astNode!==r)return[];if(Rr(e.grammarSource)&&e.grammarSource.value===t)return[e];const n=Fa(e).iterator();let a;const s=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Rr(o.grammarSource)&&o.grammarSource.value===t&&s.push(o):n.prune()}while(!a.done);return s}i(Fl,"findNodesForKeywordInternal");function Vf(e){const t=e.astNode;for(;t===e.container?.astNode;){const r=On(e.grammarSource,Tr);if(r)return r;e=e.container}}i(Vf,"findAssignment");function Gl(e){let t=e;return bs(t)&&(Gr(t.$container)?t=t.$container.$container:Ln(t.$container)?t=t.$container:qr(t.$container)),Hf(e,t,new Map)}i(Gl,"findNameAssignment");function Hf(e,t,r){function n(a,s){let o;return On(a,Tr)||(o=Hf(s,s,r)),r.set(e,o),o}if(i(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(const a of wr(t)){if(Tr(a)&&a.feature.toLowerCase()==="name")return r.set(e,a),a;if($r(a)&&Je(a.rule.ref))return n(a,a.rule.ref);if(bl(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}i(Hf,"findNameAssignmentInternal");function Yf(e){const t=e.$container;if(Mn(t)){const r=t.elements,n=r.indexOf(e);for(let a=n-1;a>=0;a--){const s=r[a];if(Gr(s))return s;{const o=wr(r[a]).find(Gr);if(o)return o}}}if(Cl(t))return Yf(t)}i(Yf,"getActionAtElement");function gy(e,t){return e==="?"||e==="*"||Mn(t)&&!!t.guardCondition}i(gy,"isOptionalCardinality");function yy(e){return e==="*"||e==="+"}i(yy,"isArrayCardinality");function vy(e){return e==="+="}i(vy,"isArrayOperator");function ws(e){return Xf(e,new Set)}i(ws,"isDataTypeRule");function Xf(e,t){if(t.has(e))return!0;t.add(e);for(const r of wr(e))if($r(r)){if(!r.rule.ref||Je(r.rule.ref)&&!Xf(r.rule.ref,t)||xa(r.rule.ref))return!1}else{if(Tr(r))return!1;if(Gr(r))return!1}return!!e.definition}i(Xf,"isDataTypeRuleInternal");function Ty(e){return Qo(e.type,new Set)}i(Ty,"isDataType");function Qo(e,t){if(t.has(e))return!0;if(t.add(e),of(e))return!1;if(yf(e))return!1;if(Af(e))return e.types.every(r=>Qo(r,t));if(bl(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){const r=e.typeRef.ref;return Il(r)?Qo(r.type,t):!1}else return!1}else return!1}i(Qo,"isDataTypeInternal");function Is(e){if(!bt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t)return t.name}}}i(Is,"getExplicitRuleType");function bn(e){if(Ln(e))return Je(e)&&ws(e)?e.name:Is(e)??e.name;if(pf(e)||Il(e)||Tf(e))return e.name;if(Gr(e)){const t=Jf(e);if(t)return t}else if(bs(e))return e.name;throw new Error("Cannot get name of Unknown Type")}i(bn,"getTypeName");function Jf(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return bn(e.type.ref)}i(Jf,"getActionType");function Ry(e){return bt(e)?e.type?.name??"string":Je(e)&&ws(e)?e.name:Is(e)??e.name}i(Ry,"getRuleTypeName");function Zf(e){return bt(e)?e.type?.name??"string":Is(e)??e.name}i(Zf,"getRuleType");function Ns(e){const t={s:!1,i:!1,u:!1},r=xn(e.definition,t),n=Object.entries(t).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}i(Ns,"terminalRegex");var Qf=/[\s\S]/.source;function xn(e,t){if(Rf(e))return $y(e);if($f(e))return Ay(e);if(cf(e))return Cy(e);if(wl(e)){const r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return er(xn(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(hf(e))return _y(e);if(Ef(e))return Ey(e);if(vf(e)){const r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),a=e.regex.substring(r+1);return t&&(t.i=a.includes("i"),t.s=a.includes("s"),t.u=a.includes("u")),er(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(_f(e))return er(Qf,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}i(xn,"abstractElementToRegex");function $y(e){return er(e.elements.map(t=>xn(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i($y,"terminalAlternativesToRegex");function Ay(e){return er(e.elements.map(t=>xn(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Ay,"terminalGroupToRegex");function Ey(e){return er(`${Qf}*?${xn(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Ey,"untilTokenToRegex");function _y(e){return er(`(?!${xn(e.terminal)})${Qf}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(_y,"negateTokenToRegex");function Cy(e){return e.right?er(`[${Ro(e.left)}-${Ro(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):er(Ro(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Cy,"characterRangeToRegex");function Ro(e){return Va(e.value)}i(Ro,"keywordToRegex");function er(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}i(er,"withCardinality");function ep(e){const t=[],r=e.Grammar;for(const n of r.rules)bt(n)&&Kf(n)&&xf(Ns(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:If}}i(ep,"createGrammarConfig");var jw=typeof global=="object"&&global&&global.Object===Object&&global,Sy=jw,Uw=typeof self=="object"&&self&&self.Object===Object&&self,zw=Sy||Uw||Function("return this")(),rr=zw,Bw=rr.Symbol,Ct=Bw,by=Object.prototype,Kw=by.hasOwnProperty,qw=by.toString,_i=Ct?Ct.toStringTag:void 0;function wy(e){var t=Kw.call(e,_i),r=e[_i];try{e[_i]=void 0;var n=!0}catch{}var a=qw.call(e);return n&&(t?e[_i]=r:delete e[_i]),a}i(wy,"getRawTag");var Ww=wy,Vw=Object.prototype,Hw=Vw.toString;function Iy(e){return Hw.call(e)}i(Iy,"objectToString");var Yw=Iy,Xw="[object Null]",Jw="[object Undefined]",Gh=Ct?Ct.toStringTag:void 0;function Ny(e){return e==null?e===void 0?Jw:Xw:Gh&&Gh in Object(e)?Ww(e):Yw(e)}i(Ny,"baseGetTag");var Wr=Ny;function ky(e){return e!=null&&typeof e=="object"}i(ky,"isObjectLike");var Gt=ky,Zw="[object Symbol]";function Py(e){return typeof e=="symbol"||Gt(e)&&Wr(e)==Zw}i(Py,"isSymbol");var jl=Py;function Oy(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r0){if(++t>=LI)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}i(Xy,"shortOut");var xI=Xy;function Jy(e){return function(){return e}}i(Jy,"constant");var FI=Jy,GI=(function(){try{var e=Gn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),el=GI,jI=el?function(e,t){return el(e,"toString",{configurable:!0,enumerable:!1,value:FI(t),writable:!0})}:ja,UI=jI,zI=xI(UI),BI=zI;function Zy(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}i(iv,"arrayIncludes");var sv=iv,WI=9007199254740991,VI=/^(?:0|[1-9]\d*)$/;function ov(e,t){var r=typeof e;return t=t??WI,!!t&&(r=="number"||r!="symbol"&&VI.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=JI}i(hv,"isLength");var ip=hv;function mv(e){return e!=null&&ip(e.length)&&!Ir(e)}i(mv,"isArrayLike");var nr=mv;function gv(e,t,r){if(!St(r))return!1;var n=typeof t;return(n=="number"?nr(r)&&Ul(t,r.length):n=="string"&&t in r)?Os(r[t],e):!1}i(gv,"isIterateeCall");var Bl=gv;function yv(e){return ap(function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&Bl(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n-1}i(Vv,"listCacheHas");var mk=Vv;function Hv(e,t){var r=this.__data__,n=Wl(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(Hv,"listCacheSet");var gk=Hv;function Un(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(l)?t>1?up(l,t-1,r,n,a):cp(a,l):n||(a[a.length]=l)}return a}i(up,"baseFlatten");var dp=up;function uT(e){var t=e==null?0:e.length;return t?dp(e,1):[]}i(uT,"flatten");var xt=uT,Dk=Nv(Object.getPrototypeOf,Object),dT=Dk;function fT(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(a);++nl))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,y=r&C0?new mp:void 0;for(s.set(e,t),s.set(t,e);++f2?t[2]:void 0;for(a&&Bl(t[0],t[1],a)&&(n=1);++r=vO&&(s=gp,o=!1,t=new mp(t));e:for(;++a-1?a[s?t[o]:o]:void 0}}i(VR,"createFind");var _O=VR,CO=Math.max;function HR(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ps(r);return a<0&&(a=CO(n+a,0)),tv(e,ar(t),a)}i(HR,"findIndex");var SO=HR,bO=_O(SO),za=bO;function YR(e){return e&&e.length?e[0]:void 0}i(YR,"head");var jt=YR;function XR(e,t){var r=-1,n=nr(e)?Array(e.length):[];return Kn(e,function(a,s,o){n[++r]=t(a,s,o)}),n}i(XR,"baseMap");var wO=XR;function JR(e,t){var r=ne(e)?ks:wO;return r(e,ar(t))}i(JR,"map");var F=JR;function ZR(e,t){return dp(F(e,t),1)}i(ZR,"flatMap");var _t=ZR,IO=Object.prototype,NO=IO.hasOwnProperty,kO=mO(function(e,t,r){NO.call(e,r)?e[r].push(t):np(e,r,[t])}),PO=kO,OO=Object.prototype,LO=OO.hasOwnProperty;function QR(e,t){return e!=null&&LO.call(e,t)}i(QR,"baseHas");var DO=QR;function e$(e,t){return e!=null&&vR(e,t,DO)}i(e$,"has");var U=e$,MO="[object String]";function t$(e){return typeof e=="string"||!ne(e)&&Gt(e)&&Wr(e)==MO}i(t$,"isString");var it=t$;function r$(e,t){return ks(t,function(r){return e[r]})}i(r$,"baseValues");var xO=r$;function n$(e){return e==null?[]:xO(e,ft(e))}i(n$,"values");var xe=n$,FO=Math.max;function a$(e,t,r,n){e=nr(e)?e:xe(e),r=r&&!n?Ps(r):0;var a=e.length;return r<0&&(r=FO(a+r,0)),it(e)?r<=a&&e.indexOf(t,r)>-1:!!a&&rp(e,t,r)>-1}i(a$,"includes");var tt=a$,GO=Math.max;function i$(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ps(r);return a<0&&(a=GO(n+a,0)),rp(e,t,a)}i(i$,"indexOf");var ym=i$,jO="[object Map]",UO="[object Set]",zO=Object.prototype,BO=zO.hasOwnProperty;function s$(e){if(e==null)return!0;if(nr(e)&&(ne(e)||typeof e=="string"||typeof e.splice=="function"||cs(e)||sp(e)||Kl(e)))return!e.length;var t=Ua(e);if(t==jO||t==UO)return!e.size;if(Ds(e))return!Pv(e).length;for(var r in e)if(BO.call(e,r))return!1;return!0}i(s$,"isEmpty");var he=s$,KO="[object RegExp]";function o$(e){return Gt(e)&&Wr(e)==KO}i(o$,"baseIsRegExp");var qO=o$,vm=jr&&jr.isRegExp,WO=vm?Ms(vm):qO,Ar=WO;function l$(e){return e===void 0}i(l$,"isUndefined");var Er=l$,VO="Expected a function";function c$(e){if(typeof e!="function")throw new TypeError(VO);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}i(c$,"negate");var HO=c$;function u$(e,t,r,n){if(!St(e))return e;t=Jl(t,e);for(var a=-1,s=t.length,o=s-1,l=e;l!=null&&++a=rL){var u=t?null:tL(e);if(u)return yp(u);o=!1,a=gp,c=new mp}else c=t?[]:l;e:for(;++n{t.accept(e)})}},Ze=class extends ir{static{i(this,"NonTerminal")}constructor(e){super([]),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ha=class extends ir{static{i(this,"Rule")}constructor(e){super(e.definition),this.orgText="",pt(this,Ut(e,t=>t!==void 0))}},st=class extends ir{static{i(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,pt(this,Ut(e,t=>t!==void 0))}},Be=class extends ir{static{i(this,"Option")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},mt=class extends ir{static{i(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},gt=class extends ir{static{i(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},we=class extends ir{static{i(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},ot=class extends ir{static{i(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,pt(this,Ut(e,t=>t!==void 0))}},lt=class extends ir{static{i(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,pt(this,Ut(e,t=>t!==void 0))}},Te=class{static{i(this,"Terminal")}constructor(e){this.idx=1,pt(this,Ut(e,t=>t!==void 0))}accept(e){e.visit(this)}};function E$(e){return F(e,rs)}i(E$,"serializeGrammar");function rs(e){function t(r){return F(r,rs)}if(i(t,"convertDefinition"),e instanceof Ze){const r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return it(e.label)&&(r.label=e.label),r}else{if(e instanceof st)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Be)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof mt)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof gt)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:rs(new Te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ot)return{type:"RepetitionWithSeparator",idx:e.idx,separator:rs(new Te({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof we)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof lt)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Te){const r={type:"Terminal",name:e.terminalType.name,label:$$(e.terminalType),idx:e.idx};it(e.label)&&(r.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=Ar(n)?n.source:n),r}else{if(e instanceof Ha)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}i(rs,"serializeProduction");var Ya=class{static{i(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case Ze:return this.visitNonTerminal(t);case st:return this.visitAlternative(t);case Be:return this.visitOption(t);case mt:return this.visitRepetitionMandatory(t);case gt:return this.visitRepetitionMandatoryWithSeparator(t);case ot:return this.visitRepetitionWithSeparator(t);case we:return this.visitRepetition(t);case lt:return this.visitAlternation(t);case Te:return this.visitTerminal(t);case Ha:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function _$(e){return e instanceof st||e instanceof Be||e instanceof we||e instanceof mt||e instanceof gt||e instanceof ot||e instanceof Te||e instanceof Ha}i(_$,"isSequenceProd");function hs(e,t=[]){return e instanceof Be||e instanceof we||e instanceof ot?!0:e instanceof lt?v$(e.definition,n=>hs(n,t)):e instanceof Ze&&tt(t,e)?!1:e instanceof ir?(e instanceof Ze&&t.push(e),Ft(e.definition,n=>hs(n,t))):!1}i(hs,"isOptionalProd");function C$(e){return e instanceof lt}i(C$,"isBranchingProd");function Ot(e){if(e instanceof Ze)return"SUBRULE";if(e instanceof Be)return"OPTION";if(e instanceof lt)return"OR";if(e instanceof mt)return"AT_LEAST_ONE";if(e instanceof gt)return"AT_LEAST_ONE_SEP";if(e instanceof ot)return"MANY_SEP";if(e instanceof we)return"MANY";if(e instanceof Te)return"CONSUME";throw Error("non exhaustive match")}i(Ot,"getProductionDslName");var ec=class{static{i(this,"RestWalker")}walk(e,t=[]){q(e.definition,(r,n)=>{const a=ze(e.definition,n+1);if(r instanceof Ze)this.walkProdRef(r,a,t);else if(r instanceof Te)this.walkTerminal(r,a,t);else if(r instanceof st)this.walkFlat(r,a,t);else if(r instanceof Be)this.walkOption(r,a,t);else if(r instanceof mt)this.walkAtLeastOne(r,a,t);else if(r instanceof gt)this.walkAtLeastOneSep(r,a,t);else if(r instanceof ot)this.walkManySep(r,a,t);else if(r instanceof we)this.walkMany(r,a,t);else if(r instanceof lt)this.walkOr(r,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new Be({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=od(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new Be({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=od(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);q(e.definition,a=>{const s=new st({definition:[a]});this.walk(s,n)})}};function od(e,t,r){return[new Be({definition:[new Te({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}i(od,"restForRepetitionWithSeparator");function Xa(e){if(e instanceof Ze)return Xa(e.referencedRule);if(e instanceof Te)return w$(e);if(_$(e))return S$(e);if(C$(e))return b$(e);throw Error("non exhaustive match")}i(Xa,"first");function S$(e){let t=[];const r=e.definition;let n=0,a=r.length>n,s,o=!0;for(;a&&o;)s=r[n],o=hs(s),t=t.concat(Xa(s)),n=n+1,a=r.length>n;return Rp(t)}i(S$,"firstForSequence");function b$(e){const t=F(e.definition,r=>Xa(r));return Rp(xt(t))}i(b$,"firstForBranching");function w$(e){return[e.terminalType]}i(w$,"firstForTerminal");var I$="_~IN~_",aL=class extends ec{static{i(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=k$(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(r),s=new st({definition:a}),o=Xa(s);this.follows[n]=o}};function N$(e){const t={};return q(e,r=>{const n=new aL(r).startWalking();pt(t,n)}),t}i(N$,"computeAllProdsFollows");function k$(e,t){return e.name+t+I$}i(k$,"buildBetweenProdsFollowPrefix");var $o={},iL=new cy;function Gs(e){const t=e.toString();if($o.hasOwnProperty(t))return $o[t];{const r=iL.pattern(t);return $o[t]=r,r}}i(Gs,"getRegExpAst");function P$(){$o={}}i(P$,"clearRegExpParserCache");var O$="Complement Sets are not supported for first char optimization",nl=`Unable to use "first char" lexer optimizations: +`;function L$(e,t=!1){try{const r=Gs(e);return al(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===O$)t&&$p(`${nl} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),rl(`${nl} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}i(L$,"getOptimizedStartCodesIndices");function al(e,t,r){switch(e.type){case"Disjunction":for(let a=0;a{if(typeof c=="number")ji(c,t,r);else{const u=c;if(r===!0)for(let d=u.from;d<=u.to;d++)ji(d,t,r);else{for(let d=u.from;d<=u.to&&d=zi){const d=u.from>=zi?u.from:zi,f=u.to,h=_r(d),y=_r(f);for(let v=h;v<=y;v++)t[v]=v}}}});break;case"Group":al(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&il(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return xe(t)}i(al,"firstCharOptimizedIndices");function ji(e,t,r){const n=_r(e);t[n]=n,r===!0&&D$(e,t)}i(ji,"addOptimizedIdxToResult");function D$(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const a=_r(n.charCodeAt(0));t[a]=a}else{const a=r.toLowerCase();if(a!==r){const s=_r(a.charCodeAt(0));t[s]=s}}}i(D$,"handleIgnoreCase");function ld(e,t){return za(e.value,r=>{if(typeof r=="number")return tt(t,r);{const n=r;return za(t,a=>n.from<=a&&a<=n.to)!==void 0}})}i(ld,"findCode");function il(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?ne(e.value)?Ft(e.value,il):il(e.value):!1}i(il,"isWholeOptional");var sL=class extends Ol{static{i(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){tt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?ld(e,this.targetCharCodes)===void 0&&(this.found=!0):ld(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function tc(e,t){if(t instanceof RegExp){const r=Gs(t),n=new sL(e);return n.visit(r),n.found}else return za(t,r=>tt(e,r.charCodeAt(0)))!==void 0}i(tc,"canMatchCharCode");var In="PATTERN",Ui="defaultMode",Hs="modes",M$=typeof new RegExp("(?:)").sticky=="boolean";function x$(e,t){t=Tp(t,{useSticky:M$,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:i((I,A)=>A(),"tracer")});const r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{aA()});let n;r("Reject Lexer.NA",()=>{n=Ql(e,I=>I[In]===Xe.NA)});let a=!1,s;r("Transform Patterns",()=>{a=!1,s=F(n,I=>{const A=I[In];if(Ar(A)){const k=A.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!A.ignoreCase?k:k.length===2&&k[0]==="\\"&&!tt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:t.useSticky?ud(A):cd(A)}else{if(Ir(A))return a=!0,{exec:A};if(typeof A=="object")return a=!0,A;if(typeof A=="string"){if(A.length===1)return A;{const k=A.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),G=new RegExp(k);return t.useSticky?ud(G):cd(G)}}else throw Error("non exhaustive match")}})});let o,l,c,u,d;r("misc mapping",()=>{o=F(n,I=>I.tokenTypeIdx),l=F(n,I=>{const A=I.GROUP;if(A!==Xe.SKIPPED){if(it(A))return A;if(Er(A))return!1;throw Error("non exhaustive match")}}),c=F(n,I=>{const A=I.LONGER_ALT;if(A)return ne(A)?F(A,G=>ym(n,G)):[ym(n,A)]}),u=F(n,I=>I.PUSH_MODE),d=F(n,I=>U(I,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{const I=Sp(t.lineTerminatorCharacters);f=F(n,A=>!1),t.positionTracking!=="onlyOffset"&&(f=F(n,A=>U(A,"LINE_BREAKS")?!!A.LINE_BREAKS:Cp(A,I)===!1&&tc(I,A.PATTERN)))});let h,y,v,C;r("Misc Mapping #2",()=>{h=F(n,_p),y=F(s,rA),v=ht(n,(I,A)=>{const k=A.GROUP;return it(k)&&k!==Xe.SKIPPED&&(I[k]=[]),I},{}),C=F(s,(I,A)=>({pattern:s[A],longerAlt:c[A],canLineTerminator:f[A],isCustom:h[A],short:y[A],group:l[A],push:u[A],pop:d[A],tokenTypeIdx:o[A],tokenType:n[A]}))});let b=!0,w=[];return t.safeMode||r("First Char Optimization",()=>{w=ht(n,(I,A,k)=>{if(typeof A.PATTERN=="string"){const G=A.PATTERN.charCodeAt(0),H=_r(G);Ao(I,H,C[k])}else if(ne(A.START_CHARS_HINT)){let G;q(A.START_CHARS_HINT,H=>{const X=typeof H=="string"?H.charCodeAt(0):H,le=_r(X);G!==le&&(G=le,Ao(I,le,C[k]))})}else if(Ar(A.PATTERN))if(A.PATTERN.unicode)b=!1,t.ensureOptimizations&&rl(`${nl} Unable to analyze < ${A.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const G=L$(A.PATTERN,t.ensureOptimizations);he(G)&&(b=!1),q(G,H=>{Ao(I,H,C[k])})}else t.ensureOptimizations&&rl(`${nl} TokenType: <${A.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return I},[])}),{emptyGroups:v,patternIdxToConfig:C,charCodeToPatternIdxToConfig:w,hasCustom:a,canBeOptimized:b}}i(x$,"analyzeTokenTypes");function F$(e,t){let r=[];const n=j$(e);r=r.concat(n.errors);const a=U$(n.valid),s=a.valid;return r=r.concat(a.errors),r=r.concat(G$(s)),r=r.concat(V$(s)),r=r.concat(H$(s,t)),r=r.concat(Y$(s)),r}i(F$,"validatePatterns");function G$(e){let t=[];const r=wt(e,n=>Ar(n[In]));return t=t.concat(z$(r)),t=t.concat(K$(r)),t=t.concat(q$(r)),t=t.concat(W$(r)),t=t.concat(B$(r)),t}i(G$,"validateRegExpPattern");function j$(e){const t=wt(e,a=>!U(a,In)),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:Ie.MISSING_PATTERN,tokenTypes:[a]})),n=Zl(e,t);return{errors:r,valid:n}}i(j$,"findMissingPatterns");function U$(e){const t=wt(e,a=>{const s=a[In];return!Ar(s)&&!Ir(s)&&!U(s,"exec")&&!it(s)}),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ie.INVALID_PATTERN,tokenTypes:[a]})),n=Zl(e,t);return{errors:r,valid:n}}i(U$,"findInvalidPatterns");var oL=/[^\\][$]/;function z$(e){class t extends Ol{static{i(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const r=wt(e,a=>{const s=a.PATTERN;try{const o=Gs(s),l=new t;return l.visit(o),l.found}catch{return oL.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ie.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(z$,"findEndOfInputAnchor");function B$(e){const t=wt(e,n=>n.PATTERN.test(""));return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ie.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}i(B$,"findEmptyMatchRegExps");var lL=/[^\\[][\^]|^\^/;function K$(e){class t extends Ol{static{i(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const r=wt(e,a=>{const s=a.PATTERN;try{const o=Gs(s),l=new t;return l.visit(o),l.found}catch{return lL.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ie.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(K$,"findStartOfInputAnchor");function q$(e){const t=wt(e,n=>{const a=n[In];return a instanceof RegExp&&(a.multiline||a.global)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ie.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}i(q$,"findUnsupportedFlags");function W$(e){const t=[];let r=F(e,s=>ht(e,(o,l)=>(s.PATTERN.source===l.PATTERN.source&&!tt(t,l)&&l.PATTERN!==Xe.NA&&(t.push(l),o.push(l)),o),[]));r=Fs(r);const n=wt(r,s=>s.length>1);return F(n,s=>{const o=F(s,c=>c.name);return{message:`The same RegExp pattern ->${jt(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Ie.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}i(W$,"findDuplicatePatterns");function V$(e){const t=wt(e,n=>{if(!U(n,"GROUP"))return!1;const a=n.GROUP;return a!==Xe.SKIPPED&&a!==Xe.NA&&!it(a)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ie.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}i(V$,"findInvalidGroupType");function H$(e,t){const r=wt(e,a=>a.PUSH_MODE!==void 0&&!tt(t,a.PUSH_MODE));return F(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:Ie.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}i(H$,"findModesThatDoNotExist");function Y$(e){const t=[],r=ht(e,(n,a,s)=>{const o=a.PATTERN;return o===Xe.NA||(it(o)?n.push({str:o,idx:s,tokenType:a}):Ar(o)&&J$(o)&&n.push({str:o.source,idx:s,tokenType:a})),n},[]);return q(e,(n,a)=>{q(r,({str:s,idx:o,tokenType:l})=>{if(a${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:Ie.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}i(Y$,"findUnreachablePatterns");function X$(e,t){if(Ar(t)){if(Z$(t))return!1;const r=t.exec(e);return r!==null&&r.index===0}else{if(Ir(t))return t(e,0,[],{});if(U(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}i(X$,"tryToMatchStrToPattern");function J$(e){return za([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}i(J$,"noMetaChar");function Z$(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Ie.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),U(e,Hs)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Hs+`> property in its definition +`,type:Ie.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),U(e,Hs)&&U(e,Ui)&&!U(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Ui}: <${e.defaultMode}>which does not exist +`,type:Ie.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),U(e,Hs)&&q(e.modes,(a,s)=>{q(a,(o,l)=>{if(Er(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}> +`,type:Ie.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(U(o,"LONGER_ALT")){const c=ne(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];q(c,u=>{!Er(u)&&!tt(a,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}> +`,type:Ie.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}i(Q$,"performRuntimeChecks");function eA(e,t,r){const n=[];let a=!1;const s=Fs(xt(xe(e.modes))),o=Ql(s,c=>c[In]===Xe.NA),l=Sp(r);return t&&q(o,c=>{const u=Cp(c,l);if(u!==!1){const f={message:nA(c,u),type:u.issue,tokenType:c};n.push(f)}else U(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(a=!0):tc(l,c.PATTERN)&&(a=!0)}),t&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:Ie.NO_LINE_BREAKS_FLAGS}),n}i(eA,"performWarningRuntimeChecks");function tA(e){const t={},r=ft(e);return q(r,n=>{const a=e[n];if(ne(a))t[n]=[];else throw Error("non exhaustive match")}),t}i(tA,"cloneEmptyGroups");function _p(e){const t=e.PATTERN;if(Ar(t))return!1;if(Ir(t))return!0;if(U(t,"exec"))return!0;if(it(t))return!1;throw Error("non exhaustive match")}i(_p,"isCustomPattern");function rA(e){return it(e)&&e.length===1?e.charCodeAt(0):!1}i(rA,"isShortPattern");var cL={test:i(function(e){const t=e.length;for(let r=this.lastIndex;r Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ie.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}i(nA,"buildLineBreakIssueMessage");function Sp(e){return F(e,r=>it(r)?r.charCodeAt(0):r)}i(Sp,"getCharCodes");function Ao(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Ao,"addToMapOfArrays");var zi=256,Eo=[];function _r(e){return e255?255+~~(e/255):e}}i(aA,"initCharCodeToOptimizedIndexMap");function Ja(e,t){const r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}i(Ja,"tokenStructuredMatcher");function ms(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}i(ms,"tokenStructuredMatcherNoCategories");var Tm=1,iA={};function Za(e){const t=sA(e);oA(t),cA(t),lA(t),q(t,r=>{r.isParent=r.categoryMatches.length>0})}i(Za,"augmentTokenTypes");function sA(e){let t=Ke(e),r=e,n=!0;for(;n;){r=Fs(xt(F(r,s=>s.CATEGORIES)));const a=Zl(r,t);t=t.concat(a),he(a)?n=!1:r=a}return t}i(sA,"expandCategories");function oA(e){q(e,t=>{wp(t)||(iA[Tm]=t,t.tokenTypeIdx=Tm++),dd(t)&&!ne(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),dd(t)||(t.CATEGORIES=[]),uA(t)||(t.categoryMatches=[]),dA(t)||(t.categoryMatchesMap={})})}i(oA,"assignTokenDefaultProps");function lA(e){q(e,t=>{t.categoryMatches=[],q(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(iA[n].tokenTypeIdx)})})}i(lA,"assignCategoriesTokensProp");function cA(e){q(e,t=>{bp([],t)})}i(cA,"assignCategoriesMapProp");function bp(e,t){q(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),q(t.CATEGORIES,r=>{const n=e.concat(t);tt(n,r)||bp(n,r)})}i(bp,"singleAssignCategoriesToksMap");function wp(e){return U(e,"tokenTypeIdx")}i(wp,"hasShortKeyProperty");function dd(e){return U(e,"CATEGORIES")}i(dd,"hasCategoriesProperty");function uA(e){return U(e,"categoryMatches")}i(uA,"hasExtendingTokensTypesProperty");function dA(e){return U(e,"categoryMatchesMap")}i(dA,"hasExtendingTokensTypesMapProperty");function fA(e){return U(e,"tokenTypeIdx")}i(fA,"isTokenType");var fd={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,a,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}},Ie;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ie||(Ie={}));var Bi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:fd,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Bi);var Xe=class{static{i(this,"Lexer")}constructor(e,t=Bi){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);const{time:o,value:l}=Ap(a),c=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=pt({},Bi,t);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Bi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=cL;else if(this.config.lineTerminatorCharacters===Bi.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),ne(e)?n={modes:{defaultMode:Ke(e)},defaultMode:Ui}:(a=!1,n=Ke(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Q$(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(eA(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},q(n.modes,(o,l)=>{n.modes[l]=Ql(o,c=>Er(c))});const s=ft(n.modes);if(q(n.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(F$(o,s))}),he(this.lexerDefinitionErrors)){Za(o);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=x$(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=pt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=n.defaultMode,!he(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=F(this.lexerDefinitionErrors,c=>c.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}q(this.lexerDefinitionWarning,o=>{$p(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(M$?(this.chopInput=ja,this.match=this.matchWithTest):(this.updateLastIndex=Me,this.match=this.matchWithExec),a&&(this.handleModes=Me),this.trackStartLines===!1&&(this.computeNewColumn=ja),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Me),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=ht(this.canModeBeOptimized,(l,c,u)=>(c===!1&&l.push(u),l),[]);if(t.ensureOptimizations&&!he(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{P$()}),this.TRACE_INIT("toFastProperties",()=>{Ep(this)})})}tokenize(e,t=this.defaultMode){if(!he(this.lexerDefinitionErrors)){const n=F(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,a,s,o,l,c,u,d,f,h,y,v,C,b;const w=e,I=w.length;let A=0,k=0;const G=this.hasCustom?0:Math.floor(e.length/10),H=new Array(G),X=[];let le=this.trackStartLines?1:void 0,ce=this.trackStartLines?1:void 0;const Ne=tA(this.emptyGroups),P=this.trackStartLines,_=this.config.lineTerminatorsPattern;let g=0,E=[],T=[];const R=[],S=[];Object.freeze(S);let O;function M(){return E}i(M,"getPossiblePatternsSlow");function D(te){const de=_r(te),ct=T[de];return ct===void 0?S:ct}i(D,"getPossiblePatternsOptimized");const z=i(te=>{if(R.length===1&&te.tokenType.PUSH_MODE===void 0){const de=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(te);X.push({offset:te.startOffset,line:te.startLine,column:te.startColumn,length:te.image.length,message:de})}else{R.pop();const de=wn(R);E=this.patternIdxToConfig[de],T=this.charCodeToPatternIdxToConfig[de],g=E.length;const ct=this.canModeBeOptimized[de]&&this.config.safeMode===!1;T&&ct?O=D:O=M}},"pop_mode");function B(te){R.push(te),T=this.charCodeToPatternIdxToConfig[te],E=this.patternIdxToConfig[te],g=E.length,g=E.length;const de=this.canModeBeOptimized[te]&&this.config.safeMode===!1;T&&de?O=D:O=M}i(B,"push_mode"),B.call(this,t);let Z;const J=this.config.recoveryEnabled;for(;Al.length){l=s,c=u,Z=Se;break}}}break}}if(l!==null){if(d=l.length,f=Z.group,f!==void 0&&(h=Z.tokenTypeIdx,y=this.createTokenInstance(l,A,h,Z.tokenType,le,ce,d),this.handlePayload(y,c),f===!1?k=this.addToken(H,k,y):Ne[f].push(y)),e=this.chopInput(e,d),A=A+d,ce=this.computeNewColumn(ce,d),P===!0&&Z.canLineTerminator===!0){let Re=0,Oe,qe;_.lastIndex=0;do Oe=_.test(l),Oe===!0&&(qe=_.lastIndex-1,Re++);while(Oe===!0);Re!==0&&(le=le+Re,ce=d-qe,this.updateTokenEndLineColumnLocation(y,f,qe,Re,le,ce,d))}this.handleModes(Z,z,B,y)}else{const Re=A,Oe=le,qe=ce;let Se=J===!1;for(;Se===!1&&A ${Cn(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:a}){const s="Expecting: ",l=` +but found: '`+jt(t).image+"'";if(n)return s+n+l;{const c=ht(e,(h,y)=>h.concat(y),[]),u=F(c,h=>`[${F(h,y=>Cn(y)).join(", ")}]`),f=`one of these possible Token sequences: +${F(u,(h,y)=>` ${y+1}. ${h}`).join(` +`)}`;return s+f+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+jt(t).image+"'";if(r)return a+r+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${F(e,u=>`[${F(u,d=>Cn(d)).join(",")}]`).join(" ,")}>`;return a+c+o}}};Object.freeze(wa);var dL={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- +inside top level rule: ->`+e.name+"<-"}},An={buildDuplicateFoundError(e,t){function r(d){return d instanceof Te?d.terminalType.name:d instanceof Ze?d.nonTerminalName:""}i(r,"getExtraProductionArgument");const n=e.name,a=jt(t),s=a.idx,o=Ot(a),l=r(a),c=s>0;let u=`->${o}${c?s:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` +`),u},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=F(e.prefixPath,a=>Cn(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(e){const t=F(e.prefixPath,a=>Cn(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(e){let t=Ot(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name,r=F(e.leftRecursionPath,s=>s.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof Ha?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function hA(e,t){const r=new fL(e,t);return r.resolveRefs(),r.errors}i(hA,"resolveGrammar");var fL=class extends Ya{static{i(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){q(xe(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:Qe.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},pL=class extends ec{static{i(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ke(this.path.ruleStack).reverse(),this.occurrenceStack=Ke(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){he(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},hL=class extends pL{static{i(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(r),a=new st({definition:n});this.possibleTokTypes=Xa(a),this.found=!0}}},rc=class extends ec{static{i(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},mL=class extends rc{static{i(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},wm=class extends rc{static{i(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},gL=class extends rc{static{i(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},Im=class extends rc{static{i(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof Te&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};function sl(e,t,r=[]){r=Ke(r);let n=[],a=0;function s(l){return l.concat(ze(e,a+1))}i(s,"remainingPathWith");function o(l){const c=sl(s(l),t,r);return n.concat(c)}for(i(o,"getAlternativesForProd");r.length{he(c.definition)===!1&&(n=o(c.definition))}),n;if(l instanceof Te)r.push(l.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:ze(e,a)}),n}i(sl,"possiblePathsFrom");function kp(e,t,r,n){const a="EXIT_NONE_TERMINAL",s=[a],o="EXIT_ALTERNATIVE";let l=!1;const c=t.length,u=c-n-1,d=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!he(f);){const h=f.pop();if(h===o){l&&wn(f).idx<=u&&f.pop();continue}const y=h.def,v=h.idx,C=h.ruleStack,b=h.occurrenceStack;if(he(y))continue;const w=y[0];if(w===a){const I={idx:v,def:ze(y),ruleStack:ps(C),occurrenceStack:ps(b)};f.push(I)}else if(w instanceof Te)if(v=0;I--){const A=w.definition[I],k={idx:v,def:A.definition.concat(ze(y)),ruleStack:C,occurrenceStack:b};f.push(k),f.push(o)}else if(w instanceof st)f.push({idx:v,def:w.definition.concat(ze(y)),ruleStack:C,occurrenceStack:b});else if(w instanceof Ha)f.push(mA(w,v,C,b));else throw Error("non exhaustive match")}return d}i(kp,"nextPossibleTokensAfter");function mA(e,t,r,n){const a=Ke(r);a.push(e.name);const s=Ke(n);return s.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:s}}i(mA,"expandTopLevelRule");var _e;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(_e||(_e={}));function nc(e){if(e instanceof Be||e==="Option")return _e.OPTION;if(e instanceof we||e==="Repetition")return _e.REPETITION;if(e instanceof mt||e==="RepetitionMandatory")return _e.REPETITION_MANDATORY;if(e instanceof gt||e==="RepetitionMandatoryWithSeparator")return _e.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ot||e==="RepetitionWithSeparator")return _e.REPETITION_WITH_SEPARATOR;if(e instanceof lt||e==="Alternation")return _e.ALTERNATION;throw Error("non exhaustive match")}i(nc,"getProdType");function pd(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:a}=e,s=nc(n);return s===_e.ALTERNATION?Us(t,r,a):zs(t,r,s,a)}i(pd,"getLookaheadPaths");function gA(e,t,r,n,a,s){const o=Us(e,t,r),l=Op(o)?ms:Ja;return s(o,n,l,a)}i(gA,"buildLookaheadFuncForOr");function yA(e,t,r,n,a,s){const o=zs(e,t,a,r),l=Op(o)?ms:Ja;return s(o[0],l,n)}i(yA,"buildLookaheadFuncForOptionalProd");function vA(e,t,r,n){const a=e.length,s=Ft(e,o=>Ft(o,l=>l.length===1));if(t)return function(o){const l=F(o,c=>c.GATE);for(let c=0;cxt(c)),l=ht(o,(c,u,d)=>(q(u,f=>{U(c,f.tokenTypeIdx)||(c[f.tokenTypeIdx]=d),q(f.categoryMatches,h=>{U(c,h)||(c[h]=d)})}),c),{});return function(){const c=this.LA(1);return l[c.tokenTypeIdx]}}else return function(){for(let o=0;os.length===1),a=e.length;if(n&&!r){const s=xt(e);if(s.length===1&&he(s[0].categoryMatches)){const l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{const o=ht(s,(l,c,u)=>(l[c.tokenTypeIdx]=!0,q(c.categoryMatches,d=>{l[d]=!0}),l),[]);return function(){const l=this.LA(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;ssl([o],1)),n=hd(r.length),a=F(r,o=>{const l={};return q(o,c=>{const u=_o(c.partialPath);q(u,d=>{l[d]=!0})}),l});let s=r;for(let o=1;o<=t;o++){const l=s;s=hd(l.length);for(let c=0;c{const w=_o(b.partialPath);q(w,I=>{a[c][I]=!0})})}}}}return n}i(Pp,"lookAheadSequenceFromAlternatives");function Us(e,t,r,n){const a=new RA(e,_e.ALTERNATION,n);return t.accept(a),Pp(a.result,r)}i(Us,"getLookaheadPathsForOr");function zs(e,t,r,n){const a=new RA(e,r);t.accept(a);const s=a.result,l=new yL(t,e,r).startWalking(),c=new st({definition:s}),u=new st({definition:l});return Pp([c,u],n)}i(zs,"getLookaheadPathsForOptionalProd");function ol(e,t){e:for(let r=0;r{const a=t[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}i(AA,"isStrictPrefixOfPath");function Op(e){return Ft(e,t=>Ft(t,r=>Ft(r,n=>he(n.categoryMatches))))}i(Op,"areTokenCategoriesNotUsed");function EA(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return F(t,r=>Object.assign({type:Qe.CUSTOM_LOOKAHEAD_VALIDATION},r))}i(EA,"validateLookahead");function _A(e,t,r,n){const a=_t(e,c=>CA(c,r)),s=DA(e,t,r),o=_t(e,c=>kA(c,r)),l=_t(e,c=>bA(c,e,n,r));return a.concat(s,o,l)}i(_A,"validateGrammar");function CA(e,t){const r=new vL;e.accept(r);const n=r.allProductions,a=PO(n,SA),s=Ut(a,l=>l.length>1);return F(xe(s),l=>{const c=jt(l),u=t.buildDuplicateFoundError(e,l),d=Ot(c),f={message:u,type:Qe.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:d,occurrence:c.idx},h=Lp(c);return h&&(f.parameter=h),f})}i(CA,"validateDuplicateProductions");function SA(e){return`${Ot(e)}_#_${e.idx}_#_${Lp(e)}`}i(SA,"identifyProductionForDuplicates");function Lp(e){return e instanceof Te?e.terminalType.name:e instanceof Ze?e.nonTerminalName:""}i(Lp,"getExtraProductionArgument");var vL=class extends Ya{static{i(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function bA(e,t,r,n){const a=[];if(ht(t,(o,l)=>l.name===e.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});a.push({message:o,type:Qe.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}i(bA,"validateRuleDoesNotAlreadyExist");function wA(e,t,r){const n=[];let a;return tt(t,e)||(a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:Qe.INVALID_RULE_OVERRIDE,ruleName:e})),n}i(wA,"validateRuleIsOverridden");function Dp(e,t,r,n=[]){const a=[],s=ns(t.definition);if(he(s))return[];{const o=e.name;tt(s,e)&&a.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Qe.LEFT_RECURSION,ruleName:o});const c=Zl(s,n.concat([e])),u=_t(c,d=>{const f=Ke(n);return f.push(d),Dp(e,d,r,f)});return a.concat(u)}}i(Dp,"validateNoLeftRecursion");function ns(e){let t=[];if(he(e))return t;const r=jt(e);if(r instanceof Ze)t.push(r.referencedRule);else if(r instanceof st||r instanceof Be||r instanceof mt||r instanceof gt||r instanceof ot||r instanceof we)t=t.concat(ns(r.definition));else if(r instanceof lt)t=xt(F(r.definition,s=>ns(s.definition)));else if(!(r instanceof Te))throw Error("non exhaustive match");const n=hs(r),a=e.length>1;if(n&&a){const s=ze(e);return t.concat(ns(s))}else return t}i(ns,"getFirstNoneTerminal");var Mp=class extends Ya{static{i(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function IA(e,t){const r=new Mp;e.accept(r);const n=r.alternations;return _t(n,s=>{const o=ps(s.definition);return _t(o,(l,c)=>{const u=kp([l],[],Ja,1);return he(u)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:c}),type:Qe.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:c+1}]:[]})})}i(IA,"validateEmptyOrAlternative");function NA(e,t,r){const n=new Mp;e.accept(n);let a=n.alternations;return a=Ql(a,o=>o.ignoreAmbiguities===!0),_t(a,o=>{const l=o.idx,c=o.maxLookahead||t,u=Us(l,e,c,o),d=OA(u,o,e,r),f=LA(u,o,e,r);return d.concat(f)})}i(NA,"validateAmbiguousAlternationAlternatives");var TL=class extends Ya{static{i(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function kA(e,t){const r=new Mp;e.accept(r);const n=r.alternations;return _t(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:Qe.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}i(kA,"validateTooManyAlts");function PA(e,t,r){const n=[];return q(e,a=>{const s=new TL;a.accept(s);const o=s.allProductions;q(o,l=>{const c=nc(l),u=l.maxLookahead||t,d=l.idx,h=zs(d,a,c,u)[0];if(he(xt(h))){const y=r.buildEmptyRepetitionError({topLevelRule:a,repetition:l});n.push({message:y,type:Qe.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}i(PA,"validateSomeNonEmptyLookaheadPath");function OA(e,t,r,n){const a=[],s=ht(e,(l,c,u)=>(t.definition[u].ignoreAmbiguities===!0||q(c,d=>{const f=[u];q(e,(h,y)=>{u!==y&&ol(h,d)&&t.definition[y].ignoreAmbiguities!==!0&&f.push(y)}),f.length>1&&!ol(a,d)&&(a.push(d),l.push({alts:f,path:d}))}),l),[]);return F(s,l=>{const c=F(l.alts,d=>d+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:c,prefixPath:l.path}),type:Qe.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:l.alts}})}i(OA,"checkAlternativesAmbiguities");function LA(e,t,r,n){const a=ht(e,(o,l,c)=>{const u=F(l,d=>({idx:c,path:d}));return o.concat(u)},[]);return Fs(_t(a,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,d=wt(a,h=>t.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{const y=[h.idx+1,c+1],v=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:y,prefixPath:h.path}),type:Qe.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:v,alternatives:y}})}))}i(LA,"checkPrefixAlternativesAmbiguities");function DA(e,t,r){const n=[],a=F(t,s=>s.name);return q(e,s=>{const o=s.name;if(tt(a,o)){const l=r.buildNamespaceConflictError(s);n.push({message:l,type:Qe.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}i(DA,"checkTerminalAndNoneTerminalsNameSpace");function MA(e){const t=Tp(e,{errMsgProvider:dL}),r={};return q(e.rules,n=>{r[n.name]=n}),hA(r,t.errMsgProvider)}i(MA,"resolveGrammar");function xA(e){return e=Tp(e,{errMsgProvider:An}),_A(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}i(xA,"validateGrammar");var FA="MismatchedTokenException",GA="NoViableAltException",jA="EarlyExitException",UA="NotAllInputParsedException",zA=[FA,GA,jA,UA];Object.freeze(zA);function gs(e){return tt(zA,e.name)}i(gs,"isRecognitionException");var ac=class extends Error{static{i(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},BA=class extends ac{static{i(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=FA}},RL=class extends ac{static{i(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=GA}},$L=class extends ac{static{i(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=UA}},AL=class extends ac{static{i(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=jA}},Dc={},KA="InRuleRecoveryException",EL=class extends Error{static{i(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=KA}},_L=class{static{i(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=U(e,"recoveryEnabled")?e.recoveryEnabled:Cr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=qA)}getTokenToInsert(e){const t=js(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let u=this.LA(1);const d=i(()=>{const f=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:f,ruleName:this.getCurrRuleFullName()}),y=new BA(h,c,this.LA(0));y.resyncedTokens=ps(o),this.SAVE_ERROR(y)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(u,n)){d();return}else if(r.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,a)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new EL("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||he(t))return!1;const r=this.LA(1);return za(t,a=>this.tokenMatcher(r,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return tt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const n=za(e,a=>Np(t,a));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Dc;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return F(e,(r,n)=>n===0?Dc:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){const e=F(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return xt(e)}getFollowSetFromFollowKey(e){if(e===Dc)return[Ur];const t=e.ruleName+e.idxInCallingRule+I$+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ur)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return ps(t)}attemptInRepetitionRecovery(e,t,r,n,a,s,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),n=Ke(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return F(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function qA(e,t,r,n,a,s,o){const l=this.getKeyForAutomaticLookahead(n,a);let c=this.firstAfterRepMap[l];if(c===void 0){const h=this.getCurrRuleFullName(),y=this.getGAstProductions()[h];c=new s(y,a).startWalking(),this.firstAfterRepMap[l]=c}let u=c.token,d=c.occurrence;const f=c.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=Ur,d=1),!(u===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,d,o)&&this.tryInRepetitionRecovery(e,t,r,u)}i(qA,"attemptInRepetitionRecovery");var CL=4,Vr=8,WA=1<Dp(t,t,An))}validateEmptyOrAlternatives(e){return _t(e,t=>IA(t,An))}validateAmbiguousAlternationAlternatives(e,t){return _t(e,r=>NA(r,t,An))}validateSomeNonEmptyLookaheadPath(e,t){return PA(e,t,An)}buildLookaheadForAlternation(e){return gA(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,vA)}buildLookaheadForOptional(e){return yA(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,nc(e.prodType),TA)}},SL=class{static{i(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=U(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Cr.dynamicTokensEnabled,this.maxLookahead=U(e,"maxLookahead")?e.maxLookahead:Cr.maxLookahead,this.lookaheadStrategy=U(e,"lookaheadStrategy")?e.lookaheadStrategy:new xp({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){q(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:n,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=HA(t);q(r,c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Ot(c)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:t,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=So(this.fullRuleNameToShort[t.name],WA,c.idx);this.setLaFuncCache(f,d)})}),q(n,c=>{this.computeLookaheadFunc(t,c.idx,md,"Repetition",c.maxLookahead,Ot(c))}),q(a,c=>{this.computeLookaheadFunc(t,c.idx,VA,"Option",c.maxLookahead,Ot(c))}),q(s,c=>{this.computeLookaheadFunc(t,c.idx,gd,"RepetitionMandatory",c.maxLookahead,Ot(c))}),q(o,c=>{this.computeLookaheadFunc(t,c.idx,Co,"RepetitionMandatoryWithSeparator",c.maxLookahead,Ot(c))}),q(l,c=>{this.computeLookaheadFunc(t,c.idx,yd,"RepetitionWithSeparator",c.maxLookahead,Ot(c))})})})}computeLookaheadFunc(e,t,r,n,a,s){this.TRACE_INIT(`${s}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),l=So(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return So(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},bL=class extends Ya{static{i(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Ys=new bL;function HA(e){Ys.reset(),e.accept(Ys);const t=Ys.dslMethods;return Ys.reset(),t}i(HA,"collectMethods");function vd(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${s.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}i(ZA,"createBaseSemanticVisitorConstructor");function QA(e,t,r){const n=i(function(){},"derivedConstructor");Fp(n,e+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return q(t,s=>{a[s]=JA}),n.prototype=a,n.prototype.constructor=n,n}i(QA,"createBaseVisitorConstructorWithDefaults");var Rd;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Rd||(Rd={}));function eE(e,t){return tE(e,t)}i(eE,"validateVisitor");function tE(e,t){const r=wt(t,a=>Ir(e[a])===!1),n=F(r,a=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:Rd.MISSING_METHOD,methodName:a}));return Fs(n)}i(tE,"validateMissingCstMethods");var IL=class{static{i(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=U(e,"nodeLocationTracking")?e.nodeLocationTracking:Cr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Me,this.cstFinallyStateUpdate=Me,this.cstPostTerminal=Me,this.cstPostNonTerminal=Me,this.cstPostRule=Me;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Td,this.setNodeLocationFromNode=Td,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vd,this.setNodeLocationFromNode=vd,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=Me,this.setInitialNodeLocation=Me;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];YA(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];XA(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(Er(this.baseCstVisitorConstructor)){const e=ZA(this.className,ft(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Er(this.baseCstVisitorWithDefaultsConstructor)){const e=QA(this.className,ft(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},NL=class{static{i(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ll}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ll:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},kL=class{static{i(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,r=cl){if(tt(this.definedRulesNames,e)){const s={message:An.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Qe.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=cl){const n=wA(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const a=this.defineRule(e,t,r);return this[e]=a,a}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(gs(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return E$(xe(this.gastProductionsCache))}},PL=class{static{i(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ms,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},U(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(ne(e)){if(he(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(ne(e))this.tokensMap=ht(e,(a,s)=>(a[s.name]=s,a),{});else if(U(e,"modes")&&Ft(xt(xe(e.modes)),fA)){const a=xt(xe(e.modes)),s=Rp(a);this.tokensMap=ht(s,(o,l)=>(o[l.name]=l,o),{})}else if(St(e))this.tokensMap=Ke(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ur;const r=U(e,"modes")?xt(xe(e.modes)):xe(e),n=Ft(r,a=>he(a.categoryMatches));this.tokenMatcher=n?ms:Ja,Za(xe(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=U(r,"resyncEnabled")?r.resyncEnabled:cl.resyncEnabled,a=U(r,"recoveryValueFunc")?r.recoveryValueFunc:cl.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(n.call(this)===!0)return a.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(gd,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const s=t.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=t;if(n.call(this)===!0){let s=this.doSingleRepetition(a);for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,_e.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,gd,e,gL)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Co,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,Im],o,Co,e,Im)}else throw this.raiseEarlyExitException(e,_e.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(md,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=i(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=t;let s=!0;for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,md,e,mL,s)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(yd,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,wm],o,yd,e,wm)}}repetitionSepSecondInternal(e,t,r,n,a){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,a],r,Co,e,a)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(WA,t),n=ne(e)?e:e.DEF,s=this.getLaFuncFromCache(r).call(this,n);if(s!==void 0)return n[s].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new $L(t,e))}}subruleInternal(e,t,r){let n;try{const a=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,a),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}}subruleInternalError(e,t,r){throw gs(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),n=a):this.consumeInternalError(e,a,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const a=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new BA(n,t,a))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(a){throw a.name===KA?r:a}}else throw r}saveRecogState(){const e=this.errors,t=Ke(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ur)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},OL=class{static{i(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=U(e,"errorMessageProvider")?e.errorMessageProvider:Cr.errorMessageProvider}SAVE_ERROR(e){if(gs(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ke(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ke(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],o=zs(e,a,t,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new AL(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=Us(e,n,this.maxLookahead),s=[];for(let c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new RL(l,this.LA(1),o))}},LL=class{static{i(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(Er(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return kp([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=jt(e.ruleStack),n=this.getGAstProductions()[t];return new hL(n,e).startWalking()}},ic={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ic);var Nm=!0,km=Math.pow(2,Vr)-1,rE=ka({name:"RECORDING_PHASE_TOKEN",pattern:Xe.NA});Za([rE]);var nE=js(rE,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(nE);var DL={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},ML=class{static{i(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ll}topLevelRuleRecord(e,t){try{const r=new Ha({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return ma.call(this,Be,e,t)}atLeastOneInternalRecord(e,t){ma.call(this,mt,t,e)}atLeastOneSepFirstInternalRecord(e,t){ma.call(this,gt,t,e,Nm)}manyInternalRecord(e,t){ma.call(this,we,t,e)}manySepFirstInternalRecord(e,t){ma.call(this,ot,t,e,Nm)}orInternalRecord(e,t){return aE.call(this,e,t)}subruleInternalRecord(e,t,r){if(ys(t),!e||U(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=wn(this.recordingProdStack),a=e.ruleName,s=new Ze({idx:t,nonTerminalName:a,label:r?.LABEL,referencedRule:void 0});return n.definition.push(s),this.outputCst?DL:ic}consumeInternalRecord(e,t,r){if(ys(t),!wp(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const n=wn(this.recordingProdStack),a=new Te({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(a),nE}};function ma(e,t,r,n=!1){ys(r);const a=wn(this.recordingProdStack),s=Ir(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),U(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),ic}i(ma,"recordProd");function aE(e,t){ys(t);const r=wn(this.recordingProdStack),n=ne(e)===!1,a=n===!1?e:e.DEF,s=new lt({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});U(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=v$(a,l=>Ir(l.GATE));return s.hasPredicates=o,r.definition.push(s),q(a,l=>{const c=new st({definition:[]});s.definition.push(c),U(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:U(l,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),l.ALT.call(this),this.recordingProdStack.pop()}),ic}i(aE,"recordOrProd");function $d(e){return e===0?"":`${e}`}i($d,"getIdxSuffix");function ys(e){if(e<0||e>km){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${km+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}i(ys,"assertMethodIdxIsValid");var xL=class{static{i(this,"PerformanceTracer")}initPerformanceTracer(e){if(U(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Cr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:n,value:a}=Ap(t),s=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,a}else return t()}};function iE(e,t){t.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,a);s&&(s.get||s.set)?Object.defineProperty(e.prototype,a,s):e.prototype[a]=r.prototype[a]})})}i(iE,"applyMixins");var ll=js(Ur,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ll);var Cr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:wa,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),cl=Object.freeze({recoveryValueFunc:i(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Qe;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Qe||(Qe={}));function Ad(e=void 0){return function(){return e}}i(Ad,"EMPTY_ALT");var Gp=class sE{static{i(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Ep(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),q(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let l;this.TRACE_INIT(`${a} Rule`,()=>{l=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=MA({rules:xe(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(he(n)&&this.skipValidations===!1){const a=xA({rules:xe(this.gastProductionsCache),tokenTypes:xe(this.tokensMap),errMsgProvider:An,grammarName:r}),s=EA({lookaheadStrategy:this.lookaheadStrategy,rules:xe(this.gastProductionsCache),tokenTypes:xe(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,s)}}),he(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=N$(xe(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,s;(s=(a=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(a,{rules:xe(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(xe(this.gastProductionsCache))})),!sE.DEFER_DEFINITION_ERRORS_HANDLING&&!he(this.definitionErrors))throw t=F(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${t.join(` +------------------------------- +`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),U(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=U(r,"skipValidations")?r.skipValidations:Cr.skipValidations}};Gp.DEFER_DEFINITION_ERRORS_HANDLING=!1;iE(Gp,[_L,SL,IL,NL,PL,kL,OL,LL,ML,xL]);var FL=class extends Gp{static{i(this,"EmbeddedActionsParser")}constructor(e,t=Cr){const r=Ke(t);r.outputCst=!1,super(e,r)}};function oE(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r-1}i(mE,"listCacheHas");var KL=mE;function gE(e,t){var r=this.__data__,n=sc(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(gE,"listCacheSet");var qL=gE;function qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,y=r&JD?new YE:void 0;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=PM}i(v_,"isLength");var zp=v_,OM="[object Arguments]",LM="[object Array]",DM="[object Boolean]",MM="[object Date]",xM="[object Error]",FM="[object Function]",GM="[object Map]",jM="[object Number]",UM="[object Object]",zM="[object RegExp]",BM="[object Set]",KM="[object String]",qM="[object WeakMap]",WM="[object ArrayBuffer]",VM="[object DataView]",HM="[object Float32Array]",YM="[object Float64Array]",XM="[object Int8Array]",JM="[object Int16Array]",ZM="[object Int32Array]",QM="[object Uint8Array]",ex="[object Uint8ClampedArray]",tx="[object Uint16Array]",rx="[object Uint32Array]",ve={};ve[HM]=ve[YM]=ve[XM]=ve[JM]=ve[ZM]=ve[QM]=ve[ex]=ve[tx]=ve[rx]=!0;ve[OM]=ve[LM]=ve[WM]=ve[DM]=ve[VM]=ve[MM]=ve[xM]=ve[FM]=ve[GM]=ve[jM]=ve[UM]=ve[zM]=ve[BM]=ve[KM]=ve[qM]=!1;function T_(e){return Ba(e)&&zp(e.length)&&!!ve[Qa(e)]}i(T_,"baseIsTypedArray");var nx=T_;function R_(e){return function(t){return e(t)}}i(R_,"baseUnary");var ax=R_,$_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,as=$_&&typeof module=="object"&&module&&!module.nodeType&&module,ix=as&&as.exports===$_,Fc=ix&&$E.process,sx=(function(){try{var e=as&&as.require&&as.require("util").types;return e||Fc&&Fc.binding&&Fc.binding("util")}catch{}})(),Um=sx,zm=Um&&Um.isTypedArray,ox=zm?ax(zm):nx,Bp=ox,lx=Object.prototype,cx=lx.hasOwnProperty;function A_(e,t){var r=et(e),n=!r&&uc(e),a=!r&&!n&&ul(e),s=!r&&!n&&!a&&Bp(e),o=r||n||a||s,l=o?$M(e.length,String):[],c=l.length;for(var u in e)(t||cx.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||y_(u,c)))&&l.push(u);return l}i(A_,"arrayLikeKeys");var ux=A_,dx=Object.prototype;function E_(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||dx;return e===r}i(E_,"isPrototype");var __=E_;function C_(e,t){return function(r){return e(t(r))}}i(C_,"overArg");var fx=C_,px=fx(Object.keys,Object),hx=px,mx=Object.prototype,gx=mx.hasOwnProperty;function S_(e){if(!__(e))return hx(e);var t=[];for(var r in Object(e))gx.call(e,r)&&r!="constructor"&&t.push(r);return t}i(S_,"baseKeys");var b_=S_;function w_(e){return e!=null&&zp(e.length)&&!wE(e)}i(w_,"isArrayLike");var dc=w_;function I_(e){return dc(e)?ux(e):b_(e)}i(I_,"keys");var Kp=I_;function N_(e){return mM(e,Kp,RM)}i(N_,"getAllKeys");var Bm=N_,yx=1,vx=Object.prototype,Tx=vx.hasOwnProperty;function k_(e,t,r,n,a,s){var o=r&yx,l=Bm(e),c=l.length,u=Bm(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:Tx.call(t,h)))return!1}var y=s.get(e),v=s.get(t);if(y&&v)return y==t&&v==e;var C=!0;s.set(e,t),s.set(t,e);for(var b=o;++fZp(e,t,o));return Xn(e,t,n,r,...a)}i(EC,"alternation");function _C(e,t,r){const n=Fe(e,t,r,{type:zr});kr(e,n);const a=Xn(e,t,n,r,Hr(e,t,r));return CC(e,t,r,a)}i(_C,"option");function Hr(e,t,r){const n=g1(yr(r.definition,a=>Zp(e,t,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:bC(e,n)}i(Hr,"block");function Qp(e,t,r,n,a){const s=n.left,o=n.right,l=Fe(e,t,r,{type:$1});kr(e,l);const c=Fe(e,t,r,{type:mC});return s.loopback=l,c.loopback=l,e.decisionMap[Nn(t,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Pe(o,l),a===void 0?(Pe(l,s),Pe(l,c)):(Pe(l,c),Pe(l,a.left),Pe(a.right,s)),{left:s,right:c}}i(Qp,"plus");function eh(e,t,r,n,a){const s=n.left,o=n.right,l=Fe(e,t,r,{type:R1});kr(e,l);const c=Fe(e,t,r,{type:mC}),u=Fe(e,t,r,{type:T1});return l.loopback=u,c.loopback=u,Pe(l,s),Pe(l,c),Pe(o,u),a!==void 0?(Pe(u,c),Pe(u,a.left),Pe(a.right,s)):Pe(u,l),e.decisionMap[Nn(t,a?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:c}}i(eh,"star");function CC(e,t,r,n){const a=n.left,s=n.right;return Pe(a,s),e.decisionMap[Nn(t,"Option",r.idx)]=a,n}i(CC,"optional");function kr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}i(kr,"defineDecisionState");function Xn(e,t,r,n,...a){const s=Fe(e,t,n,{type:v1,start:r});r.end=s;for(const l of a)l!==void 0?(Pe(r,l.left),Pe(l.right,s)):Pe(r,s);const o={left:r,right:s};return e.decisionMap[Nn(t,SC(n),n.idx)]=r,o}i(Xn,"makeAlts");function SC(e){if(e instanceof lt)return"Alternation";if(e instanceof Be)return"Option";if(e instanceof we)return"Repetition";if(e instanceof ot)return"RepetitionWithSeparator";if(e instanceof mt)return"RepetitionMandatory";if(e instanceof gt)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}i(SC,"getProdType");function bC(e,t){const r=t.length;for(let s=0;se.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}};function th(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}i(th,"getATNConfigKey");function kC(e,t,r){for(var n=-1,a=e.length;++n0&&r(l)?t>1?rh(l,t-1,r,n,a):i_(a,l):n||(a[a.length]=l)}return a}i(rh,"baseFlatten");var DC=rh;function MC(e,t){return DC(yr(e,t),1)}i(MC,"flatMap");var S1=MC;function xC(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s-1}i(UC,"arrayIncludes");var k1=UC;function zC(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=x1){var u=t?null:M1(e);if(u)return Up(u);o=!1,a=ZE,c=new YE}else c=t?[]:l;e:for(;++n{const a=n.toString();let s=r[a];return s!==void 0||(s={atnStartState:e,decision:t,states:{}},r[a]=s),s}}i(eS,"createDFACache");var tS=class{static{i(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=yC(e.rules),this.dfas=rS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Nn(r,"Alternation",t),u=this.atn.decisionMap[l].decision,d=yr(pd({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),f=>yr(f,h=>h[0]));if(wd(d,!1)&&!a){const f=tg(d,(h,y,v)=>(Gc(y,C=>{C&&(h[C.tokenTypeIdx]=v,Gc(C.categoryMatches,b=>{h[b]=v}))}),h),{});return n?function(h){var y;const v=this.LA(1),C=f[v.tokenTypeIdx];if(h!==void 0&&C!==void 0){const b=(y=h[C])===null||y===void 0?void 0:y.GATE;if(b!==void 0&&b.call(this)===!1)return}return C}:function(){const h=this.LA(1);return f[h.tokenTypeIdx]}}else return n?function(f){const h=new tS,y=f===void 0?0:f.length;for(let C=0;Cyr(f,h=>h[0]));if(wd(d)&&d[0][0]&&!a){const f=d[0],h=j1(f);if(h.length===1&&V1(h[0].categoryMatches)){const v=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const y=tg(h,(v,C)=>(C!==void 0&&(v[C.tokenTypeIdx]=!0,Gc(C.categoryMatches,b=>{v[b]=!0})),v),{});return function(){const v=this.LA(1);return y[v.tokenTypeIdx]===!0}}}return function(){const f=wo.call(this,s,u,rg,o);return typeof f=="object"?!1:f===0}}};function wd(e,t=!0){const r=new Set;for(const n of e){const a=new Set;for(const s of n){if(s===void 0){if(t)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const l of o)if(r.has(l)){if(!a.has(l))return!1}else r.add(l),a.add(l)}}return!0}i(wd,"isLL1Sequence");function rS(e){const t=e.decisionStates.length,r=Array(t);for(let n=0;nCn(a)).join(", "),r=e.production.idx===0?"":e.production.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${oS(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}i(sS,"buildAmbiguityError");function oS(e){if(e instanceof Ze)return"SUBRULE";if(e instanceof Be)return"OPTION";if(e instanceof lt)return"OR";if(e instanceof mt)return"AT_LEAST_ONE";if(e instanceof gt)return"AT_LEAST_ONE_SEP";if(e instanceof ot)return"MANY_SEP";if(e instanceof we)return"MANY";if(e instanceof Te)return"CONSUME";throw Error("non exhaustive match")}i(oS,"getProductionDslName");function lS(e,t,r){const n=S1(t.configs.elements,s=>s.state.transitions),a=G1(n.filter(s=>s instanceof Xp).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:e}}i(lS,"buildAdaptivePredictError");function cS(e,t){return e.edges[t.tokenTypeIdx]}i(cS,"getExistingTargetState");function uS(e,t,r){const n=new bd,a=[];for(const o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Bs){a.push(o);continue}const l=o.state.transitions.length;for(let c=0;c0&&!mS(s))for(const o of a)s.add(o);return s}i(uS,"computeReachSet");function dS(e,t){if(e instanceof Xp&&Np(t,e.tokenType))return e.target}i(dS,"getReachableTarget");function fS(e,t){let r;for(const n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}i(fS,"getUniqueAlt");function nh(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}i(nh,"newDFAState");function Id(e,t,r,n){return n=ah(e,n),t.edges[r.tokenTypeIdx]=n,n}i(Id,"addDFAEdge");function ah(e,t){if(t===dl)return t;const r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}i(ah,"addDFAState");function pS(e){const t=new bd,r=e.transitions.length;for(let n=0;n0){const a=[...e.stack],o={state:a.pop(),alt:e.alt,stack:a};$s(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}i(TS,"hasConflictingAltSet");function RS(e){for(const t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}i(RS,"hasStateAssociatedWithOneAlt");_s();var $S=class{static{i(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new sh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new Tc;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new fl(e.startOffset,e.image.length,ls(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const a of e){const s=new fl(a.startOffset,a.image.length,ls(a),a.tokenType,!0);s.root=this.rootNode,t.push(s)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const a=r.container.content.indexOf(r);if(a>0){r.container.content.splice(a,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},ih=class{static{i(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},fl=class extends ih{static{i(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,r,n,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},Tc=class extends ih{static{i(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new J1(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},J1=class AS extends Array{static{i(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,AS.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(const r of t)r.container=this.parent}},sh=class extends Tc{static{i(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},pl=Symbol("Datatype");function Io(e){return e.$type===pl}i(Io,"isDataTypeNode");var ng="​",ES=i(e=>e.endsWith(ng)?e:e+ng,"withRuleSuffix"),oh=class{static{i(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new Q1(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new bS(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},_S=class extends oh{static{i(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new $S,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e);let n;xa(e)&&(n=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(ES(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,a),Je(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===pl?s.value="":t!==void 0&&(s.$infixName=t)}return r(n),a?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){const n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){const a=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:l}=this.getAssignment(r),c=this.current;if(o){const u=Rr(r)?n.image:this.converter.convert(n.image,s);this.assign(o.operator,o.feature,u,s,l)}else if(Io(c)){let u=n.image;Rr(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,a){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,a)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,n,s))}}performSubruleAssignment(e,t,r){const{assignment:n,crossRef:a}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,a);else if(!n){const s=this.current;if(Io(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const a={$type:e};this.stack.push(a),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Io(e)?this.converter.convert(e.value,e.$cstNode):(af(this.astReflection,e),e)}constructInfix(e,t){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let a=0,s=-1;for(let v=0;vs?(s=b.precedence,a=v):b.precedence===s&&(b.rightAssoc||(a=v))}const o=n.slice(0,a),l=n.slice(a+1),c=r.slice(0,a+1),u=r.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:l},h=this.constructInfix(d,t),y=this.constructInfix(f,t);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:n[a],right:y}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=On(e,Tr);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Dn(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,a){const s=this.current;let o;switch(a==="single"&&typeof r=="string"?o=this.linker.buildReference(s,t,n,r):a==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(s,t,n,r):o=r,e){case"=":{s[t]=o;break}case"?=":{s[t]=!0;break}case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,a]of Object.entries(t)){const s=e[n];s===void 0?e[n]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[n]=a)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},CS=class{static{i(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return wa.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return wa.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return wa.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return wa.buildEarlyExitMessage(e)}},lh=class extends CS{static{i(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},SS=class extends oh{static{i(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const r=this.wrapper.DEFINE_RULE(ES(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,a){this.before(n),this.wrapper.wrapSubrule(e,t,a),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},Z1={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new lh},bS=class extends FL{static{i(this,"ChevrotainWrapper")}constructor(e,t){const r=t&&"maxLookahead"in t;super(e,{...Z1,lookaheadStrategy:r?new xp({maxLookahead:t.maxLookahead}):new X1({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},Q1=class extends bS{static{i(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};function Rc(e,t,r){return wS({parser:t,tokens:r,ruleNames:new Map},e),t}i(Rc,"createParser");function wS(e,t){const r=Dl(t,!1),n=oe(t.rules).filter(Je).filter(s=>r.has(s));for(const s of n){const o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(s,Br(o,s.definition))}const a=oe(t.rules).filter(xa).filter(s=>r.has(s));for(const s of a)e.parser.rule(s,IS(e,s))}i(wS,"buildRules");function IS(e,t){const r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(bt(r))throw new Error("Cannot use terminal rule in infix expression");const n=t.operators.precedences.flatMap(y=>y.operators),a={$type:"Group",elements:[]},s={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(s,o);const c={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...s,$container:o};o.elements.push(c,u);const f=n.map(y=>e.tokens[y.value]).map((y,v)=>({ALT:i(()=>e.parser.consume(v,y,c),"ALT")}));let h;return y=>{h??(h=$c(e,r)),e.parser.subrule(0,h,!1,s,y),e.parser.many(0,{DEF:i(()=>{e.parser.alternatives(0,f),e.parser.subrule(1,h,!1,u,y)},"DEF")})}}i(IS,"buildInfixRule");function Br(e,t,r=!1){let n;if(Rr(t))n=MS(e,t);else if(Gr(t))n=NS(e,t);else if(Tr(t))n=Br(e,t.terminal);else if(Dn(t))n=ch(e,t);else if($r(t))n=kS(e,t);else if(Sl(t))n=OS(e,t);else if(Nl(t))n=LS(e,t);else if(Mn(t))n=DS(e,t);else if(ff(t)){const a=e.consume++;n=i(()=>e.parser.consume(a,Ur,t),"method")}else throw new Pl(t.$cstNode,`Unexpected element type: ${t.$type}`);return uh(e,r?void 0:As(t),n,t.cardinality)}i(Br,"buildElement");function NS(e,t){const r=bn(t);return()=>e.parser.action(r,t)}i(NS,"buildAction");function kS(e,t){const r=t.rule.ref;if(Ln(r)){const n=e.subrule++,a=Je(r)&&r.fragment,s=t.arguments.length>0?PS(r,t.arguments):()=>({});let o;return l=>{o??(o=$c(e,r)),e.parser.subrule(n,o,a,t,s(l))}}else if(bt(r)){const n=e.consume++,a=hl(e,r.name);return()=>e.parser.consume(n,a,t)}else if(r)qr();else throw new Pl(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}i(kS,"buildRuleCall");function PS(e,t){if(t.some(n=>n.calledByName)){const n=t.map(a=>({parameterName:a.parameter?.ref?.name,predicate:Lt(a.value)}));return a=>{const s={};for(const{parameterName:o,predicate:l}of n)o&&(s[o]=l(a));return s}}else{const n=t.map(a=>Lt(a.value));return a=>{const s={};for(let o=0;ot(n)||r(n)}else if(uf(e)){const t=Lt(e.left),r=Lt(e.right);return n=>t(n)&&r(n)}else if(mf(e)){const t=Lt(e.value);return r=>!t(r)}else if(gf(e)){const t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(lf(e)){const t=!!e.true;return()=>t}qr()}i(Lt,"buildPredicate");function OS(e,t){if(t.elements.length===1)return Br(e,t.elements[0]);{const r=[];for(const a of t.elements){const s={ALT:Br(e,a,!0)},o=As(a);o&&(s.GATE=Lt(o)),r.push(s)}const n=e.or++;return a=>e.parser.alternatives(n,r.map(s=>{const o={ALT:i(()=>s.ALT(a),"ALT")},l=s.GATE;return l&&(o.GATE=()=>l(a)),o}))}}i(OS,"buildAlternatives");function LS(e,t){if(t.elements.length===1)return Br(e,t.elements[0]);const r=[];for(const l of t.elements){const c={ALT:Br(e,l,!0)},u=As(l);u&&(c.GATE=Lt(u)),r.push(c)}const n=e.or++,a=i((l,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${l}_${u}`},"idFunc"),s=i(l=>e.parser.alternatives(n,r.map((c,u)=>{const d={ALT:i(()=>!0,"ALT")},f=e.parser;d.ALT=()=>{if(c.ALT(l),!f.isRecording()){const y=a(n,f);f.unorderedGroups.get(y)||f.unorderedGroups.set(y,[]);const v=f.unorderedGroups.get(y);typeof v?.[u]>"u"&&(v[u]=!0)}};const h=c.GATE;return h?d.GATE=()=>h(l):d.GATE=()=>!f.unorderedGroups.get(a(n,f))?.[u],d})),"alternatives"),o=uh(e,As(t),s,"*");return l=>{o(l),e.parser.isRecording()||e.parser.unorderedGroups.delete(a(n,e.parser))}}i(LS,"buildUnorderedGroup");function DS(e,t){const r=t.elements.map(n=>Br(e,n));return n=>r.forEach(a=>a(n))}i(DS,"buildGroup");function As(e){if(Mn(e))return e.guardCondition}i(As,"getGuardCondition");function ch(e,t,r=t.terminal){if(r)if($r(r)&&Je(r.rule.ref)){const n=r.rule.ref,a=e.subrule++;let s;return o=>{s??(s=$c(e,n)),e.parser.subrule(a,s,!1,t,o)}}else if($r(r)&&bt(r.rule.ref)){const n=e.consume++,a=hl(e,r.rule.ref.name);return()=>e.parser.consume(n,a,t)}else if(Rr(r)){const n=e.consume++,a=hl(e,r.value);return()=>e.parser.consume(n,a,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const a=Gl(t.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+bn(t.type.ref));return ch(e,t,a)}}i(ch,"buildCrossReference");function MS(e,t){const r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}i(MS,"buildKeyword");function uh(e,t,r,n){const a=t&&Lt(t);if(!n)if(a){const s=e.or++;return o=>e.parser.alternatives(s,[{ALT:i(()=>r(o),"ALT"),GATE:i(()=>a(o),"GATE")},{ALT:Ad(),GATE:i(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const s=e.many++;return o=>e.parser.many(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const s=e.many++;if(a){const o=e.or++;return l=>e.parser.alternatives(o,[{ALT:i(()=>e.parser.atLeastOne(s,{DEF:i(()=>r(l),"DEF")}),"ALT"),GATE:i(()=>a(l),"GATE")},{ALT:Ad(),GATE:i(()=>!a(l),"GATE")}])}else return o=>e.parser.atLeastOne(s,{DEF:i(()=>r(o),"DEF")})}else if(n==="?"){const s=e.optional++;return o=>e.parser.optional(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else qr()}i(uh,"wrap");function $c(e,t){const r=xS(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}i($c,"getRule");function xS(e,t){if(Ln(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,a=t.$type;for(;!Je(n);)(Mn(n)||Sl(n)||Nl(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,e.ruleNames.set(t,a),a}}i(xS,"getRuleName");function hl(e,t){const r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}i(hl,"getToken");function dh(e){const t=e.Grammar,r=e.parser.Lexer,n=new SS(e);return Rc(t,n,r.definition),n.finalize(),n}i(dh,"createCompletionParser");function fh(e){const t=ph(e);return t.finalize(),t}i(fh,"createLangiumParser");function ph(e){const t=e.Grammar,r=e.parser.Lexer,n=new _S(e);return Rc(t,n,r.definition)}i(ph,"prepareLangiumParser");var Ac=class{static{i(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const r=oe(Dl(e,!1)),n=this.buildTerminalTokens(r),a=this.buildKeywordTokens(r,n,t);return a.push(...n),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(bt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Ns(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=Ll(t)?Xe.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Ln).flatMap(n=>wr(n).filter(Rr)).distinct(n=>n.value).toArray().sort((n,a)=>a.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){const n=this.buildKeywordPattern(e,r),a={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,t){return t?new RegExp(Va(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{const a=n?.PATTERN;return a?.source&&Ff("^"+a.source+"$",e.value)&&r.push(n),r},[])}},hh=class{static{i(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(Dn(r)&&(r=Bf(r)),$r(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Yt.convertInt(t);case"STRING":return Yt.convertString(t);case"ID":return Yt.convertID(t)}switch(Zf(e)?.toLowerCase()){case"number":return Yt.convertNumber(t);case"boolean":return Yt.convertBoolean(t);case"bigint":return Yt.convertBigint(t);case"date":return Yt.convertDate(t);default:return t}}},Yt;(function(e){function t(u){let d="";for(let f=1;f{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}i(Ec,"delayNextTick");var No=0,FS=10;function _c(){return No=performance.now(),new pe.CancellationTokenSource}i(_c,"startCancelableOperation");function mh(e){FS=e}i(mh,"setInterruptionPeriod");var Zt=Symbol("OperationCancelled");function Jn(e){return e===Zt}i(Jn,"isOperationCancelled");async function Ge(e){if(e===pe.CancellationToken.None)return;const t=performance.now();if(t-No>=FS&&(No=t,await Ec(),No=performance.now()),e.isCancellationRequested)throw Zt}i(Ge,"interruptAndCheck");var Sr=class{static{i(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},ag=class Nd{static{i(this,"FullTextDocument")}constructor(t,r,n,a){this._uri=t,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(const n of t)if(Nd.isIncremental(n)){const a=yh(n.range),s=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);const l=Math.max(a.start.line,0),c=Math.max(a.end.line,0);let u=this._lineOffsets;const d=kd(n.text,!1,s);if(c-l===d.length)for(let h=0,y=d.length;ht?a=o:n=o+1}const s=n-1;return t=this.ensureBeforeEOL(t,r[s]),{line:s,character:t-r[s]}}offsetAt(t){const r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;const n=r[t.line];if(t.character<=0)return n;const a=t.line+1r&&gh(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},ml;(function(e){function t(a,s,o,l){return new ag(a,s,o,l)}i(t,"create"),e.create=t;function r(a,s,o){if(a instanceof ag)return a.update(s,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}i(r,"update"),e.update=r;function n(a,s){const o=a.getText(),l=gl(s.map(GS),(d,f)=>{const h=d.range.start.line-f.range.start.line;return h===0?d.range.start.character-f.range.start.character:h});let c=0;const u=[];for(const d of l){const f=a.offsetAt(d.range.start);if(fc&&u.push(o.substring(c,f)),d.newText.length&&u.push(d.newText),c=a.offsetAt(d.range.end)}return u.push(o.substr(c)),u.join("")}i(n,"applyEdits"),e.applyEdits=n})(ml||(ml={}));function gl(e,t){if(e.length<=1)return e;const r=e.length/2|0,n=e.slice(0,r),a=e.slice(r);gl(n,t),gl(a,t);let s=0,o=0,l=0;for(;sr.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}i(yh,"getWellformedRange");function GS(e){const t=yh(e.range);return t!==e.range?{newText:e.newText,range:t}:e}i(GS,"getWellformedEdit");var jS;(()=>{var e={975:P=>{function _(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}i(_,"e");function g(T,R){for(var S,O="",M=0,D=-1,z=0,B=0;B<=T.length;++B){if(B2){var Z=O.lastIndexOf("/");if(Z!==O.length-1){Z===-1?(O="",M=0):M=(O=O.slice(0,Z)).length-1-O.lastIndexOf("/"),D=B,z=0;continue}}else if(O.length===2||O.length===1){O="",M=0,D=B,z=0;continue}}R&&(O.length>0?O+="/..":O="..",M=2)}else O.length>0?O+="/"+T.slice(D+1,B):O=T.slice(D+1,B),M=B-D-1;D=B,z=0}else S===46&&z!==-1?++z:z=-1}return O}i(g,"r");var E={resolve:i(function(){for(var T,R="",S=!1,O=arguments.length-1;O>=-1&&!S;O--){var M;O>=0?M=arguments[O]:(T===void 0&&(T=process.cwd()),M=T),_(M),M.length!==0&&(R=M+"/"+R,S=M.charCodeAt(0)===47)}return R=g(R,!S),S?R.length>0?"/"+R:"/":R.length>0?R:"."},"resolve"),normalize:i(function(T){if(_(T),T.length===0)return".";var R=T.charCodeAt(0)===47,S=T.charCodeAt(T.length-1)===47;return(T=g(T,!R)).length!==0||R||(T="."),T.length>0&&S&&(T+="/"),R?"/"+T:T},"normalize"),isAbsolute:i(function(T){return _(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:i(function(){if(arguments.length===0)return".";for(var T,R=0;R0&&(T===void 0?T=S:T+="/"+S)}return T===void 0?".":E.normalize(T)},"join"),relative:i(function(T,R){if(_(T),_(R),T===R||(T=E.resolve(T))===(R=E.resolve(R)))return"";for(var S=1;SB){if(R.charCodeAt(D+J)===47)return R.slice(D+J+1);if(J===0)return R.slice(D+J)}else M>B&&(T.charCodeAt(S+J)===47?Z=J:J===0&&(Z=0));break}var te=T.charCodeAt(S+J);if(te!==R.charCodeAt(D+J))break;te===47&&(Z=J)}var de="";for(J=S+Z+1;J<=O;++J)J!==O&&T.charCodeAt(J)!==47||(de.length===0?de+="..":de+="/..");return de.length>0?de+R.slice(D+Z):(D+=Z,R.charCodeAt(D)===47&&++D,R.slice(D))},"relative"),_makeLong:i(function(T){return T},"_makeLong"),dirname:i(function(T){if(_(T),T.length===0)return".";for(var R=T.charCodeAt(0),S=R===47,O=-1,M=!0,D=T.length-1;D>=1;--D)if((R=T.charCodeAt(D))===47){if(!M){O=D;break}}else M=!1;return O===-1?S?"/":".":S&&O===1?"//":T.slice(0,O)},"dirname"),basename:i(function(T,R){if(R!==void 0&&typeof R!="string")throw new TypeError('"ext" argument must be a string');_(T);var S,O=0,M=-1,D=!0;if(R!==void 0&&R.length>0&&R.length<=T.length){if(R.length===T.length&&R===T)return"";var z=R.length-1,B=-1;for(S=T.length-1;S>=0;--S){var Z=T.charCodeAt(S);if(Z===47){if(!D){O=S+1;break}}else B===-1&&(D=!1,B=S+1),z>=0&&(Z===R.charCodeAt(z)?--z==-1&&(M=S):(z=-1,M=B))}return O===M?M=B:M===-1&&(M=T.length),T.slice(O,M)}for(S=T.length-1;S>=0;--S)if(T.charCodeAt(S)===47){if(!D){O=S+1;break}}else M===-1&&(D=!1,M=S+1);return M===-1?"":T.slice(O,M)},"basename"),extname:i(function(T){_(T);for(var R=-1,S=0,O=-1,M=!0,D=0,z=T.length-1;z>=0;--z){var B=T.charCodeAt(z);if(B!==47)O===-1&&(M=!1,O=z+1),B===46?R===-1?R=z:D!==1&&(D=1):R!==-1&&(D=-1);else if(!M){S=z+1;break}}return R===-1||O===-1||D===0||D===1&&R===O-1&&R===S+1?"":T.slice(R,O)},"extname"),format:i(function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function(R,S){var O=S.dir||S.root,M=S.base||(S.name||"")+(S.ext||"");return O?O===S.root?O+M:O+"/"+M:M})(0,T)},"format"),parse:i(function(T){_(T);var R={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return R;var S,O=T.charCodeAt(0),M=O===47;M?(R.root="/",S=1):S=0;for(var D=-1,z=0,B=-1,Z=!0,J=T.length-1,te=0;J>=S;--J)if((O=T.charCodeAt(J))!==47)B===-1&&(Z=!1,B=J+1),O===46?D===-1?D=J:te!==1&&(te=1):D!==-1&&(te=-1);else if(!Z){z=J+1;break}return D===-1||B===-1||te===0||te===1&&D===B-1&&D===z+1?B!==-1&&(R.base=R.name=z===0&&M?T.slice(1,B):T.slice(z,B)):(z===0&&M?(R.name=T.slice(1,D),R.base=T.slice(1,B)):(R.name=T.slice(z,D),R.base=T.slice(z,B)),R.ext=T.slice(D,B)),z>0?R.dir=T.slice(0,z-1):M&&(R.dir="/"),R},"parse"),sep:"/",delimiter:":",win32:null,posix:null};E.posix=E,P.exports=E}},t={};function r(P){var _=t[P];if(_!==void 0)return _.exports;var g=t[P]={exports:{}};return e[P](g,g.exports,r),g.exports}i(r,"r"),r.d=(P,_)=>{for(var g in _)r.o(_,g)&&!r.o(P,g)&&Object.defineProperty(P,g,{enumerable:!0,get:_[g]})},r.o=(P,_)=>Object.prototype.hasOwnProperty.call(P,_),r.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:i(()=>h,"URI"),Utils:i(()=>Ne,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,l=/^\/\//;function c(P,_){if(!P.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${P.authority}", path: "${P.path}", query: "${P.query}", fragment: "${P.fragment}"}`);if(P.scheme&&!s.test(P.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(P.path){if(P.authority){if(!o.test(P.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(P.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}i(c,"a");const u="",d="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static{i(this,"l")}static isUri(_){return _ instanceof h||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}scheme;authority;path;query;fragment;constructor(_,g,E,T,R,S=!1){typeof _=="object"?(this.scheme=_.scheme||u,this.authority=_.authority||u,this.path=_.path||u,this.query=_.query||u,this.fragment=_.fragment||u):(this.scheme=(function(O,M){return O||M?O:"file"})(_,S),this.authority=g||u,this.path=(function(O,M){switch(O){case"https":case"http":case"file":M?M[0]!==d&&(M=d+M):M=d}return M})(this.scheme,E||u),this.query=T||u,this.fragment=R||u,c(this,S))}get fsPath(){return I(this,!1)}with(_){if(!_)return this;let{scheme:g,authority:E,path:T,query:R,fragment:S}=_;return g===void 0?g=this.scheme:g===null&&(g=u),E===void 0?E=this.authority:E===null&&(E=u),T===void 0?T=this.path:T===null&&(T=u),R===void 0?R=this.query:R===null&&(R=u),S===void 0?S=this.fragment:S===null&&(S=u),g===this.scheme&&E===this.authority&&T===this.path&&R===this.query&&S===this.fragment?this:new v(g,E,T,R,S)}static parse(_,g=!1){const E=f.exec(_);return E?new v(E[2]||u,H(E[4]||u),H(E[5]||u),H(E[7]||u),H(E[9]||u),g):new v(u,u,u,u,u)}static file(_){let g=u;if(a&&(_=_.replace(/\\/g,d)),_[0]===d&&_[1]===d){const E=_.indexOf(d,2);E===-1?(g=_.substring(2),_=d):(g=_.substring(2,E),_=_.substring(E)||d)}return new v("file",g,_,u,u)}static from(_){const g=new v(_.scheme,_.authority,_.path,_.query,_.fragment);return c(g,!0),g}toString(_=!1){return A(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof h)return _;{const g=new v(_);return g._formatted=_.external,g._fsPath=_._sep===y?_.fsPath:null,g}}return _}}const y=a?1:void 0;class v extends h{static{i(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(_=!1){return _?A(this,!0):(this._formatted||(this._formatted=A(this,!1)),this._formatted)}toJSON(){const _={$mid:1};return this._fsPath&&(_.fsPath=this._fsPath,_._sep=y),this._formatted&&(_.external=this._formatted),this.path&&(_.path=this.path),this.scheme&&(_.scheme=this.scheme),this.authority&&(_.authority=this.authority),this.query&&(_.query=this.query),this.fragment&&(_.fragment=this.fragment),_}}const C={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(P,_,g){let E,T=-1;for(let R=0;R=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===46||S===95||S===126||_&&S===47||g&&S===91||g&&S===93||g&&S===58)T!==-1&&(E+=encodeURIComponent(P.substring(T,R)),T=-1),E!==void 0&&(E+=P.charAt(R));else{E===void 0&&(E=P.substr(0,R));const O=C[S];O!==void 0?(T!==-1&&(E+=encodeURIComponent(P.substring(T,R)),T=-1),E+=O):T===-1&&(T=R)}}return T!==-1&&(E+=encodeURIComponent(P.substring(T))),E!==void 0?E:P}i(b,"m");function w(P){let _;for(let g=0;g1&&P.scheme==="file"?`//${P.authority}${P.path}`:P.path.charCodeAt(0)===47&&(P.path.charCodeAt(1)>=65&&P.path.charCodeAt(1)<=90||P.path.charCodeAt(1)>=97&&P.path.charCodeAt(1)<=122)&&P.path.charCodeAt(2)===58?_?P.path.substr(1):P.path[1].toLowerCase()+P.path.substr(2):P.path,a&&(g=g.replace(/\//g,"\\")),g}i(I,"v");function A(P,_){const g=_?w:b;let E="",{scheme:T,authority:R,path:S,query:O,fragment:M}=P;if(T&&(E+=T,E+=":"),(R||T==="file")&&(E+=d,E+=d),R){let D=R.indexOf("@");if(D!==-1){const z=R.substr(0,D);R=R.substr(D+1),D=z.lastIndexOf(":"),D===-1?E+=g(z,!1,!1):(E+=g(z.substr(0,D),!1,!1),E+=":",E+=g(z.substr(D+1),!1,!0)),E+="@"}R=R.toLowerCase(),D=R.lastIndexOf(":"),D===-1?E+=g(R,!1,!0):(E+=g(R.substr(0,D),!1,!0),E+=R.substr(D))}if(S){if(S.length>=3&&S.charCodeAt(0)===47&&S.charCodeAt(2)===58){const D=S.charCodeAt(1);D>=65&&D<=90&&(S=`/${String.fromCharCode(D+32)}:${S.substr(3)}`)}else if(S.length>=2&&S.charCodeAt(1)===58){const D=S.charCodeAt(0);D>=65&&D<=90&&(S=`${String.fromCharCode(D+32)}:${S.substr(2)}`)}E+=g(S,!0,!1)}return O&&(E+="?",E+=g(O,!1,!1)),M&&(E+="#",E+=_?M:b(M,!1,!1)),E}i(A,"b");function k(P){try{return decodeURIComponent(P)}catch{return P.length>3?P.substr(0,3)+k(P.substr(3)):P}}i(k,"C");const G=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function H(P){return P.match(G)?P.replace(G,(_=>k(_))):P}i(H,"w");var X=r(975);const le=X.posix||X,ce="/";var Ne;(function(P){P.joinPath=function(_,...g){return _.with({path:le.join(_.path,...g)})},P.resolvePath=function(_,...g){let E=_.path,T=!1;E[0]!==ce&&(E=ce+E,T=!0);let R=le.resolve(E,...g);return T&&R[0]===ce&&!_.authority&&(R=R.substring(1)),_.with({path:R})},P.dirname=function(_){if(_.path.length===0||_.path===ce)return _;let g=le.dirname(_.path);return g.length===1&&g.charCodeAt(0)===46&&(g=""),_.with({path:g})},P.basename=function(_){return le.basename(_.path)},P.extname=function(_){return le.extname(_.path)}})(Ne||(Ne={})),jS=n})();var{URI:dt,Utils:Si}=jS,Ye;(function(e){e.basename=Si.basename,e.dirname=Si.dirname,e.extname=Si.extname,e.joinPath=Si.joinPath,e.resolvePath=Si.resolvePath;const t=typeof process=="object"&&process?.platform==="win32";function r(o,l){return o?.toString()===l?.toString()}i(r,"equals"),e.equals=r;function n(o,l){const c=typeof o=="string"?dt.parse(o).path:o.path,u=typeof l=="string"?dt.parse(l).path:l.path,d=c.split("/").filter(C=>C.length>0),f=u.split("/").filter(C=>C.length>0);if(t){const C=/^[A-Z]:$/;if(d[0]&&C.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]&&C.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]!==f[0])return u.substring(1)}let h=0;for(;h({name:n.name,uri:Ye.joinPath(dt.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(Ye.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(const a of r){let s=n.children.get(a);if(!s)if(t)s={name:a,children:new Map,parent:n},n.children.set(a,s);else return;n=s}return n}collectValues(e){const t=[];e.element&&t.push(e.element);for(const r of e.children.values())t.push(...this.collectValues(r));return t}},Y;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(Y||(Y={}));var US=class{static{i(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=pe.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??dt.parse(e.uri),pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){const n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{const n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{const n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let a;if(r)a={parseResult:e,uri:t,state:Y.Parsed,references:[],textDocument:r};else{const s=this.createTextDocumentGetter(t,n);a={parseResult:e,uri:t,state:Y.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,t){const r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),a=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return r!==a&&(e.parseResult=await this.parseAsync(e.uri,a,t),e.parseResult.value.$document=e),e.state=Y.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let n;return()=>n??(n=ml.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},zS=class{static{i(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new vh,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return oe(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,Y.Changed),r}deleteDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=Y.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){const t=e.toString(),r=this.documentTrie.findAll(t);for(const n of r)n.state=Y.Changed;return this.documentTrie.delete(t),r}},sn=Symbol("RefResolving"),BS=class{static{i(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=pe.CancellationToken.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const n of Mt(e.parseResult.value))await Ge(t),Ma(n).forEach(a=>{const s=`${n.$type}:${a.property}`;r.startSubTask(s);try{this.doLink(a,e)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(const r of Mt(e.parseResult.value))await Ge(t),Ma(r).forEach(n=>this.doLink(n,e))}doLink(e,t){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=sn;try{const n=this.getCandidate(e);if(cn(n))r._ref=n;else{r._nodeDescription=n;const a=this.loadAstNode(n);r._ref=a??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);const a=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${a}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=sn;try{const n=this.getCandidates(e),a=[];if(cn(n))r._linkingError=n;else for(const s of n){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}r._items=a}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(const t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){const a=this,s={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Le(this._ref))return this._ref;if(tf(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=sn;const o=Ia(e).$document,l=a.getLinkedNode({reference:s,container:e,property:t});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:t})}};return s}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(cn(t))return{error:t};const r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=Ia(e.container).$document;r&&r.stateDn(t)&&t.isMulti)}findDeclarations(e){if(e){const t=Vf(e),r=e.astNode;if(t&&r){const n=r[t.feature];if(He(n)||Qt(n))return Lo(n);if(Array.isArray(n)){for(const a of n)if((He(a)||Qt(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Lo(a)}}if(r){const n=this.nameProvider.getNameNode(r);if(n&&(n===e||Sf(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(const n of Ma(r))if(Qt(n.reference)&&n.reference.items.some(a=>a.ref===e))return n.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const t=this.findDeclarations(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n)??n.$cstNode;a&&r.push(a)}return r}findReferences(e,t){const r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(a=>Ye.equals(a.sourceUri,t.documentUri))),r.push(...n),oe(r)}getSelfReferences(e){const t=this.getSelfNodes(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n);if(a){const s=Dt(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Ga(a),local:!0})}}return r}},br=class{static{i(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return os.sum(oe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?oe(t):Oa}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return oe(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return oe(this.map.keys())}values(){return oe(this.map.values()).flat()}entriesGroupedByKey(){return oe(this.map.entries())}},yl=class{static{i(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},WS=class{static{i(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=Ss,n=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,t);for(const s of r(e))await Ge(n),this.addExportedSymbol(s,a,t);return a}addExportedSymbol(e,t,r){const n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=pe.CancellationToken.None){const r=e.parseResult.value,n=new br;for(const a of wr(r))await Ge(t),this.addLocalSymbol(a,e,n);return n}addLocalSymbol(e,t,r){const n=e.$container;if(n){const a=this.nameProvider.getName(e);a&&r.add(n,this.descriptions.createDescription(e,a,t))}}},Pd=class{static{i(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},eF=class{static{i(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?oe(n).concat(this.outerScope.getElements(e)):oe(n)}getAllElements(){let e=oe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},VS=class{static{i(this,"MultiMapScope")}constructor(e,t,r){this.elements=new br,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?oe(r).concat(this.outerScope.getElements(e)):oe(r)}getAllElements(){let e=oe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},tF={getElement(){},getElements(){return Oa},getAllElements(){return Oa}},Cc=class{static{i(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Rh=class extends Cc{static{i(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Sc=class extends Cc{static{i(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){const a=r();return n.set(t,a),a}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},HS=class extends Sc{static{i(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(const a of n)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{const a=r.concat(n);for(const s of a)this.clear(s)}))}},$h=class extends Rh{static{i(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},YS=class{static{i(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new $h(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),n=Dt(e.container).localSymbols;if(n){let s=e.container;do n.has(s)&&t.push(n.getStream(s).filter(o=>this.reflection.isSubtype(o.type,r))),s=s.$container;while(s)}let a=this.getGlobalScope(r,e);for(let s=t.length-1;s>=0;s--)a=this.createScope(t[s],a);return a}createScope(e,t,r){return new Pd(oe(e),t,r)}createScopeForNodes(e,t,r){const n=oe(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Pd(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new VS(this.indexManager.allElements(e)))}};function Ah(e){return typeof e.$comment=="string"}i(Ah,"isAstNodeWithComment");function Od(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}i(Od,"isIntermediateReference");var XS=class{static{i(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const r=t??{},n=t?.replacer,a=i((o,l)=>this.replacer(o,l,r),"defaultReplacer"),s=n?(o,l)=>n(o,l,a):a;try{return this.currentDocument=Dt(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(He(t)){const l=t.ref,c=r?t.$refText:void 0;if(l){const u=Dt(l);let d="";this.currentDocument&&this.currentDocument!==u&&(o?d=o(u.uri,l):d=u.uri.toString());const f=this.astNodeLocator.getAstNodePath(l);return{$ref:`${d}#${f}`,$refText:c}}else return{$error:t.error?.message??"Could not resolve reference",$refText:c}}else if(Qt(t)){const l=r?t.$refText:void 0,c=[];for(const u of t.items){const d=u.ref,f=Dt(u.ref);let h="";this.currentDocument&&this.currentDocument!==f&&(o?h=o(f.uri,d):h=f.uri.toString());const y=this.astNodeLocator.getAstNodePath(d);c.push(`${h}#${y}`)}return{$refs:c,$refText:l}}else if(Le(t)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(l??(l={...t}),l.$sourceText=t.$cstNode?.text),s){l??(l={...t});const c=this.commentProvider.getComment(t);c&&(l.$comment=c.replace(/\r/g,""))}return l??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=i(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=qf(e.$cstNode,a).map(t);s.length!==0&&(n[a]=s)}),e}}linkNode(e,t,r,n,a,s){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u{await this.handleException(()=>e.call(t,r,n,a),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(a){if(Jn(a))throw a;console.error(`${t}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);r("error",`${t}: ${s}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=oe(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(n,a,s,o)=>{await this.handleException(()=>e.call(r,n,a,s,o),t,a,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},QS=Object.freeze({validateNode:!0,validateChildren:!0}),eb=class{static{i(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=pe.CancellationToken.None){const n=e.parseResult,a=[];if(await Ge(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,a,t),t.stopAfterLexingErrors&&a.some(s=>s.data?.code===Et.LexingError)||(this.processParsingErrors(n,a,t),t.stopAfterParsingErrors&&a.some(s=>s.data?.code===Et.ParsingError))||(this.processLinkingErrors(e,a,t),t.stopAfterLinkingErrors&&a.some(s=>s.data?.code===Et.LinkingError))))return a;try{a.push(...await this.validateAst(n.value,t,r))}catch(s){if(Jn(s))throw s;console.error("An error occurred during validation:",s)}return await Ge(r),a}processLexingErrors(e,t,r){const n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of n){const s=a.severity??"error",o={severity:is(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:_h(s),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(const n of e.parserErrors){let a;if(isNaN(n.token.startOffset)){if("previousToken"in n){const s=n.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=ls(n.token);if(a){const s={severity:is("error"),range:a,message:n.message,data:En(Et.ParsingError),source:this.getSource()};t.push(s)}}}processLinkingErrors(e,t,r){for(const n of e.references){const a=n.error;if(a){const s={node:a.info.container,range:n.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:Et.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};t.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,t,r=pe.CancellationToken.None){const n=[],a=i((s,o,l)=>{n.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,t,a,r),await this.validateAstNodes(e,t,a,r),await this.validateAstAfter(e,t,a,r),n}async validateAstBefore(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Ge(n),await s(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=pe.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=Mt(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,t);if(l.validateNode)try{const c=this.validationRegistry.getChecks(o.$type,t.categories);for(const u of c)await u(o,r,n)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=Mt(e).iterator();for(const s of a){await Ge(n);const o=this.validateSingleNodeOptions(s,t);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,t.categories);for(const c of l)await c(s,r,n)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,t){return QS}async validateAstAfter(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Ge(n),await s(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:Eh(r),severity:is(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Eh(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Ml(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=Wf(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}i(Eh,"getDiagnosticRange");function is(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}i(is,"toDiagnosticSeverity");function _h(e){switch(e){case"error":return En(Et.LexingError);case"warning":return En(Et.LexingWarning);case"info":return En(Et.LexingInfo);case"hint":return En(Et.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}i(_h,"toDiagnosticData");var Et;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(Et||(Et={}));var tb=class{static{i(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const n=r??Dt(e);t??(t=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${a} has no name.`);let s;const o=i(()=>s??(s=Ga(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ga(e.$cstNode),type:e.$type,documentUri:n.uri,path:a}}},rb=class{static{i(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=pe.CancellationToken.None){const r=[],n=e.parseResult.value;for(const a of Mt(n))await Ge(t),Ma(a).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode)return[];let r=[];He(t)&&t.$nodeDescription?r=[t.$nodeDescription]:Qt(t)&&(r=t.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const n=Dt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Ga(t.$refNode);for(const l of r)s.push({sourceUri:n,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Ye.equals(l.documentUri,n)});return s}},nb=class{static{i(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,a)=>{if(!n||a.length===0)return n;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return n[o]?.[l]}return n[a]},e)}},bc={};$l(bc,Jd(qa()));var ab=class{static{i(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new Sr,this.onConfigurationSectionUpdateEmitter=new bc.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,a)=>{this.updateSectionConfiguration(n.section,r[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},Js=Jd(Dw()),Sn;(function(e){function t(r){return{dispose:i(async()=>await r(),"dispose")}}i(t,"create"),e.create=t})(Sn||(Sn={}));var ib=class{static{i(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new br,this.documentPhaseListeners=new br,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Y.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=pe.CancellationToken.None){for(const n of e){const a=n.uri.toString();if(n.state===Y.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,Y.IndexedReferences);else if(typeof t.validation=="object"){const s=this.findMissingValidationCategories(n,t);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),n.state=Y.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=Y.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=pe.CancellationToken.None){this.currentState=Y.Changed;const n=[];for(const l of t){const c=this.langiumDocuments.deleteDocuments(l);for(const u of c)n.push(u.uri),this.cleanUpDeleted(u)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=Y.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,Y.Changed)}const s=oe(a).concat(n).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Y.ComputedScopes)),await this.emitUpdate(a,n),await Ge(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,t){const r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,s=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return oe(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Sn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case Y.Changed:case Y.Parsed:this.indexManager.removeContent(e.uri);case Y.IndexedContent:e.localSymbols=void 0;case Y.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Y.Linked:this.indexManager.removeReferences(e.uri);case Y.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Y.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Y.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,Y.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,Y.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,Y.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,r)});const n=e.filter(s=>this.shouldLink(s));await this.runCancelable(n,Y.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(n,Y.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Y.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(const r of e){const n=r.uri.toString(),a=this.buildState.get(n);(!a||a.completed)&&this.buildState.set(n,{completed:!1,options:t,result:a?.result})}}async runCancelable(e,t,r,n){for(const s of e)s.states.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Sn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Sn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=pe.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){const n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(Zt);if(this.currentState>=e&&e>n.state)return Promise.reject(new Js.ResponseError(Js.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${Y[n.state]}, requiring ${Y[e]}, but workspace state is already ${Y[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Js.ResponseError(Js.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,c=>{Ye.equals(c.uri,t)&&(o.dispose(),l.dispose(),a(c.uri))}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Zt)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(Zt):new Promise((r,n)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),r()}),s=t.onCancellationRequested(()=>{a.dispose(),s.dispose(),n(Zt)})})}async notifyDocumentPhase(e,t,r){const a=this.documentPhaseListeners.get(t).slice();for(const s of a)try{await Ge(r),await s(e,r)}catch(o){if(!Jn(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const a=this.buildPhaseListeners.get(t).slice();for(const s of a)await Ge(r),await s(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),a=typeof n.validation=="object"?{...n.validation}:{};a.categories=this.findMissingValidationCategories(e,n);const s=await r.validateDocument(e,a,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=oe(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},sb=class{static{i(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Sc,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=Dt(e).uri,n=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Ye.equals(s.targetUri,r)&&s.targetPath===t&&n.push(s)})}),oe(n)}allElements(e,t){let r=oe(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),a=e.uri.toString();this.symbolIndex.set(a,n),this.symbolByTypeIndex.clear(a)}async updateReferences(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},ob=class{static{i(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new Sr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=pe.CancellationToken.None){const r=await this.performStartup(e);await Ge(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=[],r=i(s=>{t.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,r);const n=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,n)));const a=oe(n).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{const n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return dt.parse(e.uri)}async traverseFolder(e,t){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){const t=Ye.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},lb=class{static{i(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,a){return fd.buildUnexpectedCharactersMessage(e,t,r,n,a)}buildUnableToPopLexerModeMessage(e){return fd.buildUnableToPopLexerModeMessage(e)}},Ch={mode:"full"},Sh=class{static{i(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=Tl(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Xe(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Ch){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Tl(e))return e;const t=Ic(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};function wc(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}i(wc,"isTokenTypeArray");function Ic(e){return e&&"modes"in e&&"defaultMode"in e}i(Ic,"isIMultiModeLexerDefinition");function Tl(e){return!wc(e)&&!Ic(e)}i(Tl,"isTokenTypeDictionary");_s();function bh(e,t,r){let n,a;typeof e=="string"?(a=t,n=r):(a=e.range.start,n=t),a||(a=ie.create(0,0));const s=Ih(e),o=Nc(n),l=cb({lines:s,position:a,options:o});return fb({index:0,tokens:l,position:a})}i(bh,"parseJSDoc");function wh(e,t){const r=Nc(t),n=Ih(e);if(n.length===0)return!1;const a=n[0],s=n[n.length-1],o=r.start,l=r.end;return!!o?.exec(a)&&!!l?.exec(s)}i(wh,"isJSDoc");function Ih(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(uy)}i(Ih,"getLines");var ig=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,rF=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function cb(e){const t=[];let r=e.position.line,n=e.position.character;for(let a=0;a=l.length){if(t.length>0){const d=ie.create(r,n);t.push({type:"break",content:"",range:ee.create(d,d)})}}else{ig.lastIndex=c;const d=ig.exec(l);if(d){const f=d[0],h=d[1],y=ie.create(r,n+c),v=ie.create(r,n+c+f.length);t.push({type:"tag",content:h,range:ee.create(y,v)}),c+=f.length,c=Rl(l,c)}if(c0&&t[t.length-1].type==="break"?t.slice(0,-1):t}i(cb,"tokenize");function ub(e,t,r,n){const a=[];if(e.length===0){const s=ie.create(r,n),o=ie.create(r,n+t.length);a.push({type:"text",content:t,range:ee.create(s,o)})}else{let s=0;for(const l of e){const c=l.index,u=t.substring(s,c);u.length>0&&a.push({type:"text",content:t.substring(s,c),range:ee.create(ie.create(r,s+n),ie.create(r,c+n))});let d=u.length+1;const f=l[1];if(a.push({type:"inline-tag",content:f,range:ee.create(ie.create(r,s+d+n),ie.create(r,s+d+f.length+n))}),d+=f.length,l.length===4){d+=l[2].length;const h=l[3];a.push({type:"text",content:h,range:ee.create(ie.create(r,s+d+n),ie.create(r,s+d+h.length+n))})}else a.push({type:"text",content:"",range:ee.create(ie.create(r,s+d+n),ie.create(r,s+d+n))});s=c+l[0].length}const o=t.substring(s);o.length>0&&a.push({type:"text",content:o,range:ee.create(ie.create(r,s+n),ie.create(r,s+n+o.length))})}return a}i(ub,"buildInlineTokens");var nF=/\S/,aF=/\s*$/;function Rl(e,t){const r=e.substring(t).match(nF);return r?t+r.index:e.length}i(Rl,"skipWhitespace");function db(e){const t=e.match(aF);if(t&&typeof t.index=="number")return t.index}i(db,"lastCharacter");function fb(e){const t=ie.create(e.position.line,e.position.character);if(e.tokens.length===0)return new sg([],ee.create(t,t));const r=[];for(;e.indext.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=Dd(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const n=r.toMarkdown(e);t+=Dd(t)+n}return t.trim()}},jc=class{static{i(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} +${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const a=gb(this.name,t,e??{});if(typeof a=="string")return a}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} — ${t}`:this.content.inlines.length>1&&(n=`${n} +${t}`),this.inline?`{${n}}`:n}};function gb(e,t,r){if(e==="linkplain"||e==="linkcode"||e==="link"){const n=t.indexOf(" ");let a=t;if(n>0){const o=Rl(t,n);a=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(t,a)??yb(t,a)}}i(gb,"renderInlineTag");function yb(e,t){try{return dt.parse(e,!0),`[${t}](${e})`}catch{return e}}i(yb,"renderLinkDefault");var Ld=class{static{i(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` +`)}return t}},vb=class{static{i(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function Dd(e){return e.endsWith(` +`)?` +`:` + +`}i(Dd,"fillNewlines");var Tb=class{static{i(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&wh(t))return bh(t).toMarkdown({renderLink:i((n,a)=>this.documentationLinkRenderer(e,n,a),"renderLink"),renderTag:i(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){const n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){const a=n.nameSegment.range.start.line+1,s=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${a},${s}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){const n=Dt(e).localSymbols;if(!n)return;let a=e;do{const o=n.getStream(a).find(l=>l.name===t);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},Rb=class{static{i(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Ah(e)?e.$comment:Nf(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},$b=class{static{i(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},iF=class{static{i(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){const r=await this.acquireParserWorker(t),n=new Sr;let a;const s=t.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{const l=this.hydrator.hydrate(o);n.resolve(l)}).catch(o=>{n.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),n.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(const r of this.workerPool)if(r.ready)return r.lock(),r;const t=new Sr;return e.onCancellationRequested(()=>{const r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(Zt)}),this.queue.push(t),t.promise}},sF=class{static{i(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new bc.Emitter,this.deferred=new Sr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),r(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Zt),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Sr,this.sendMessage(e),this.deferred.promise}},Ab=class{static{i(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=_c();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=pe.CancellationToken.None){const n=new Sr,a={action:t,deferred:n,cancellationToken:r};return e.push(a),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{const a=await Promise.resolve().then(()=>t(n));r.resolve(a)}catch(a){Jn(a)?r.resolve(void 0):r.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Eb=class{static{i(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new yl,this.tokenTypeIdMap=new yl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const n of Mt(e))t.set(n,{});if(e.$cstNode)for(const n of Fa(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Le(o)?s.push(this.dehydrateAstNode(o,t)):He(o)?s.push(this.dehydrateReference(o,t)):s.push(o)}else Le(a)?r[n]=this.dehydrateAstNode(a,t):He(a)?r[n]=this.dehydrateReference(a,t):a!==void 0&&(r[n]=a);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return _l(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),vr(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):Pn(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const a of Mt(e))t.set(a,{});let n;if(e.$cstNode)for(const a of Fa(e.$cstNode)){let s;"fullText"in a?(s=new sh(a.fullText),n=s):"content"in a?s=new Tc:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(r.set(a,s),s.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Le(o)?s.push(this.setParent(this.hydrateAstNode(o,t),r)):He(o)?s.push(this.hydrateReference(o,r,n,t)):s.push(o)}else Le(a)?r[n]=this.setParent(this.hydrateAstNode(a,t),r):He(a)?r[n]=this.hydrateReference(a,r,n,t):a!==void 0&&(r[n]=a);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),vr(n))for(const a of e.content){const s=this.hydrateCstNode(a,t,r++);n.content.push(s)}return n}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,c=e.hidden;return new fl(r,n,{start:{line:a,character:s},end:{line:o,character:l}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Mt(this.grammar))Cl(t)&&this.grammarElementIdMap.set(t,e++)}};function yt(e){return{documentation:{CommentProvider:i(t=>new Rb(t),"CommentProvider"),DocumentationProvider:i(t=>new Tb(t),"DocumentationProvider")},parser:{AsyncParser:i(t=>new $b(t),"AsyncParser"),GrammarConfig:i(t=>ep(t),"GrammarConfig"),LangiumParser:i(t=>fh(t),"LangiumParser"),CompletionParser:i(t=>dh(t),"CompletionParser"),ValueConverter:i(()=>new hh,"ValueConverter"),TokenBuilder:i(()=>new Ac,"TokenBuilder"),Lexer:i(t=>new Sh(t),"Lexer"),ParserErrorMessageProvider:i(()=>new lh,"ParserErrorMessageProvider"),LexerErrorMessageProvider:i(()=>new lb,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:i(()=>new nb,"AstNodeLocator"),AstNodeDescriptionProvider:i(t=>new tb(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:i(t=>new rb(t),"ReferenceDescriptionProvider")},references:{Linker:i(t=>new BS(t),"Linker"),NameProvider:i(()=>new KS,"NameProvider"),ScopeProvider:i(t=>new YS(t),"ScopeProvider"),ScopeComputation:i(t=>new WS(t),"ScopeComputation"),References:i(t=>new qS(t),"References")},serializer:{Hydrator:i(t=>new Eb(t),"Hydrator"),JsonSerializer:i(t=>new XS(t),"JsonSerializer")},validation:{DocumentValidator:i(t=>new eb(t),"DocumentValidator"),ValidationRegistry:i(t=>new ZS(t),"ValidationRegistry")},shared:i(()=>e.shared,"shared")}}i(yt,"createDefaultCoreModule");function vt(e){return{ServiceRegistry:i(t=>new JS(t),"ServiceRegistry"),workspace:{LangiumDocuments:i(t=>new zS(t),"LangiumDocuments"),LangiumDocumentFactory:i(t=>new US(t),"LangiumDocumentFactory"),DocumentBuilder:i(t=>new ib(t),"DocumentBuilder"),IndexManager:i(t=>new sb(t),"IndexManager"),WorkspaceManager:i(t=>new ob(t),"WorkspaceManager"),FileSystemProvider:i(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:i(()=>new Ab,"WorkspaceLock"),ConfigurationProvider:i(t=>new ab(t),"ConfigurationProvider")},profilers:{}}}i(vt,"createDefaultSharedCoreModule");var Md;(function(e){e.merge=(t,r)=>Ka(Ka({},t),r)})(Md||(Md={}));function Ae(e,t,r,n,a,s,o,l,c){const u=[e,t,r,n,a,s,o,l,c].reduce(Ka,{});return Lh(u)}i(Ae,"inject");var _b=Symbol("isProxy");function Oh(e){if(e&&e[_b])for(const t of Object.values(e))Oh(t);return e}i(Oh,"eagerLoad");function Lh(e,t){const r=new Proxy({},{deleteProperty:i(()=>!1,"deleteProperty"),set:i(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:i((n,a)=>a===_b?!0:xd(n,a,e,t||r),"get"),getOwnPropertyDescriptor:i((n,a)=>(xd(n,a,e,t||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:i((n,a)=>a in e,"has"),ownKeys:i(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}i(Lh,"_inject");var og=Symbol();function xd(e,t,r,n){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===og)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){const a=r[t];e[t]=og;try{e[t]=typeof a=="function"?a(n):Lh(a,n)}catch(s){throw e[t]=s instanceof Error?s:void 0,s}return e[t]}else return}i(xd,"_resolve");function Ka(e,t){if(t){for(const[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){const a=e[r];typeof a=="object"&&a!==null?e[r]=Ka(a,n):e[r]=Ka({},n)}else e[r]=n}return e}i(Ka,"_merge");var Fd={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},_n;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(_n||(_n={}));var Cb=class extends Ac{static{i(this,"IndentationAwareTokenBuilder")}constructor(e=Fd){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...Fd,...e},this.indentTokenType=ka({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ka({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){const r=super.buildTokens(e,t);if(!wc(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,c,u;const d=[];for(const f of r){for(const[h,y]of o)f.name===h?f.PUSH_MODE=_n.IGNORE_INDENTATION:f.name===y&&(f.POP_MODE=!0);f.name===a?l=f:f.name===n?c=f:f.name===s?u=f:d.push(f)}if(!l||!c||!u)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[_n.REGULAR]:[l,c,...d,u],[_n.IGNORE_INDENTATION]:[...d,u]},defaultMode:_n.REGULAR}:[l,c,u,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r +`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:a?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,t,r,n){const a=this.getLineNumber(t,n);return js(e,r,n,n+r.length,a,a,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;const c=this.indentationStack.length-l-1,u=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},oF=class extends Sh{static{i(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof Cb)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=Ch){const r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,c=[],u=r.tokens.length-1;for(let d=0;d=0&&c.push(r.tokens[u]),r.tokens=c,r}},Dh={};Kr(Dh,{AstUtils:()=>nf,BiMap:()=>yl,Cancellation:()=>pe,ContextCache:()=>Sc,CstUtils:()=>ef,DONE_RESULT:()=>Ve,Deferred:()=>Sr,Disposable:()=>Sn,DisposableCache:()=>Cc,DocumentCache:()=>HS,EMPTY_STREAM:()=>Oa,ErrorWithLocation:()=>Pl,GrammarUtils:()=>Lf,MultiMap:()=>br,OperationCancelled:()=>Zt,Reduction:()=>os,RegExpUtils:()=>Mf,SimpleCache:()=>Rh,StreamImpl:()=>Jt,TreeStreamImpl:()=>La,URI:()=>dt,UriTrie:()=>vh,UriUtils:()=>Ye,WorkspaceCache:()=>$h,assertCondition:()=>Df,assertUnreachable:()=>qr,delayNextTick:()=>Ec,interruptAndCheck:()=>Ge,isOperationCancelled:()=>Jn,loadGrammarFromJson:()=>Tt,setInterruptionPeriod:()=>mh,startCancelableOperation:()=>_c,stream:()=>oe});$l(Dh,bc);var Sb=class{static{i(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},It={fileSystemProvider:i(()=>new Sb,"fileSystemProvider")},lF={Grammar:i(()=>{},"Grammar"),LanguageMetaData:i(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},cF={AstReflection:i(()=>new Cf,"AstReflection")};function bb(){const e=Ae(vt(It),cF),t=Ae(yt({shared:e}),lF);return e.ServiceRegistry.register(t),t}i(bb,"createMinimalGrammarServices");function Tt(e){const t=bb(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,dt.parse(`memory:/${r.name??"grammar"}.langium`)),r}i(Tt,"loadGrammarFromJson");$l(Dg,Dh);var uF=class{static{i(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new br}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new wb(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const r=[];for(const s of t.entries.keys()){const o=t.entries.get(s),l=o.reduce((c,u)=>c+u);r.push({name:`${t.identifier}.${s}`,count:o.length,duration:l})}const n=t.duration-r.map(s=>s.duration).reduce((s,o)=>s+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return i(a,"Round"),console.table(r.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/t.duration),"Time (ms)":a(s.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},wb=class{static{i(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new br,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);const r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);const n=r-t.content;this.entries.add(e,n)}},Gd;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(Gd||(Gd={}));var jd;(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(jd||(jd={}));var Ud;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Ud||(Ud={}));var zd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(zd||(zd={}));var Bd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Bd||(Bd={}));var Kd;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Kd||(Kd={}));var qd;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(qd||(qd={}));var Wd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Wd||(Wd={}));var Vd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,STRING2:/"[^"]*"|'[^']*'/}})(Vd||(Vd={}));var Hd;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Hd||(Hd={}));({...Gd.Terminals,...jd.Terminals,...Ud.Terminals,...zd.Terminals,...Bd.Terminals,...Kd.Terminals,...qd.Terminals,...Vd.Terminals,...Wd.Terminals,...Hd.Terminals});var Zs={$type:"Accelerator",name:"name",x:"x",y:"y"},Qs={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},bi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},Uc={$type:"Annotations",x:"x",y:"y"},pr={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function dF(e){return Rt.isInstance(e,pr.$type)}i(dF,"isArchitecture");var eo={$type:"Axis",label:"label",name:"name"},Po={$type:"Branch",name:"name",order:"order"};function fF(e){return Rt.isInstance(e,Po.$type)}i(fF,"isBranch");var lg={$type:"Checkout",branch:"branch"},to={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},zc={$type:"ClassDefStatement",className:"className",styleText:"styleText"},ga={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function pF(e){return Rt.isInstance(e,ga.$type)}i(pF,"isCommit");var ro={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Xr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},no={$type:"Curve",entries:"entries",label:"label",name:"name"},ao={$type:"Deaccelerator",name:"name",x:"x",y:"y"},cg={$type:"Decorator",strategy:"strategy"},sa={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Wt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},oa={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Jr={$type:"EmFrame"},wi={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},ug={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},Bc={$type:"EmModelEntity",name:"name"};function hF(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}i(hF,"isEmModelEntityType");var io={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},hr={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function mF(e){return Rt.isInstance(e,hr.$type)}i(mF,"isEmResetFrame");var Or={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},Kc={$type:"Entry",axis:"axis",value:"value"},ur={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},dg={$type:"Evolution",stages:"stages"},so={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},qc={$type:"Evolve",component:"component",target:"target"},on={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function gF(e){return Rt.isInstance(e,on.$type)}i(gF,"isGitGraph");var Ii={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ki={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function yF(e){return Rt.isInstance(e,Ki.$type)}i(yF,"isInfo");var Ni={$type:"Item",classSelector:"classSelector",name:"name"},Wc={$type:"Junction",id:"id",in:"in"},ki={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},oo={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Zr={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},ya={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function vF(e){return Rt.isInstance(e,ya.$type)}i(vF,"isMerge");var lo={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},Vc={$type:"Option",name:"name",value:"value"},va={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function TF(e){return Rt.isInstance(e,va.$type)}i(TF,"isPacket");var Ta={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function RF(e){return Rt.isInstance(e,Ta.$type)}i(RF,"isPacketBlock");var ln={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function $F(e){return Rt.isInstance(e,ln.$type)}i($F,"isPie");var Oo={$type:"PieSection",label:"label",value:"value"};function AF(e){return Rt.isInstance(e,Oo.$type)}i(AF,"isPieSection");var Hc={$type:"Pipeline",components:"components",parent:"parent"},co={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Qr={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Yc={$type:"Section",classSelector:"classSelector",name:"name"},la={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Xc={$type:"Size",height:"height",width:"width"},ca={$type:"Statement"},Ra={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function EF(e){return Rt.isInstance(e,Ra.$type)}i(EF,"isTreemap");var Jc={$type:"TreemapRow",indent:"indent",item:"item"},Zc={$type:"TreeNode",indent:"indent",name:"name"},Pi={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Ue={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function _F(e){return Rt.isInstance(e,Ue.$type)}i(_F,"isWardley");var Ib=class extends rf{constructor(){super(...arguments),this.types={Accelerator:{name:Zs.$type,properties:{name:{name:Zs.name},x:{name:Zs.x},y:{name:Zs.y}},superTypes:[]},Anchor:{name:Qs.$type,properties:{evolution:{name:Qs.evolution},name:{name:Qs.name},visibility:{name:Qs.visibility}},superTypes:[]},Annotation:{name:bi.$type,properties:{number:{name:bi.number},text:{name:bi.text},x:{name:bi.x},y:{name:bi.y}},superTypes:[]},Annotations:{name:Uc.$type,properties:{x:{name:Uc.x},y:{name:Uc.y}},superTypes:[]},Architecture:{name:pr.$type,properties:{accDescr:{name:pr.accDescr},accTitle:{name:pr.accTitle},edges:{name:pr.edges,defaultValue:[]},groups:{name:pr.groups,defaultValue:[]},junctions:{name:pr.junctions,defaultValue:[]},services:{name:pr.services,defaultValue:[]},title:{name:pr.title}},superTypes:[]},Axis:{name:eo.$type,properties:{label:{name:eo.label},name:{name:eo.name}},superTypes:[]},Branch:{name:Po.$type,properties:{name:{name:Po.name},order:{name:Po.order}},superTypes:[ca.$type]},Checkout:{name:lg.$type,properties:{branch:{name:lg.branch}},superTypes:[ca.$type]},CherryPicking:{name:to.$type,properties:{id:{name:to.id},parent:{name:to.parent},tags:{name:to.tags,defaultValue:[]}},superTypes:[ca.$type]},ClassDefStatement:{name:zc.$type,properties:{className:{name:zc.className},styleText:{name:zc.styleText}},superTypes:[]},Commit:{name:ga.$type,properties:{id:{name:ga.id},message:{name:ga.message},tags:{name:ga.tags,defaultValue:[]},type:{name:ga.type}},superTypes:[ca.$type]},Common:{name:ro.$type,properties:{accDescr:{name:ro.accDescr},accTitle:{name:ro.accTitle},title:{name:ro.title}},superTypes:[]},Component:{name:Xr.$type,properties:{decorator:{name:Xr.decorator},evolution:{name:Xr.evolution},inertia:{name:Xr.inertia,defaultValue:!1},label:{name:Xr.label},name:{name:Xr.name},visibility:{name:Xr.visibility}},superTypes:[]},Curve:{name:no.$type,properties:{entries:{name:no.entries,defaultValue:[]},label:{name:no.label},name:{name:no.name}},superTypes:[]},Deaccelerator:{name:ao.$type,properties:{name:{name:ao.name},x:{name:ao.x},y:{name:ao.y}},superTypes:[]},Decorator:{name:cg.$type,properties:{strategy:{name:cg.strategy}},superTypes:[]},Direction:{name:sa.$type,properties:{accDescr:{name:sa.accDescr},accTitle:{name:sa.accTitle},dir:{name:sa.dir},statements:{name:sa.statements,defaultValue:[]},title:{name:sa.title}},superTypes:[on.$type]},Edge:{name:Wt.$type,properties:{lhsDir:{name:Wt.lhsDir},lhsGroup:{name:Wt.lhsGroup,defaultValue:!1},lhsId:{name:Wt.lhsId},lhsInto:{name:Wt.lhsInto,defaultValue:!1},rhsDir:{name:Wt.rhsDir},rhsGroup:{name:Wt.rhsGroup,defaultValue:!1},rhsId:{name:Wt.rhsId},rhsInto:{name:Wt.rhsInto,defaultValue:!1},title:{name:Wt.title}},superTypes:[]},EmDataEntity:{name:oa.$type,properties:{dataBlockValue:{name:oa.dataBlockValue},dataType:{name:oa.dataType},name:{name:oa.name}},superTypes:[]},EmFrame:{name:Jr.$type,properties:{},superTypes:[]},EmGwt:{name:wi.$type,properties:{givenStatements:{name:wi.givenStatements,defaultValue:[]},sourceFrame:{name:wi.sourceFrame,referenceType:Jr.$type},thenStatements:{name:wi.thenStatements,defaultValue:[]},whenStatements:{name:wi.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:ug.$type,properties:{entityIdentifier:{name:ug.entityIdentifier,referenceType:Bc.$type}},superTypes:[]},EmModelEntity:{name:Bc.$type,properties:{name:{name:Bc.name}},superTypes:[]},EmNoteEntity:{name:io.$type,properties:{dataBlockValue:{name:io.dataBlockValue},dataType:{name:io.dataType},sourceFrame:{name:io.sourceFrame,referenceType:Jr.$type}},superTypes:[]},EmResetFrame:{name:hr.$type,properties:{dataInlineValue:{name:hr.dataInlineValue},dataReference:{name:hr.dataReference,referenceType:oa.$type},dataType:{name:hr.dataType},entityIdentifier:{name:hr.entityIdentifier},modelEntityType:{name:hr.modelEntityType},name:{name:hr.name},sourceFrames:{name:hr.sourceFrames,defaultValue:[],referenceType:Jr.$type}},superTypes:[Jr.$type]},EmTimeFrame:{name:Or.$type,properties:{dataInlineValue:{name:Or.dataInlineValue},dataReference:{name:Or.dataReference,referenceType:oa.$type},dataType:{name:Or.dataType},entityIdentifier:{name:Or.entityIdentifier},modelEntityType:{name:Or.modelEntityType},name:{name:Or.name},sourceFrames:{name:Or.sourceFrames,defaultValue:[],referenceType:Jr.$type}},superTypes:[Jr.$type]},Entry:{name:Kc.$type,properties:{axis:{name:Kc.axis,referenceType:eo.$type},value:{name:Kc.value}},superTypes:[]},EventModel:{name:ur.$type,properties:{accDescr:{name:ur.accDescr},accTitle:{name:ur.accTitle},dataEntities:{name:ur.dataEntities,defaultValue:[]},frames:{name:ur.frames,defaultValue:[]},gwtEntities:{name:ur.gwtEntities,defaultValue:[]},modelEntities:{name:ur.modelEntities,defaultValue:[]},noteEntities:{name:ur.noteEntities,defaultValue:[]},title:{name:ur.title}},superTypes:[]},Evolution:{name:dg.$type,properties:{stages:{name:dg.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:so.$type,properties:{boundary:{name:so.boundary},name:{name:so.name},secondName:{name:so.secondName}},superTypes:[]},Evolve:{name:qc.$type,properties:{component:{name:qc.component},target:{name:qc.target}},superTypes:[]},GitGraph:{name:on.$type,properties:{accDescr:{name:on.accDescr},accTitle:{name:on.accTitle},statements:{name:on.statements,defaultValue:[]},title:{name:on.title}},superTypes:[]},Group:{name:Ii.$type,properties:{icon:{name:Ii.icon},id:{name:Ii.id},in:{name:Ii.in},title:{name:Ii.title}},superTypes:[]},Info:{name:Ki.$type,properties:{accDescr:{name:Ki.accDescr},accTitle:{name:Ki.accTitle},title:{name:Ki.title}},superTypes:[]},Item:{name:Ni.$type,properties:{classSelector:{name:Ni.classSelector},name:{name:Ni.name}},superTypes:[]},Junction:{name:Wc.$type,properties:{id:{name:Wc.id},in:{name:Wc.in}},superTypes:[]},Label:{name:ki.$type,properties:{negX:{name:ki.negX,defaultValue:!1},negY:{name:ki.negY,defaultValue:!1},offsetX:{name:ki.offsetX},offsetY:{name:ki.offsetY}},superTypes:[]},Leaf:{name:oo.$type,properties:{classSelector:{name:oo.classSelector},name:{name:oo.name},value:{name:oo.value}},superTypes:[Ni.$type]},Link:{name:Zr.$type,properties:{arrow:{name:Zr.arrow},from:{name:Zr.from},fromPort:{name:Zr.fromPort},linkLabel:{name:Zr.linkLabel},to:{name:Zr.to},toPort:{name:Zr.toPort}},superTypes:[]},Merge:{name:ya.$type,properties:{branch:{name:ya.branch},id:{name:ya.id},tags:{name:ya.tags,defaultValue:[]},type:{name:ya.type}},superTypes:[ca.$type]},Note:{name:lo.$type,properties:{evolution:{name:lo.evolution},text:{name:lo.text},visibility:{name:lo.visibility}},superTypes:[]},Option:{name:Vc.$type,properties:{name:{name:Vc.name},value:{name:Vc.value,defaultValue:!1}},superTypes:[]},Packet:{name:va.$type,properties:{accDescr:{name:va.accDescr},accTitle:{name:va.accTitle},blocks:{name:va.blocks,defaultValue:[]},title:{name:va.title}},superTypes:[]},PacketBlock:{name:Ta.$type,properties:{bits:{name:Ta.bits},end:{name:Ta.end},label:{name:Ta.label},start:{name:Ta.start}},superTypes:[]},Pie:{name:ln.$type,properties:{accDescr:{name:ln.accDescr},accTitle:{name:ln.accTitle},sections:{name:ln.sections,defaultValue:[]},showData:{name:ln.showData,defaultValue:!1},title:{name:ln.title}},superTypes:[]},PieSection:{name:Oo.$type,properties:{label:{name:Oo.label},value:{name:Oo.value}},superTypes:[]},Pipeline:{name:Hc.$type,properties:{components:{name:Hc.components,defaultValue:[]},parent:{name:Hc.parent}},superTypes:[]},PipelineComponent:{name:co.$type,properties:{evolution:{name:co.evolution},label:{name:co.label},name:{name:co.name}},superTypes:[]},Radar:{name:Qr.$type,properties:{accDescr:{name:Qr.accDescr},accTitle:{name:Qr.accTitle},axes:{name:Qr.axes,defaultValue:[]},curves:{name:Qr.curves,defaultValue:[]},options:{name:Qr.options,defaultValue:[]},title:{name:Qr.title}},superTypes:[]},Section:{name:Yc.$type,properties:{classSelector:{name:Yc.classSelector},name:{name:Yc.name}},superTypes:[Ni.$type]},Service:{name:la.$type,properties:{icon:{name:la.icon},iconText:{name:la.iconText},id:{name:la.id},in:{name:la.in},title:{name:la.title}},superTypes:[]},Size:{name:Xc.$type,properties:{height:{name:Xc.height},width:{name:Xc.width}},superTypes:[]},Statement:{name:ca.$type,properties:{},superTypes:[]},TreeNode:{name:Zc.$type,properties:{indent:{name:Zc.indent},name:{name:Zc.name}},superTypes:[]},TreeView:{name:Pi.$type,properties:{accDescr:{name:Pi.accDescr},accTitle:{name:Pi.accTitle},nodes:{name:Pi.nodes,defaultValue:[]},title:{name:Pi.title}},superTypes:[]},Treemap:{name:Ra.$type,properties:{accDescr:{name:Ra.accDescr},accTitle:{name:Ra.accTitle},title:{name:Ra.title},TreemapRows:{name:Ra.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Jc.$type,properties:{indent:{name:Jc.indent},item:{name:Jc.item}},superTypes:[]},Wardley:{name:Ue.$type,properties:{accDescr:{name:Ue.accDescr},accelerators:{name:Ue.accelerators,defaultValue:[]},accTitle:{name:Ue.accTitle},anchors:{name:Ue.anchors,defaultValue:[]},annotation:{name:Ue.annotation,defaultValue:[]},annotations:{name:Ue.annotations,defaultValue:[]},components:{name:Ue.components,defaultValue:[]},deaccelerators:{name:Ue.deaccelerators,defaultValue:[]},evolution:{name:Ue.evolution},evolves:{name:Ue.evolves,defaultValue:[]},links:{name:Ue.links,defaultValue:[]},notes:{name:Ue.notes,defaultValue:[]},pipelines:{name:Ue.pipelines,defaultValue:[]},size:{name:Ue.size},title:{name:Ue.title}},superTypes:[]}}}static{i(this,"MermaidAstReflection")}},Rt=new Ib,fg,CF=i(()=>fg??(fg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),pg,SF=i(()=>pg??(pg=Tt('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),hg,bF=i(()=>hg??(hg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),mg,wF=i(()=>mg??(mg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),gg,IF=i(()=>gg??(gg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),yg,NF=i(()=>yg??(yg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),vg,kF=i(()=>vg??(vg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Tg,PF=i(()=>Tg??(Tg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Rg,OF=i(()=>Rg??(Rg=Tt(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n * Converted from treemap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),$g,LF=i(()=>$g??($g=Tt(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),DF={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},MF={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xF={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},FF={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},GF={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jF={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},UF={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zF={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BF={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},KF={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sr={AstReflection:i(()=>new Ib,"AstReflection")},qF={Grammar:i(()=>CF(),"Grammar"),LanguageMetaData:i(()=>DF,"LanguageMetaData"),parser:{}},WF={Grammar:i(()=>SF(),"Grammar"),LanguageMetaData:i(()=>MF,"LanguageMetaData"),parser:{}},VF={Grammar:i(()=>bF(),"Grammar"),LanguageMetaData:i(()=>xF,"LanguageMetaData"),parser:{}},HF={Grammar:i(()=>wF(),"Grammar"),LanguageMetaData:i(()=>FF,"LanguageMetaData"),parser:{}},YF={Grammar:i(()=>IF(),"Grammar"),LanguageMetaData:i(()=>GF,"LanguageMetaData"),parser:{}},XF={Grammar:i(()=>NF(),"Grammar"),LanguageMetaData:i(()=>jF,"LanguageMetaData"),parser:{}},JF={Grammar:i(()=>kF(),"Grammar"),LanguageMetaData:i(()=>UF,"LanguageMetaData"),parser:{}},ZF={Grammar:i(()=>PF(),"Grammar"),LanguageMetaData:i(()=>zF,"LanguageMetaData"),parser:{}},QF={Grammar:i(()=>OF(),"Grammar"),LanguageMetaData:i(()=>BF,"LanguageMetaData"),parser:{}},eG={Grammar:i(()=>LF(),"Grammar"),LanguageMetaData:i(()=>KF,"LanguageMetaData"),parser:{}},tG=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,rG=/accTitle[\t ]*:([^\n\r]*)/,nG=/title([\t ][^\n\r]*|)/,aG={ACC_DESCR:tG,ACC_TITLE:rG,TITLE:nG},ti=class extends hh{static{i(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){const n=aG[e.name];if(n===void 0)return;const a=n.exec(t);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},Ks=class extends ti{static{i(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},or=class extends Ac{static{i(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const n=super.buildKeywordTokens(e,t,r);return n.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends or{static{i(this,"CommonTokenBuilder")}});/*! Bundled license information: + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var iG=class extends or{static{i(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Nb={parser:{TokenBuilder:i(()=>new iG,"TokenBuilder"),ValueConverter:i(()=>new Ks,"ValueConverter")}};function kb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),JF,Nb);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}i(kb,"createRadarServices");var sG=class extends or{static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},oG=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,lG=class extends ti{static{i(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;const n=oG.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function Pb(e){const t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){const n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}i(Pb,"registerValidationChecks");var cG=class{static{i(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(const n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},Ob={parser:{TokenBuilder:i(()=>new sG,"TokenBuilder"),ValueConverter:i(()=>new lG,"ValueConverter")},validation:{TreemapValidator:i(()=>new cG,"TreemapValidator")}};function Lb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),ZF,Ob);return t.ServiceRegistry.register(r),Pb(r),{shared:t,Treemap:r}}i(Lb,"createTreemapServices");var uG=class extends ti{static{i(this,"WardleyValueConverter")}runCustomConverter(e,t,r){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return}}},Db={parser:{ValueConverter:i(()=>new uG,"ValueConverter")}};function Mb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),eG,Db);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}i(Mb,"createWardleyServices");var dG=class extends or{static{i(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},xb={parser:{TokenBuilder:i(()=>new dG,"TokenBuilder"),ValueConverter:i(()=>new Ks,"ValueConverter")}};function Fb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),VF,xb);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}i(Fb,"createGitGraphServices");var fG=class extends or{static{i(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Gb={parser:{TokenBuilder:i(()=>new fG,"TokenBuilder"),ValueConverter:i(()=>new Ks,"ValueConverter")}};function jb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),HF,Gb);return t.ServiceRegistry.register(r),{shared:t,Info:r}}i(jb,"createInfoServices");var pG=class extends or{static{i(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},Ub={parser:{TokenBuilder:i(()=>new pG,"TokenBuilder"),ValueConverter:i(()=>new Ks,"ValueConverter")}};function zb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),YF,Ub);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}i(zb,"createPacketServices");var hG=class extends or{static{i(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},mG=class extends ti{static{i(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},Bb={parser:{TokenBuilder:i(()=>new hG,"TokenBuilder"),ValueConverter:i(()=>new mG,"ValueConverter")}};function Kb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),XF,Bb);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}i(Kb,"createPieServices");var gG=class extends ti{static{i(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="STRING2")return t.substring(1,t.length-1)}},yG=class extends or{static{i(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},qb={parser:{TokenBuilder:i(()=>new yG,"TokenBuilder"),ValueConverter:i(()=>new gG,"ValueConverter")}};function Wb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),QF,qb);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}i(Wb,"createTreeViewServices");var vG=class extends or{static{i(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},TG=class extends ti{static{i(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},Vb={parser:{TokenBuilder:i(()=>new vG,"TokenBuilder"),ValueConverter:i(()=>new TG,"ValueConverter")}};function Hb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),qF,Vb);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}i(Hb,"createArchitectureServices");var RG=class extends or{static{i(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},Ag=new Set(["cmd","command"]),Eg=new Set(["evt","event"]),Qc=new Set(["rmo","readmodel"]),_g=new Set(["pcr","processor"]),Cg=new Set(["ui"]);function Yb(e){const t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){const n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}i(Yb,"registerValidationChecks");var $G=class{static{i(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(Ag.has(e.modelEntityType)?this.validateSources(e,new Set([...Cg,..._g]),"command","ui or processor",t):Eg.has(e.modelEntityType)?this.validateSources(e,Ag,"event","command",t):Qc.has(e.modelEntityType)?this.validateSources(e,Eg,"read model","event",t):_g.has(e.modelEntityType)?this.validateSources(e,Qc,"processor","read model",t):Cg.has(e.modelEntityType)&&this.validateSources(e,Qc,"ui","read model",t))}validateSources(e,t,r,n,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!t.has(o.modelEntityType)&&a("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},Xb={parser:{TokenBuilder:i(()=>new RG,"TokenBuilder"),ValueConverter:i(()=>new Ks,"ValueConverter")},validation:{EventModelingValidator:i(()=>new $G,"EventModelingValidator")}};function Jb(e=It){const t=Ae(vt(e),sr),r=Ae(yt({shared:t}),WF,Xb);return t.ServiceRegistry.register(r),Yb(r),{shared:t,EventModel:r}}i(Jb,"createEventModelingServices");var At={},AG={info:i(async()=>{const{createInfoServices:e}=await qt(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>CG);return{createInfoServices:r}},void 0),t=e().Info.parser.LangiumParser;At.info=t},"info"),packet:i(async()=>{const{createPacketServices:e}=await qt(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>SG);return{createPacketServices:r}},void 0),t=e().Packet.parser.LangiumParser;At.packet=t},"packet"),pie:i(async()=>{const{createPieServices:e}=await qt(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>bG);return{createPieServices:r}},void 0),t=e().Pie.parser.LangiumParser;At.pie=t},"pie"),treeView:i(async()=>{const{createTreeViewServices:e}=await qt(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>wG);return{createTreeViewServices:r}},void 0),t=e().TreeView.parser.LangiumParser;At.treeView=t},"treeView"),architecture:i(async()=>{const{createArchitectureServices:e}=await qt(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>IG);return{createArchitectureServices:r}},void 0),t=e().Architecture.parser.LangiumParser;At.architecture=t},"architecture"),gitGraph:i(async()=>{const{createGitGraphServices:e}=await qt(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>NG);return{createGitGraphServices:r}},void 0),t=e().GitGraph.parser.LangiumParser;At.gitGraph=t},"gitGraph"),eventmodeling:i(async()=>{const{createEventModelingServices:e}=await qt(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>kG);return{createEventModelingServices:r}},void 0),t=e().EventModel.parser.LangiumParser;At.eventmodeling=t},"eventmodeling"),radar:i(async()=>{const{createRadarServices:e}=await qt(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>PG);return{createRadarServices:r}},void 0),t=e().Radar.parser.LangiumParser;At.radar=t},"radar"),treemap:i(async()=>{const{createTreemapServices:e}=await qt(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>OG);return{createTreemapServices:r}},void 0),t=e().Treemap.parser.LangiumParser;At.treemap=t},"treemap"),wardley:i(async()=>{const{createWardleyServices:e}=await qt(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>LG);return{createWardleyServices:r}},void 0),t=e().Wardley.parser.LangiumParser;At.wardley=t},"wardley")};async function EG(e,t){const r=AG[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);At[e]||await r();const a=At[e].parse(t);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new _G(a);return a.value}i(EG,"parse");var _G=class extends Error{constructor(e){const t=e.lexerErrors.map(n=>{const a=n.line!==void 0&&!isNaN(n.line)?n.line:"?",s=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${a}, column ${s}: ${n.message}`}).join(` +`),r=e.parserErrors.map(n=>{const a=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",s=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${n.message}`}).join(` +`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{i(this,"MermaidParseError")}};const CG=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Gb,createInfoServices:jb},Symbol.toStringTag,{value:"Module"})),SG=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:Ub,createPacketServices:zb},Symbol.toStringTag,{value:"Module"})),bG=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Bb,createPieServices:Kb},Symbol.toStringTag,{value:"Module"})),wG=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:qb,createTreeViewServices:Wb},Symbol.toStringTag,{value:"Module"})),IG=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Vb,createArchitectureServices:Hb},Symbol.toStringTag,{value:"Module"})),NG=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:xb,createGitGraphServices:Fb},Symbol.toStringTag,{value:"Module"})),kG=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Xb,createEventModelingServices:Jb},Symbol.toStringTag,{value:"Module"})),PG=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Nb,createRadarServices:kb},Symbol.toStringTag,{value:"Module"})),OG=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Ob,createTreemapServices:Lb},Symbol.toStringTag,{value:"Module"})),LG=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Db,createWardleyServices:Mb},Symbol.toStringTag,{value:"Module"}));export{mF as i,EG as p}; diff --git a/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-CnvLrs5Q.js b/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-CnvLrs5Q.js new file mode 100644 index 0000000000..63d3d7bb9f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-CnvLrs5Q.js @@ -0,0 +1,78 @@ +import{s as St,g as Mt,q as Nt,p as zt,a as Lt,b as Tt,_ as u,K as At,D as Xt,F as K,l as J,I as Et,e as Yt,z as It,c as j}from"./mermaid.core-zKrc8Ye9.js";import{p as Ft}from"./chunk-4BX2VUAB-Bjjry6OZ.js";import{p as Bt}from"./wardley-L42UT6IY-gSV1j6uw.js";import"./index-DtRfJ0vw.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"),U=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(Ft(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,B=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,B,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=U(r.fromPort)??U(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 Bt("wardley",e);J.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(),It()}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:Tt,getAccTitle:Lt,setDiagramTitle:zt,getDiagramTitle:Nt,getAccDescription:Mt,setAccDescription:St},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)=>{J.debug(`Rendering Wardley map +`+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),B=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Et(n);E.selectAll("*").remove(),Yt(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;B&&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(B);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 F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}F.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} + L ${o+p-f} ${i-l/2-8} + L ${o+p} ${i} + L ${o+p-f} ${i+l/2+8} + L ${o+p-f} ${i+l/2} + L ${o} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` + M ${o+p} ${i-l/2} + L ${o+f} ${i-l/2} + L ${o+f} ${i-l/2-8} + L ${o} ${i} + L ${o+f} ${i+l/2+8} + L ${o+f} ${i+l/2} + L ${o+p} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),Vt={draw:jt},_t=u(({wardley:e}={})=>{const n=At(),r=Xt(),x=K(n,r.themeVariables),a=K(x.wardley,e);return` + .wardley-background { + fill: ${a.backgroundColor}; + } + .wardley-axes line, .wardley-axes path { + stroke: ${a.axisColor}; + } + .wardley-axis-label { + fill: ${a.axisTextColor}; + } + .wardley-stage-label { + fill: ${a.axisTextColor}; + } + .wardley-grid line { + stroke: ${a.gridColor}; + } + .wardley-node circle { + fill: ${a.componentFill}; + stroke: ${a.componentStroke}; + } + .wardley-node-label { + fill: ${a.componentLabelColor}; + } + .wardley-link { + stroke: ${a.linkStroke}; + } + .wardley-link--dashed { + stroke-dasharray: 4 4; + } + .wardley-link-label { + fill: ${a.axisTextColor}; + } + .wardley-trend line { + stroke: ${a.evolutionStroke}; + } + .wardley-annotation-line { + stroke: ${a.annotationStroke}; + } + .wardley-annotation circle { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotation text { + fill: ${a.annotationTextColor}; + } + .wardley-annotations-box rect { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotations-box text { + fill: ${a.annotationTextColor}; + } + .wardley-pipeline-box { + stroke: ${a.componentStroke}; + } + .wardley-notes text { + fill: ${a.axisTextColor}; + } + `},"styles"),te={parser:Q,db:Dt,renderer:Vt,styles:_t};export{te as diagram}; diff --git a/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js b/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js new file mode 100644 index 0000000000..0f2e7f736c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js @@ -0,0 +1,78 @@ +import{s as St,g as Mt,q as Nt,p as zt,a as Lt,b as Tt,_ as u,K as At,D as Xt,F as K,l as J,I as Et,e as Yt,z as It,c as j}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as Ft}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as Bt}from"./wardley-L42UT6IY-BJFn8eDD.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"),U=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(Ft(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,B=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,B,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=U(r.fromPort)??U(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 Bt("wardley",e);J.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(),It()}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:Tt,getAccTitle:Lt,setDiagramTitle:zt,getDiagramTitle:Nt,getAccDescription:Mt,setAccDescription:St},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)=>{J.debug(`Rendering Wardley map +`+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),B=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Et(n);E.selectAll("*").remove(),Yt(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;B&&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(B);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 F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}F.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} + L ${o+p-f} ${i-l/2-8} + L ${o+p} ${i} + L ${o+p-f} ${i+l/2+8} + L ${o+p-f} ${i+l/2} + L ${o} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` + M ${o+p} ${i-l/2} + L ${o+f} ${i-l/2} + L ${o+f} ${i-l/2-8} + L ${o} ${i} + L ${o+f} ${i+l/2+8} + L ${o+f} ${i+l/2} + L ${o+p} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),Vt={draw:jt},_t=u(({wardley:e}={})=>{const n=At(),r=Xt(),x=K(n,r.themeVariables),a=K(x.wardley,e);return` + .wardley-background { + fill: ${a.backgroundColor}; + } + .wardley-axes line, .wardley-axes path { + stroke: ${a.axisColor}; + } + .wardley-axis-label { + fill: ${a.axisTextColor}; + } + .wardley-stage-label { + fill: ${a.axisTextColor}; + } + .wardley-grid line { + stroke: ${a.gridColor}; + } + .wardley-node circle { + fill: ${a.componentFill}; + stroke: ${a.componentStroke}; + } + .wardley-node-label { + fill: ${a.componentLabelColor}; + } + .wardley-link { + stroke: ${a.linkStroke}; + } + .wardley-link--dashed { + stroke-dasharray: 4 4; + } + .wardley-link-label { + fill: ${a.axisTextColor}; + } + .wardley-trend line { + stroke: ${a.evolutionStroke}; + } + .wardley-annotation-line { + stroke: ${a.annotationStroke}; + } + .wardley-annotation circle { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotation text { + fill: ${a.annotationTextColor}; + } + .wardley-annotations-box rect { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotations-box text { + fill: ${a.annotationTextColor}; + } + .wardley-pipeline-box { + stroke: ${a.componentStroke}; + } + .wardley-notes text { + fill: ${a.axisTextColor}; + } + `},"styles"),Qt={parser:Q,db:Dt,renderer:Vt,styles:_t};export{Qt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js b/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js new file mode 100644 index 0000000000..4820f611a2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js @@ -0,0 +1,7 @@ +import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,e as hi,z as li,D as dt,i as ci,F as It,G as ui,K as gi,am as xi,R as Tt}from"./mermaidParser.worker-Dx4jPi9z.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-3mB6q2-g.js";import"./defaultLocale-CCNgq9ws.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(n);++s"u"&&(T.yylloc={});var rt=T.yylloc;r.push(rt);var ti=T.options&&T.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(B){u.length=u.length-2*B,w.length=w.length-B,r.length=r.length-B}a(ii,"popStack");function kt(){var B;return B=x.pop()||T.lex()||_t,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=l.symbols_[B]||B),B}a(kt,"lex");for(var M,q,z,ot,G={},it,N,Rt,et;;){if(q=u[u.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=kt()),z=Q[q]&&Q[q][M]),typeof z>"u"||!z.length||!z[0]){var ht="";et=[];for(it in Q[q])this.terminals_[it]&&it>Zt&&et.push("'"+this.terminals_[it]+"'");T.showPosition?ht="Parse error on line "+(tt+1)+`: +`+T.showPosition()+` +Expecting `+et.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ht="Parse error on line "+(tt+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ht,{text:T.match,token:this.terminals_[M]||M,line:T.yylineno,loc:rt,expected:et})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+M);switch(z[0]){case 1:u.push(M),w.push(T.yytext),r.push(T.yylloc),u.push(z[1]),M=null,St=T.yyleng,d=T.yytext,tt=T.yylineno,rt=T.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=w[w.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ti&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),ot=this.performAction.apply(G,[d,St,tt,$.yy,z[1],w,r].concat(Jt)),typeof ot<"u")return ot;N&&(u=u.slice(0,-1*N*2),w=w.slice(0,-1*N),r=r.slice(0,-1*N)),u.push(this.productions_[z[1]][0]),w.push(G.$),r.push(G._$),Rt=Q[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},_=(function(){var F={EOF:1,parseError:a(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:a(function(o,l){return this.yy=l||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:a(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.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),o},"input"),unput:a(function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=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 w=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===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(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:a(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:a(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:a(function(o,l){var u,x,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),x=o[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var r in w)this[r]=w[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,u,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),r=0;rl[0].length)){if(l=u,x=r,this.options.backtrack_lexer){if(o=this.test_match(u,w[r]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,w[x]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var l=this.next();return l||this.lex()},"lex"),begin:a(function(l){this.conditionStack.push(l)},"begin"),popState:a(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:a(function(l){this.begin(l)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(l,u,x,w){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();V.lexer=_;function H(){this.yy={}}return a(H,"Parser"),H.prototype=V,V.Parser=H,new H})();ct.parser=ct;var mi=ct;function ut(t){return t.type==="bar"}a(ut,"isBarPlot");function ft(t){return t.type==="band"}a(ft,"isBandAxisData");function j(t){return t.type==="linear"}a(j,"isLinearAxisData");var Mt=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((n,g)=>Math.max(g.length,n),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const g=xi(s,1,n),c=g?g.width:n.length*i,p=g?g.height:i;e.width=Math.max(e.width,c),e.height=Math.max(e.height,p)}return s.remove(),e}},vt=.7,Pt=.2,Vt=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{a(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){vt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(vt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+this.axisConfig.labelPadding*2;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},yi=class extends Vt{static{a(this,"BandAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=lt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=lt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Et.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},bi=class extends Vt{static{a(this,"LinearAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=Dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function gt(t,i,e,s){const n=new Mt(s);return ft(t)?new yi(i,e,t.categories,t.title,n):new bi(i,e,[t.min,t.max],t.title,n)}a(gt,"getAxis");var Ai=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{a(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Bt(t,i,e,s){const n=new Mt(s);return new Ai(n,t,i,e)}a(Bt,"getChartTitleComponent");var wi=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}static{a(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=Tt().y(e=>e[0]).x(e=>e[1])(t):i=Tt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Ci=class{constructor(t,i,e,s,n,g){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=g}static{a(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:e,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:e,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Si=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{a(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new wi(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Ci(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}return t}};function Wt(t,i,e){return new Si(t,i,e)}a(Wt,"getPlotComponent");var _i=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Bt(t,i,e,s),plot:Wt(t,i,e),xAxis:gt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:gt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{a(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:n,height:g});t-=c.width,i-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=c.height,i-=c.height,this.componentStore.xAxis.setAxisPosition("bottom"),c=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=c.height,this.componentStore.yAxis.setAxisPosition("left"),c=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=c.width,t-=c.width,t>0&&(n+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:g}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+g}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(p=>ut(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:c});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=p.width,s=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=p.height,n=e+p.height,t>0&&(g+=t,t=0),i>0&&(c+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+c]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(k=>ut(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},ki=class{static{a(this,"XYChartBuilder")}static build(t,i,e,s){return new _i(t,i,e,s).getDrawableElement()}},K=0,zt,Z=yt(),J=mt(),b=bt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1;function mt(){const t=gi(),i=dt();return It(t.xyChart,i.themeVariables.xyChart)}a(mt,"getChartDefaultThemeConfig");function yt(){const t=dt();return It(ui.xyChart,t.xyChart)}a(yt,"getChartDefaultConfig");function bt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(bt,"getChartDefaultData");function nt(t){const i=dt();return ci(t.trim(),i)}a(nt,"textSanitizer");function Ot(t){zt=t}a(Ot,"setTmpSVGG");function Ft(t){t==="horizontal"?Z.chartOrientation="horizontal":Z.chartOrientation="vertical"}a(Ft,"setOrientation");function Xt(t){b.xAxis.title=nt(t.text)}a(Xt,"setXAxisTitle");function At(t,i){b.xAxis={type:"linear",title:b.xAxis.title,min:t,max:i},st=!0}a(At,"setXAxisRangeData");function Yt(t){b.xAxis={type:"band",title:b.xAxis.title,categories:t.map(i=>nt(i.text))},st=!0}a(Yt,"setXAxisBand");function Nt(t){b.yAxis.title=nt(t.text)}a(Nt,"setYAxisTitle");function Ht(t,i){b.yAxis={type:"linear",title:b.yAxis.title,min:t,max:i},pt=!0}a(Ht,"setYAxisRangeData");function Ut(t){const i=Math.min(...t),e=Math.max(...t),s=j(b.yAxis)?b.yAxis.min:1/0,n=j(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}a(Ut,"setYAxisRangeFromPlotData");function wt(t){let i=[];if(t.length===0)return i;if(!st){const e=j(b.xAxis)?b.xAxis.min:1/0,s=j(b.xAxis)?b.xAxis.max:-1/0;At(Math.min(e,1),Math.max(s,t.length))}if(pt||Ut(t),ft(b.xAxis)&&(i=b.xAxis.categories.map((e,s)=>[e,t[s]])),j(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,n=(s-e)/(t.length-1),g=[];for(let c=e;c<=s;c+=n)g.push(`${c}`);i=g.map((c,p)=>[c,t[p]])}return i}a(wt,"transformDataWithoutCategory");function Ct(t){return xt[t===0?0:t%xt.length]}a(Ct,"getPlotColorFromPalette");function $t(t,i){const e=wt(i);b.plots.push({type:"line",strokeFill:Ct(K),strokeWidth:2,data:e}),K++}a($t,"setLineData");function qt(t,i){const e=wt(i);b.plots.push({type:"bar",fill:Ct(K),data:e}),K++}a(qt,"setBarData");function Gt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=Lt(),ki.build(Z,b,J,zt)}a(Gt,"getDrawableElem");function jt(){return J}a(jt,"getChartThemeConfig");function Qt(){return Z}a(Qt,"getChartConfig");function Kt(){return b}a(Kt,"getXYChartData");var Ri=a(function(){li(),K=0,Z=yt(),b=bt(),J=mt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1},"clear"),Ti={getDrawableElem:Gt,clear:Ri,setAccTitle:ri,getAccTitle:ai,setDiagramTitle:ni,getDiagramTitle:Lt,getAccDescription:si,setAccDescription:ei,setOrientation:Ft,setXAxisTitle:Xt,setXAxisRangeData:At,setXAxisBand:Yt,setYAxisTitle:Nt,setYAxisRangeData:Ht,setLineData:$t,setBarData:qt,setTmpSVGG:Ot,getChartThemeConfig:jt,getChartConfig:Qt,getXYChartData:Kt},Di=a((t,i,e,s)=>{const n=s.db,g=n.getChartThemeConfig(),c=n.getChartConfig(),p=n.getXYChartData().plots[0].data.map(f=>f[1]);function k(f){return f==="top"?"text-before-edge":"middle"}a(k,"getDominantBaseLine");function v(f){return f==="left"?"start":f==="right"?"end":"middle"}a(v,"getTextAnchor");function P(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}a(P,"getTextTransformation"),Et.debug(`Rendering xychart chart +`+t);const S=oi(i),m=S.append("g").attr("class","main"),E=m.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");hi(S,c.height,c.width,!0),S.attr("viewBox",`0 0 ${c.width} ${c.height}`),E.attr("fill",g.backgroundColor),n.setTmpSVGG(S.append("g").attr("class","mermaid-tmp-group"));const D=n.getDrawableElem(),L={};function I(f){let R=m,h="";for(const[W]of f.entries()){let O=m;W>0&&L[h]&&(O=L[h]),h+=f[W],R=L[h],R||(R=L[h]=O.append("g").attr("class",f[W]))}return R}a(I,"getGroup");for(const f of D){if(f.data.length===0)continue;const R=I(f.groupTexts);switch(f.type){case"rect":if(R.selectAll("rect").data(f.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),c.showDataLabel){const h=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let W=function(A,V){const{data:_,label:H}=A;return V*H.length*O<=_.width-X};a(W,"fitsHorizontally");const O=.7,X=10,Y=f.data.map((A,V)=>({data:A,label:p[V].toString()})).filter(A=>A.data.width>0&&A.data.height>0),C=Y.map(A=>{const{data:V}=A;let _=V.height*.7;for(;!W(A,_)&&_>0;)_-=1;return _}),U=Math.floor(Math.min(...C)),y=a(A=>h?A.data.x+A.data.width+X:A.data.x+A.data.width-X,"determineLabelXPosition");R.selectAll("text").data(Y).enter().append("text").attr("x",y).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",g.dataLabelColor).attr("font-size",`${U}px`).text(A=>A.label)}else{let W=function(y,A,V){const{data:_,label:H}=y,o=A*H.length*.7,l=_.x+_.width/2,u=l-o/2,x=l+o/2,w=u>=_.x&&x<=_.x+_.width,r=_.y+V+A<=_.y+_.height;return w&&r};a(W,"fitsInBar");const O=10,X=f.data.map((y,A)=>({data:y,label:p[A].toString()})).filter(y=>y.data.width>0&&y.data.height>0),Y=X.map(y=>{const{data:A,label:V}=y;let _=A.width/(V.length*.7);for(;!W(y,_,O)&&_>0;)_-=1;return _}),C=Math.floor(Math.min(...Y)),U=a(y=>h?y.data.y-O:y.data.y+O,"determineLabelYPosition");R.selectAll("text").data(X).enter().append("text").attr("x",y=>y.data.x+y.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",g.dataLabelColor).attr("font-size",`${C}px`).text(y=>y.label)}}break;case"text":R.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>k(h.verticalPos)).attr("text-anchor",h=>v(h.horizontalPos)).attr("transform",h=>P(h)).text(h=>h.text);break;case"path":R.selectAll("path").data(f.data).enter().append("path").attr("d",h=>h.path).attr("fill",h=>h.fill?h.fill:"none").attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth);break}}},"draw"),vi={draw:Di},Vi={parser:mi,db:Ti,renderer:vi};export{Vi as diagram}; diff --git a/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-zsCch4aR.js b/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-zsCch4aR.js new file mode 100644 index 0000000000..1bf4c97546 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/xychartDiagram-2RQKCTM6-zsCch4aR.js @@ -0,0 +1,7 @@ +import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,e as hi,z as li,D as dt,i as ci,F as It,G as ui,K as gi,am as xi,a9 as Tt}from"./mermaid.core-zKrc8Ye9.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-JZGc9yht.js";import"./index-DtRfJ0vw.js";import"./defaultLocale-DX6XiGOO.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(n);++s"u"&&(T.yylloc={});var rt=T.yylloc;r.push(rt);var ti=T.options&&T.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(B){u.length=u.length-2*B,w.length=w.length-B,r.length=r.length-B}a(ii,"popStack");function kt(){var B;return B=x.pop()||T.lex()||_t,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=l.symbols_[B]||B),B}a(kt,"lex");for(var M,q,z,ot,G={},it,N,Rt,et;;){if(q=u[u.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=kt()),z=Q[q]&&Q[q][M]),typeof z>"u"||!z.length||!z[0]){var ht="";et=[];for(it in Q[q])this.terminals_[it]&&it>Zt&&et.push("'"+this.terminals_[it]+"'");T.showPosition?ht="Parse error on line "+(tt+1)+`: +`+T.showPosition()+` +Expecting `+et.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ht="Parse error on line "+(tt+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ht,{text:T.match,token:this.terminals_[M]||M,line:T.yylineno,loc:rt,expected:et})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+M);switch(z[0]){case 1:u.push(M),w.push(T.yytext),r.push(T.yylloc),u.push(z[1]),M=null,St=T.yyleng,d=T.yytext,tt=T.yylineno,rt=T.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=w[w.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ti&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),ot=this.performAction.apply(G,[d,St,tt,$.yy,z[1],w,r].concat(Jt)),typeof ot<"u")return ot;N&&(u=u.slice(0,-1*N*2),w=w.slice(0,-1*N),r=r.slice(0,-1*N)),u.push(this.productions_[z[1]][0]),w.push(G.$),r.push(G._$),Rt=Q[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},_=(function(){var F={EOF:1,parseError:a(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:a(function(o,l){return this.yy=l||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:a(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.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),o},"input"),unput:a(function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=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 w=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===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(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:a(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:a(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:a(function(o,l){var u,x,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),x=o[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var r in w)this[r]=w[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,u,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),r=0;rl[0].length)){if(l=u,x=r,this.options.backtrack_lexer){if(o=this.test_match(u,w[r]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,w[x]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var l=this.next();return l||this.lex()},"lex"),begin:a(function(l){this.conditionStack.push(l)},"begin"),popState:a(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:a(function(l){this.begin(l)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(l,u,x,w){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();V.lexer=_;function H(){this.yy={}}return a(H,"Parser"),H.prototype=V,V.Parser=H,new H})();ct.parser=ct;var mi=ct;function ut(t){return t.type==="bar"}a(ut,"isBarPlot");function ft(t){return t.type==="band"}a(ft,"isBandAxisData");function j(t){return t.type==="linear"}a(j,"isLinearAxisData");var Mt=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((n,g)=>Math.max(g.length,n),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const g=xi(s,1,n),c=g?g.width:n.length*i,p=g?g.height:i;e.width=Math.max(e.width,c),e.height=Math.max(e.height,p)}return s.remove(),e}},vt=.7,Pt=.2,Vt=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{a(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){vt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(vt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+this.axisConfig.labelPadding*2;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},yi=class extends Vt{static{a(this,"BandAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=lt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=lt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Et.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},bi=class extends Vt{static{a(this,"LinearAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=Dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function gt(t,i,e,s){const n=new Mt(s);return ft(t)?new yi(i,e,t.categories,t.title,n):new bi(i,e,[t.min,t.max],t.title,n)}a(gt,"getAxis");var Ai=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{a(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Bt(t,i,e,s){const n=new Mt(s);return new Ai(n,t,i,e)}a(Bt,"getChartTitleComponent");var wi=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}static{a(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=Tt().y(e=>e[0]).x(e=>e[1])(t):i=Tt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Ci=class{constructor(t,i,e,s,n,g){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=g}static{a(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:e,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:e,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Si=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{a(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new wi(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Ci(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}return t}};function Wt(t,i,e){return new Si(t,i,e)}a(Wt,"getPlotComponent");var _i=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Bt(t,i,e,s),plot:Wt(t,i,e),xAxis:gt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:gt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{a(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:n,height:g});t-=c.width,i-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=c.height,i-=c.height,this.componentStore.xAxis.setAxisPosition("bottom"),c=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=c.height,this.componentStore.yAxis.setAxisPosition("left"),c=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=c.width,t-=c.width,t>0&&(n+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:g}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+g}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(p=>ut(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:c});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=p.width,s=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=p.height,n=e+p.height,t>0&&(g+=t,t=0),i>0&&(c+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+c]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(k=>ut(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},ki=class{static{a(this,"XYChartBuilder")}static build(t,i,e,s){return new _i(t,i,e,s).getDrawableElement()}},K=0,zt,Z=yt(),J=mt(),b=bt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1;function mt(){const t=gi(),i=dt();return It(t.xyChart,i.themeVariables.xyChart)}a(mt,"getChartDefaultThemeConfig");function yt(){const t=dt();return It(ui.xyChart,t.xyChart)}a(yt,"getChartDefaultConfig");function bt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(bt,"getChartDefaultData");function nt(t){const i=dt();return ci(t.trim(),i)}a(nt,"textSanitizer");function Ot(t){zt=t}a(Ot,"setTmpSVGG");function Ft(t){t==="horizontal"?Z.chartOrientation="horizontal":Z.chartOrientation="vertical"}a(Ft,"setOrientation");function Xt(t){b.xAxis.title=nt(t.text)}a(Xt,"setXAxisTitle");function At(t,i){b.xAxis={type:"linear",title:b.xAxis.title,min:t,max:i},st=!0}a(At,"setXAxisRangeData");function Yt(t){b.xAxis={type:"band",title:b.xAxis.title,categories:t.map(i=>nt(i.text))},st=!0}a(Yt,"setXAxisBand");function Nt(t){b.yAxis.title=nt(t.text)}a(Nt,"setYAxisTitle");function Ht(t,i){b.yAxis={type:"linear",title:b.yAxis.title,min:t,max:i},pt=!0}a(Ht,"setYAxisRangeData");function Ut(t){const i=Math.min(...t),e=Math.max(...t),s=j(b.yAxis)?b.yAxis.min:1/0,n=j(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}a(Ut,"setYAxisRangeFromPlotData");function wt(t){let i=[];if(t.length===0)return i;if(!st){const e=j(b.xAxis)?b.xAxis.min:1/0,s=j(b.xAxis)?b.xAxis.max:-1/0;At(Math.min(e,1),Math.max(s,t.length))}if(pt||Ut(t),ft(b.xAxis)&&(i=b.xAxis.categories.map((e,s)=>[e,t[s]])),j(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,n=(s-e)/(t.length-1),g=[];for(let c=e;c<=s;c+=n)g.push(`${c}`);i=g.map((c,p)=>[c,t[p]])}return i}a(wt,"transformDataWithoutCategory");function Ct(t){return xt[t===0?0:t%xt.length]}a(Ct,"getPlotColorFromPalette");function $t(t,i){const e=wt(i);b.plots.push({type:"line",strokeFill:Ct(K),strokeWidth:2,data:e}),K++}a($t,"setLineData");function qt(t,i){const e=wt(i);b.plots.push({type:"bar",fill:Ct(K),data:e}),K++}a(qt,"setBarData");function Gt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=Lt(),ki.build(Z,b,J,zt)}a(Gt,"getDrawableElem");function jt(){return J}a(jt,"getChartThemeConfig");function Qt(){return Z}a(Qt,"getChartConfig");function Kt(){return b}a(Kt,"getXYChartData");var Ri=a(function(){li(),K=0,Z=yt(),b=bt(),J=mt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1},"clear"),Ti={getDrawableElem:Gt,clear:Ri,setAccTitle:ri,getAccTitle:ai,setDiagramTitle:ni,getDiagramTitle:Lt,getAccDescription:si,setAccDescription:ei,setOrientation:Ft,setXAxisTitle:Xt,setXAxisRangeData:At,setXAxisBand:Yt,setYAxisTitle:Nt,setYAxisRangeData:Ht,setLineData:$t,setBarData:qt,setTmpSVGG:Ot,getChartThemeConfig:jt,getChartConfig:Qt,getXYChartData:Kt},Di=a((t,i,e,s)=>{const n=s.db,g=n.getChartThemeConfig(),c=n.getChartConfig(),p=n.getXYChartData().plots[0].data.map(f=>f[1]);function k(f){return f==="top"?"text-before-edge":"middle"}a(k,"getDominantBaseLine");function v(f){return f==="left"?"start":f==="right"?"end":"middle"}a(v,"getTextAnchor");function P(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}a(P,"getTextTransformation"),Et.debug(`Rendering xychart chart +`+t);const S=oi(i),m=S.append("g").attr("class","main"),E=m.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");hi(S,c.height,c.width,!0),S.attr("viewBox",`0 0 ${c.width} ${c.height}`),E.attr("fill",g.backgroundColor),n.setTmpSVGG(S.append("g").attr("class","mermaid-tmp-group"));const D=n.getDrawableElem(),L={};function I(f){let R=m,h="";for(const[W]of f.entries()){let O=m;W>0&&L[h]&&(O=L[h]),h+=f[W],R=L[h],R||(R=L[h]=O.append("g").attr("class",f[W]))}return R}a(I,"getGroup");for(const f of D){if(f.data.length===0)continue;const R=I(f.groupTexts);switch(f.type){case"rect":if(R.selectAll("rect").data(f.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),c.showDataLabel){const h=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let W=function(A,V){const{data:_,label:H}=A;return V*H.length*O<=_.width-X};a(W,"fitsHorizontally");const O=.7,X=10,Y=f.data.map((A,V)=>({data:A,label:p[V].toString()})).filter(A=>A.data.width>0&&A.data.height>0),C=Y.map(A=>{const{data:V}=A;let _=V.height*.7;for(;!W(A,_)&&_>0;)_-=1;return _}),U=Math.floor(Math.min(...C)),y=a(A=>h?A.data.x+A.data.width+X:A.data.x+A.data.width-X,"determineLabelXPosition");R.selectAll("text").data(Y).enter().append("text").attr("x",y).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",g.dataLabelColor).attr("font-size",`${U}px`).text(A=>A.label)}else{let W=function(y,A,V){const{data:_,label:H}=y,o=A*H.length*.7,l=_.x+_.width/2,u=l-o/2,x=l+o/2,w=u>=_.x&&x<=_.x+_.width,r=_.y+V+A<=_.y+_.height;return w&&r};a(W,"fitsInBar");const O=10,X=f.data.map((y,A)=>({data:y,label:p[A].toString()})).filter(y=>y.data.width>0&&y.data.height>0),Y=X.map(y=>{const{data:A,label:V}=y;let _=A.width/(V.length*.7);for(;!W(y,_,O)&&_>0;)_-=1;return _}),C=Math.floor(Math.min(...Y)),U=a(y=>h?y.data.y-O:y.data.y+O,"determineLabelYPosition");R.selectAll("text").data(X).enter().append("text").attr("x",y=>y.data.x+y.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",g.dataLabelColor).attr("font-size",`${C}px`).text(y=>y.label)}}break;case"text":R.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>k(h.verticalPos)).attr("text-anchor",h=>v(h.horizontalPos)).attr("transform",h=>P(h)).text(h=>h.text);break;case"path":R.selectAll("path").data(f.data).enter().append("path").attr("d",h=>h.path).attr("fill",h=>h.fill?h.fill:"none").attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth);break}}},"draw"),vi={draw:Di},Bi={parser:mi,db:Ti,renderer:vi};export{Bi as diagram}; diff --git a/apps/kimi-code/src/tui/commands/dispatch.ts b/apps/kimi-code/src/tui/commands/dispatch.ts index 621282c9ea..8f3ddb3388 100644 --- a/apps/kimi-code/src/tui/commands/dispatch.ts +++ b/apps/kimi-code/src/tui/commands/dispatch.ts @@ -54,9 +54,12 @@ import { type BuiltinSlashCommandName, } from './registry'; import { handleReloadCommand, handleReloadTuiCommand } from './reload'; -import type { SkillListSession } from './skills'; +import { isUserActivatableSkill, type SkillListSession } from './skills'; +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; +import { runSkillSelector } from './prompts'; import { canRestoreSubmittedInput, + resolveSkillCommand, resolveSlashCommandInput, slashBusyMessage, slashCommandBusyReason, @@ -428,6 +431,7 @@ const SESSION_REQUIRING_COMMANDS: ReadonlySet = new Set 'goal', 'init', 'plan', + 'skill', 'swarm', 'undo', 'web', @@ -613,8 +617,99 @@ async function handleBuiltInSlashCommand( case 'web': await handleWebCommand(host); return; + case 'skill': + await handleSkillCommand(host, args); + return; default: host.showError(`Unknown slash command: /${String(name)}`); return; } } + +async function handleSkillCommand( + host: SlashCommandHost, + args: string, +): Promise { + const busyReason = slashCommandBusyReason({ + isStreaming: host.state.appState.streamingPhase !== 'idle', + isCompacting: host.state.appState.isCompacting, + }); + if (busyReason !== undefined) { + host.showError(slashBusyMessage('skill', busyReason)); + return; + } + + let session = host.session; + if (session === undefined) { + session = await ensureSessionForCommand(host); + if (session === undefined) return; + const busyCheck = slashCommandBusyReason({ + isStreaming: host.state.appState.streamingPhase !== 'idle', + isCompacting: host.state.appState.isCompacting, + }); + if (busyCheck !== undefined) { + host.showError(slashBusyMessage('skill', busyCheck)); + return; + } + } + + let skills: readonly SkillSummary[] = []; + try { + skills = await session.listSkills(); + } catch (error) { + host.showError(formatErrorMessage(error)); + return; + } + + // Recheck busy state after loading skills (P1: Block /skill while a turn is active) + const busyCheckAfterLoad = slashCommandBusyReason({ + isStreaming: host.state.appState.streamingPhase !== 'idle', + isCompacting: host.state.appState.isCompacting, + }); + if (busyCheckAfterLoad !== undefined) { + host.showError(slashBusyMessage('skill', busyCheckAfterLoad)); + return; + } + + const activatableSkills = skills.filter(isUserActivatableSkill); + const trimmedArgs = args.trim(); + + if ( + trimmedArgs.length > 0 && + trimmedArgs !== 'skill' && + trimmedArgs !== '/skill' && + trimmedArgs !== 'skills' && + trimmedArgs !== '/skills' + ) { + const spaceIdx = trimmedArgs.search(/\s/); + const firstWord = spaceIdx >= 0 ? trimmedArgs.slice(0, spaceIdx) : trimmedArgs; + const remainingArgs = spaceIdx >= 0 ? trimmedArgs.slice(spaceIdx + 1).trim() : ''; + + const resolvedName = + resolveSkillCommand(host.skillCommandMap, firstWord) ?? + resolveSkillCommand(host.skillCommandMap, trimmedArgs) ?? + firstWord; + const targetSkill = activatableSkills.find( + (s) => s.name === resolvedName || s.name === firstWord || s.name === trimmedArgs, + ); + if (targetSkill !== undefined) { + const skillArgs = + targetSkill.name === resolvedName || targetSkill.name === firstWord ? remainingArgs : ''; + host.sendSkillActivation(session, targetSkill.name, skillArgs); + return; + } + } + + const selectedSkill = await runSkillSelector(host, activatableSkills, host.state.appState.skillDirs); + if (selectedSkill !== undefined) { + const busyCheck = slashCommandBusyReason({ + isStreaming: host.state.appState.streamingPhase !== 'idle', + isCompacting: host.state.appState.isCompacting, + }); + if (busyCheck !== undefined) { + host.showError(slashBusyMessage('skill', busyCheck)); + return; + } + host.sendSkillActivation(session, selectedSkill.name, ''); + } +} diff --git a/apps/kimi-code/src/tui/commands/prompts.ts b/apps/kimi-code/src/tui/commands/prompts.ts index cbfc33072f..39403b765a 100644 --- a/apps/kimi-code/src/tui/commands/prompts.ts +++ b/apps/kimi-code/src/tui/commands/prompts.ts @@ -13,10 +13,12 @@ import type { } from '@moonshot-ai/kimi-code-oauth'; import { ApiKeyInputDialogComponent, type ApiKeyInputResult } from '../components/dialogs/api-key-input-dialog'; -import { ChoicePickerComponent, type ChoiceOption } from '../components/dialogs/choice-picker'; import { FeedbackInputDialogComponent, type FeedbackInputDialogResult } from '../components/dialogs/feedback-input-dialog'; +import { ChoicePickerComponent, type ChoiceOption } from '../components/dialogs/choice-picker'; import { ModelSelectorComponent } from '../components/dialogs/model-selector'; import { PlatformSelectorComponent } from '../components/dialogs/platform-selector'; +import { SkillSelectorComponent } from '../components/dialogs/skill-selector'; +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; import type { SlashCommandHost } from './dispatch'; export function promptPlatformSelection(host: SlashCommandHost): Promise { @@ -249,3 +251,26 @@ export function runModelSelector( host.mountEditorReplacement(selector); }); } + +export function runSkillSelector( + host: SlashCommandHost, + skills: readonly SkillSummary[], + skillRoots?: readonly string[], +): Promise { + return new Promise((resolve) => { + const selector = new SkillSelectorComponent({ + skills, + skillRoots, + searchable: true, + onSelect: (skill) => { + host.restoreEditor(); + resolve(skill); + }, + onCancel: () => { + host.restoreEditor(); + resolve(undefined); + }, + }); + host.mountEditorReplacement(selector); + }); +} diff --git a/apps/kimi-code/src/tui/commands/registry.ts b/apps/kimi-code/src/tui/commands/registry.ts index 61ecc69ea9..4b7fd00839 100644 --- a/apps/kimi-code/src/tui/commands/registry.ts +++ b/apps/kimi-code/src/tui/commands/registry.ts @@ -232,6 +232,13 @@ export const BUILTIN_SLASH_COMMANDS = [ priority: 95, availability: 'always', }, + { + name: 'skill', + aliases: ['skills'], + description: 'Select skill from hierarchical group selector', + priority: 90, + availability: 'idle-only', + }, { name: 'btw', aliases: [], diff --git a/apps/kimi-code/src/tui/commands/skill-group-tree.ts b/apps/kimi-code/src/tui/commands/skill-group-tree.ts new file mode 100644 index 0000000000..b152551572 --- /dev/null +++ b/apps/kimi-code/src/tui/commands/skill-group-tree.ts @@ -0,0 +1,236 @@ +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; +import path from 'pathe'; + +export interface SkillGroupNode { + readonly path: string; + readonly label: string; + readonly childGroups: readonly SkillGroupNode[]; + readonly skills: readonly SkillSummary[]; +} + +export interface BuildSkillGroupTreeOptions { + readonly skillRoots?: readonly string[]; +} + +interface InternalGroupData { + readonly path: string; + readonly label: string; + readonly directSkills: Map; + readonly childPaths: Set; +} + +export function buildSkillGroupTree( + skills: readonly SkillSummary[], + options: BuildSkillGroupTreeOptions = {}, +): SkillGroupNode { + const groupsMap = new Map(); + const topLevelPaths = new Set(); + + const getOrCreateGroup = (groupPath: string): InternalGroupData => { + const existing = groupsMap.get(groupPath); + if (existing !== undefined) return existing; + + const segments = groupPath.split('/').filter((s) => s.trim() !== ''); + const label = segments[segments.length - 1] ?? groupPath; + + const groupData: InternalGroupData = { + path: groupPath, + label, + directSkills: new Map(), + childPaths: new Set(), + }; + groupsMap.set(groupPath, groupData); + + if (segments.length > 1) { + const parentPath = segments.slice(0, -1).join('/'); + const parentGroup = getOrCreateGroup(parentPath); + parentGroup.childPaths.add(groupPath); + } else { + topLevelPaths.add(groupPath); + } + + return groupData; + }; + + for (const skill of skills) { + const assignedPaths = resolveGroupPathsForSkill(skill, options.skillRoots); + for (const gPath of assignedPaths) { + const groupNode = getOrCreateGroup(gPath); + if (!groupNode.directSkills.has(skill.name)) { + groupNode.directSkills.set(skill.name, skill); + } + } + } + + const buildNode = (groupPath: string): SkillGroupNode => { + const groupData = groupsMap.get(groupPath); + if (groupData === undefined) { + return { + path: groupPath, + label: groupPath, + childGroups: [], + skills: [], + }; + } + + const sortedChildren = Array.from(groupData.childPaths) + .map((cp) => buildNode(cp)) + .sort((a, b) => a.label.localeCompare(b.label)); + + const sortedSkills = Array.from(groupData.directSkills.values()).sort((a, b) => + a.name.localeCompare(b.name), + ); + + return { + path: groupData.path, + label: groupData.label, + childGroups: sortedChildren, + skills: sortedSkills, + }; + }; + + const topLevelNodes = Array.from(topLevelPaths) + .map((tp) => buildNode(tp)) + .sort((a, b) => { + // Put 'Uncategorized' at the end of top-level list + if (a.path === 'Uncategorized') return 1; + if (b.path === 'Uncategorized') return -1; + return a.label.localeCompare(b.label); + }); + + return { + path: '', + label: 'Root', + childGroups: topLevelNodes, + skills: [], + }; +} + +export function findGroupNode( + node: SkillGroupNode, + targetPath: string, +): SkillGroupNode | undefined { + if (node.path === targetPath) return node; + for (const child of node.childGroups) { + const found = findGroupNode(child, targetPath); + if (found !== undefined) return found; + } + return undefined; +} + +function cleanGroupPath(rawPath: string): string | undefined { + const segments = rawPath + .split('/') + .map((s) => s.trim()) + .filter((s) => s !== ''); + return segments.length > 0 ? segments.join('/') : undefined; +} + +function resolveGroupPathsForSkill( + skill: SkillSummary, + skillRoots: readonly string[] = [], +): readonly string[] { + // Precedence Rule 1: Explicit frontmatter `groups` + if (Array.isArray(skill.groups) && skill.groups.length > 0) { + const groups: string[] = []; + for (const rawGroup of skill.groups) { + if (typeof rawGroup !== 'string') continue; + const cleanPath = cleanGroupPath(rawGroup); + if (cleanPath !== undefined && !groups.includes(cleanPath)) { + groups.push(cleanPath); + } + } + if (groups.length > 0) { + return groups; + } + } + + // Precedence Rule 2: Explicit `category` or `categories` + const categoryCandidates: string[] = []; + if (typeof skill.category === 'string' && skill.category.trim() !== '') { + categoryCandidates.push(skill.category.trim()); + } + if (Array.isArray(skill.categories)) { + for (const cat of skill.categories) { + if (typeof cat === 'string' && cat.trim() !== '') { + categoryCandidates.push(cat.trim()); + } + } + } + if (categoryCandidates.length > 0) { + const categories: string[] = []; + for (const cat of categoryCandidates) { + const clean = cleanGroupPath(cat); + if (clean !== undefined && !categories.includes(clean)) { + categories.push(clean); + } + } + if (categories.length > 0) { + return categories; + } + } + + // Precedence Rule 3: Relative parent folder derivation + const folderFallback = deriveFolderGroup(skill.path, skillRoots, skill.name); + if (folderFallback !== undefined) { + const clean = cleanGroupPath(folderFallback); + if (clean !== undefined) { + return [clean]; + } + } + + // Precedence Rule 4: Final fallback to Uncategorized + return ['Uncategorized']; +} + +function deriveFolderGroup( + skillPath: string, + skillRoots: readonly string[] = [], + skillName?: string, +): string | undefined { + if (!skillPath) return undefined; + const normalizedPath = path.resolve(skillPath); + + for (const root of skillRoots) { + const normalizedRoot = path.resolve(root); + if (normalizedPath.startsWith(normalizedRoot)) { + const rel = path.relative(normalizedRoot, normalizedPath); + const segments = rel + .split(path.sep) + .filter((s) => s !== '' && s !== 'SKILL.md' && !s.endsWith('.md')); + if (segments.length >= 2) { + const last = segments[segments.length - 1]; + if (last === skillName || (skillName && last?.toLowerCase() === skillName.toLowerCase())) { + segments.pop(); + } + } + if (segments.length > 0) { + return segments.join('/'); + } + } + } + + const parts = normalizedPath.split(path.sep).filter((p) => p !== ''); + let markerIdx = -1; + const knownMarkers = ['skills', 'skillshub']; + for (let i = parts.length - 1; i >= 0; i--) { + const part = parts[i]; + if (part && knownMarkers.includes(part)) { + markerIdx = i; + break; + } + } + + if (markerIdx >= 0 && markerIdx + 1 < parts.length) { + const sub = parts.slice(markerIdx + 1).filter((s) => s !== 'SKILL.md' && !s.endsWith('.md')); + if (sub.length >= 2) { + const parentFolders = sub.slice(0, -1); + if (parentFolders.length > 0) { + return parentFolders.join('/'); + } + } + } + + return undefined; +} + diff --git a/apps/kimi-code/src/tui/components/dialogs/skill-selector.ts b/apps/kimi-code/src/tui/components/dialogs/skill-selector.ts new file mode 100644 index 0000000000..718afa83a6 --- /dev/null +++ b/apps/kimi-code/src/tui/components/dialogs/skill-selector.ts @@ -0,0 +1,322 @@ +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; +import { + Container, + Key, + matchesKey, + truncateToWidth, + visibleWidth, + type Focusable, +} from '@moonshot-ai/pi-tui'; +import { SELECT_POINTER } from '#/tui/constant/symbols'; +import { currentTheme } from '#/tui/theme'; +import { printableChar } from '#/tui/utils/printable-key'; +import { SearchableList } from '#/tui/utils/searchable-list'; +import { renderTabStrip } from '#/tui/utils/tab-strip'; +import { + buildSkillGroupTree, + findGroupNode, + type SkillGroupNode, +} from '../../commands/skill-group-tree'; + +export interface SkillSelectorOptions { + readonly skills: readonly SkillSummary[]; + readonly skillRoots?: readonly string[]; + readonly title?: string; + readonly searchable?: boolean; + readonly pageSize?: number; + readonly onSelect: (skill: SkillSummary) => void; + readonly onCancel: () => void; +} + +export type SkillSelectorItem = + | { + readonly kind: 'group'; + readonly node: SkillGroupNode; + readonly label: string; + readonly description: string; + readonly groupPath?: string; + readonly isDescendant?: boolean; + } + | { + readonly kind: 'skill'; + readonly skill: SkillSummary; + readonly label: string; + readonly description: string; + readonly groupPath?: string; + readonly isDescendant?: boolean; + }; + +function countSkillsInTree(node: SkillGroupNode): number { + const seen = new Set(); + function countNode(node: SkillGroupNode): number { + let count = 0; + for (const skill of node.skills) { + if (!seen.has(skill.name)) { + seen.add(skill.name); + count++; + } + } + for (const child of node.childGroups) { + count += countNode(child); + } + return count; + } + return countNode(node); +} + +function collectDescendantSkills( + node: SkillGroupNode, +): Array<{ skill: SkillSummary; groupPath: string }> { + const result: Array<{ skill: SkillSummary; groupPath: string }> = []; + for (const child of node.childGroups) { + for (const skill of child.skills) { + result.push({ skill, groupPath: child.path }); + } + result.push(...collectDescendantSkills(child)); + } + return result; +} + +export class SkillSelectorComponent extends Container implements Focusable { + focused = false; + private readonly opts: SkillSelectorOptions; + private readonly rootTree: SkillGroupNode; + private currentGroupPath: string = ''; + private list!: SearchableList; + + constructor(opts: SkillSelectorOptions) { + super(); + this.opts = opts; + this.rootTree = buildSkillGroupTree(opts.skills, { skillRoots: opts.skillRoots }); + this.rebuildList(); + } + + private get tabLabels(): readonly string[] { + return ['All', ...this.rootTree.childGroups.map((g) => g.label)]; + } + + private get activeTabIdx(): number { + if (this.currentGroupPath === '') return 0; + const topSegment = this.currentGroupPath.split('/')[0]; + const idx = this.rootTree.childGroups.findIndex( + (g) => g.label === topSegment || g.path === topSegment, + ); + return idx >= 0 ? idx + 1 : 0; + } + + private switchTab(newIdx: number): void { + if (newIdx === 0) { + this.currentGroupPath = ''; + } else { + const group = this.rootTree.childGroups[newIdx - 1]; + if (group !== undefined) { + this.currentGroupPath = group.path; + } + } + this.rebuildList(); + } + + private cycleTab(isShift: boolean): void { + const labels = this.tabLabels; + if (labels.length <= 1) return; + const current = this.activeTabIdx; + const nextIdx = isShift + ? (current - 1 + labels.length) % labels.length + : (current + 1) % labels.length; + this.switchTab(nextIdx); + } + + private rebuildList(): void { + const currentNode = findGroupNode(this.rootTree, this.currentGroupPath) ?? this.rootTree; + const items: SkillSelectorItem[] = []; + + for (const childGroup of currentNode.childGroups) { + const skillCount = countSkillsInTree(childGroup); + items.push({ + kind: 'group', + node: childGroup, + label: childGroup.label, + description: `${String(skillCount)} skill${skillCount === 1 ? '' : 's'}`, + groupPath: childGroup.path, + }); + } + + const directSkillNames = new Set(); + for (const skill of currentNode.skills) { + directSkillNames.add(skill.name); + items.push({ + kind: 'skill', + skill, + label: skill.name, + description: skill.description || 'No description provided.', + groupPath: currentNode.path, + }); + } + + const descendantSkills = collectDescendantSkills(currentNode); + for (const { skill, groupPath } of descendantSkills) { + if (!directSkillNames.has(skill.name)) { + directSkillNames.add(skill.name); + items.push({ + kind: 'skill', + skill, + label: skill.name, + description: skill.description || 'No description provided.', + groupPath, + isDescendant: true, + }); + } + } + + this.list = new SearchableList({ + items, + toSearchText: (item) => `${item.label} ${item.description} ${item.groupPath ?? ''}`, + filterItem: (item, query) => query.length > 0 || item.isDescendant !== true, + pageSize: this.opts.pageSize, + searchable: this.opts.searchable ?? true, + }); + } + + handleInput(data: string): void { + if (matchesKey(data, Key.tab) || matchesKey(data, Key.shift('tab'))) { + const isShift = matchesKey(data, Key.shift('tab')); + this.cycleTab(isShift); + return; + } + + if (matchesKey(data, Key.escape)) { + if (this.list.clearQuery()) return; + if (this.currentGroupPath !== '') { + const segments = this.currentGroupPath.split('/'); + segments.pop(); + this.currentGroupPath = segments.join('/'); + this.rebuildList(); + return; + } + this.opts.onCancel(); + return; + } + + // Handle left/right arrow keys for pagination (P2: Implement advertised left/right paging keys) + if (matchesKey(data, Key.left)) { + this.list.pageUp(); + return; + } + if (matchesKey(data, Key.right)) { + this.list.pageDown(); + return; + } + + const isSpace = matchesKey(data, Key.space) || printableChar(data) === ' '; + if (matchesKey(data, Key.enter) || (isSpace && this.opts.searchable !== true)) { + const selected = this.list.selected(); + if (selected === undefined) return; + + if (selected.kind === 'group') { + this.currentGroupPath = selected.node.path; + this.rebuildList(); + } else { + this.opts.onSelect(selected.skill); + } + return; + } + + this.list.handleKey(data); + } + + override render(width: number): string[] { + const searchable = this.opts.searchable !== false; + const view = this.list.view(); + const items = view.items; + + const titleText = + this.opts.title ?? + (this.currentGroupPath === '' + ? 'Select skill group' + : `Skills › ${this.currentGroupPath.split('/').join(' › ')}`); + + const titleSuffix = + searchable && view.query.length === 0 + ? currentTheme.fg('textMuted', ' (type to search)') + : ''; + + const hintParts = ['↑↓ navigate', 'Tab switch group']; + if (view.page.pageCount > 1) hintParts.push('←→ page'); + hintParts.push('Enter select', 'Esc back/cancel'); + + const lines: string[] = [ + currentTheme.fg('primary', '─'.repeat(width)), + currentTheme.boldFg('primary', ` ${titleText}`) + titleSuffix, + currentTheme.fg('textMuted', ' ' + hintParts.join(' · ')), + '', + ]; + + const labels = this.tabLabels; + if (labels.length > 1) { + const stripLine = renderTabStrip({ + labels, + activeIndex: this.activeTabIdx, + width, + colors: currentTheme.palette, + }); + lines.push(stripLine, ''); + } + + if (searchable && view.query.length > 0) { + lines.push(currentTheme.fg('primary', ' Search: ') + currentTheme.fg('text', view.query)); + } + + if (items.length === 0) { + lines.push(currentTheme.fg('textMuted', ' No matches')); + } else { + for (let i = view.page.start; i < view.page.end; i++) { + const item = items[i]; + if (item === undefined) continue; + const isSelected = i === view.selectedIndex; + const pointer = isSelected ? SELECT_POINTER : ' '; + + let line = currentTheme.fg(isSelected ? 'primary' : 'textDim', ` ${pointer} `); + if (item.kind === 'group') { + const groupLabel = `${item.label}/`; + line += isSelected + ? currentTheme.boldFg('primary', groupLabel) + : currentTheme.fg('primary', groupLabel); + line += ' ' + currentTheme.fg('textMuted', `(${item.description})`); + } else { + line += isSelected + ? currentTheme.boldFg('primary', item.label) + : currentTheme.fg('text', item.label); + if (item.isDescendant && item.groupPath) { + line += ' ' + currentTheme.fg('textMuted', `(${item.groupPath})`); + } + } + lines.push(line); + } + } + + lines.push(''); + + // Footer preview for currently selected item + const selected = this.list.selected(); + if (selected !== undefined) { + const selectedType = selected.kind === 'group' ? 'Group' : 'Skill'; + const pathSuffix = + selected.kind === 'skill' && selected.groupPath ? ` (${selected.groupPath})` : ''; + lines.push(currentTheme.fg('textMuted', ` ${selectedType}: ${selected.label}${pathSuffix}`)); + lines.push(currentTheme.fg('text', ` ${selected.description}`)); + lines.push(''); + } + + if (view.page.pageCount > 1) { + lines.push( + currentTheme.fg( + 'textMuted', + ` Page ${String(view.page.page + 1)}/${String(view.page.pageCount)}`, + ), + ); + } + lines.push(currentTheme.fg('primary', '─'.repeat(width))); + return lines.map((line) => truncateToWidth(line, width)); + } +} + diff --git a/apps/kimi-code/src/tui/components/editor/custom-editor.ts b/apps/kimi-code/src/tui/components/editor/custom-editor.ts index 2a28020932..13af6f098b 100644 --- a/apps/kimi-code/src/tui/components/editor/custom-editor.ts +++ b/apps/kimi-code/src/tui/components/editor/custom-editor.ts @@ -618,7 +618,10 @@ export class CustomEditor extends Editor { textBeforeCursor.startsWith('/') && textBeforeCursor.includes(' ') ) { - trigger(); + const cmdName = textBeforeCursor.trim().slice(1); + if (cmdName !== 'skill' && cmdName !== 'skills') { + trigger(); + } } } } diff --git a/apps/kimi-code/src/tui/types.ts b/apps/kimi-code/src/tui/types.ts index 83aff8c878..b932a6a45b 100644 --- a/apps/kimi-code/src/tui/types.ts +++ b/apps/kimi-code/src/tui/types.ts @@ -36,6 +36,8 @@ export interface AppState { agentProfile?: string; /** Raw --agent-file paths, passed to session creation alongside `agentProfile`. */ agentFiles?: readonly string[]; + /** Configured skill roots from --skillsDir, passed to session creation and selector */ + skillDirs?: readonly string[]; /** 'bash' when the editor is in `!` shell-command mode. */ inputMode: 'prompt' | 'bash'; swarmMode: boolean; diff --git a/apps/kimi-code/src/tui/utils/searchable-list.ts b/apps/kimi-code/src/tui/utils/searchable-list.ts index 2077033803..56b39a1649 100644 --- a/apps/kimi-code/src/tui/utils/searchable-list.ts +++ b/apps/kimi-code/src/tui/utils/searchable-list.ts @@ -19,6 +19,8 @@ export interface SearchableListOptions { readonly items: readonly T[]; /** Text a list item is fuzzy-matched against. */ readonly toSearchText: (item: T) => string; + /** Optional predicate to pre-filter items based on current query string. */ + readonly filterItem?: (item: T, query: string) => boolean; /** Items per page; defaults to 8. */ readonly pageSize?: number; /** Initial cursor position (clamped to >= 0). */ @@ -40,6 +42,7 @@ export interface SearchableListView { export class SearchableList { private items: readonly T[]; private readonly toSearchText: (item: T) => string; + private readonly filterItem?: (item: T, query: string) => boolean; private readonly pageSize: number; private readonly searchable: boolean; private query = ''; @@ -48,6 +51,7 @@ export class SearchableList { constructor(opts: SearchableListOptions) { this.items = opts.items; this.toSearchText = opts.toSearchText; + this.filterItem = opts.filterItem; this.pageSize = opts.pageSize ?? DEFAULT_PAGE_SIZE; this.searchable = opts.searchable ?? false; this.cursor = Math.max(opts.initialIndex ?? 0, 0); @@ -63,8 +67,12 @@ export class SearchableList { } filtered(): readonly T[] { - if (this.query.length === 0) return this.items; - return fuzzyFilter([...this.items], this.query, this.toSearchText); + let pool = this.items; + if (this.filterItem) { + pool = pool.filter((item) => this.filterItem!(item, this.query)); + } + if (this.query.length === 0) return pool; + return fuzzyFilter([...pool], this.query, this.toSearchText); } /** The item under the cursor, clamped into the filtered range. */ @@ -100,6 +108,15 @@ export class SearchableList { this.cursor = Math.min(Math.max(0, this.filtered().length - 1), this.cursor + this.pageSize); } + setSelectedIndex(index: number): void { + const len = this.filtered().length; + if (len === 0) { + this.cursor = 0; + return; + } + this.cursor = Math.max(0, Math.min(index, len - 1)); + } + /** Clears the active query and resets the cursor. Returns whether a query was cleared. */ clearQuery(): boolean { if (this.query.length === 0) return false; diff --git a/apps/kimi-code/test/tui/commands/skill-group-tree.test.ts b/apps/kimi-code/test/tui/commands/skill-group-tree.test.ts new file mode 100644 index 0000000000..000e4cca3e --- /dev/null +++ b/apps/kimi-code/test/tui/commands/skill-group-tree.test.ts @@ -0,0 +1,140 @@ +import { describe, expect, it } from 'vitest'; +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; +import { buildSkillGroupTree, findGroupNode } from '../../../src/tui/commands/skill-group-tree'; + +function makeSkill(name: string, overrides: Partial = {}): SkillSummary { + return { + name, + description: `${name} description`, + path: `/test/skills/${name}/SKILL.md`, + source: 'user', + type: 'prompt', + ...overrides, + }; +} + +describe('skill-group-tree', () => { + it('builds group tree from explicit groups metadata', () => { + const sshOps = makeSkill('cv_ssh-ops', { + groups: ['cv', 'cv/ops'], + }); + const semaphoreOps = makeSkill('cv_semaphore-ops', { + groups: ['cv', 'cv/ops', 'cv/ops/semaphore'], + }); + + const root = buildSkillGroupTree([sshOps, semaphoreOps]); + + const cvNode = findGroupNode(root, 'cv'); + expect(cvNode).toBeDefined(); + expect(cvNode?.label).toBe('cv'); + expect(cvNode?.skills.map((s) => s.name)).toEqual(['cv_semaphore-ops', 'cv_ssh-ops']); + + const opsNode = findGroupNode(root, 'cv/ops'); + expect(opsNode).toBeDefined(); + expect(opsNode?.label).toBe('ops'); + expect(opsNode?.skills.map((s) => s.name)).toEqual(['cv_semaphore-ops', 'cv_ssh-ops']); + + const semNode = findGroupNode(root, 'cv/ops/semaphore'); + expect(semNode).toBeDefined(); + expect(semNode?.label).toBe('semaphore'); + expect(semNode?.skills.map((s) => s.name)).toEqual(['cv_semaphore-ops']); + }); + + it('implies parent groups when only child group path is specified', () => { + const skill = makeSkill('deep-skill', { + groups: ['a/b/c'], + }); + const root = buildSkillGroupTree([skill]); + + const a = findGroupNode(root, 'a'); + expect(a).toBeDefined(); + expect(a?.childGroups.map((g) => g.label)).toEqual(['b']); + expect(a?.skills).toEqual([]); + + const b = findGroupNode(root, 'a/b'); + expect(b).toBeDefined(); + expect(b?.childGroups.map((g) => g.label)).toEqual(['c']); + expect(b?.skills).toEqual([]); + + const c = findGroupNode(root, 'a/b/c'); + expect(c).toBeDefined(); + expect(c?.skills.map((s) => s.name)).toEqual(['deep-skill']); + }); + + it('falls back to category when groups are absent', () => { + const deploySkill = makeSkill('deploy-app', { category: 'deploy' }); + const root = buildSkillGroupTree([deploySkill]); + + const node = findGroupNode(root, 'deploy'); + expect(node).toBeDefined(); + expect(node?.skills.map((s) => s.name)).toEqual(['deploy-app']); + }); + + it('falls back to relative folder path when groups and category are absent', () => { + const secSkill = makeSkill('owasp-audit', { + path: '/home/user/.kimi/skills/security/owasp-audit/SKILL.md', + }); + const root = buildSkillGroupTree([secSkill], { skillRoots: ['/home/user/.kimi/skills'] }); + + const secNode = findGroupNode(root, 'security'); + expect(secNode).toBeDefined(); + expect(secNode?.skills.map((s) => s.name)).toEqual(['owasp-audit']); + }); + + it('falls back to Uncategorized when no group/category/folder is present', () => { + const flatSkill = makeSkill('flat-skill', { + path: '/SKILL.md', + }); + const root = buildSkillGroupTree([flatSkill]); + + const uncatNode = findGroupNode(root, 'Uncategorized'); + expect(uncatNode).toBeDefined(); + expect(uncatNode?.skills.map((s) => s.name)).toEqual(['flat-skill']); + }); + + it('enforces precedence order and supports multi-level relative folder paths', () => { + const multiFolderSkill = makeSkill('cv_semaphore-ops', { + path: '/home/user/.kimi/skills/cv/ops/semaphore/cv_semaphore-ops/SKILL.md', + }); + const overrideSkill = makeSkill('custom-tool', { + category: 'explicit-cat', + tags: ['ignored-tag1', 'ignored-tag2'], + path: '/home/user/.kimi/skills/folder-cat/custom-tool/SKILL.md', + }); + + const root = buildSkillGroupTree([multiFolderSkill, overrideSkill], { + skillRoots: ['/home/user/.kimi/skills'], + }); + + // Multi-level folder skill creates cv -> ops -> semaphore + const cvNode = findGroupNode(root, 'cv'); + expect(cvNode).toBeDefined(); + + const opsNode = findGroupNode(root, 'cv/ops'); + expect(opsNode).toBeDefined(); + + const semNode = findGroupNode(root, 'cv/ops/semaphore'); + expect(semNode).toBeDefined(); + expect(semNode?.skills.map((s) => s.name)).toEqual(['cv_semaphore-ops']); + + // category takes precedence over relative folder path and tags are ignored + const explicitCatNode = findGroupNode(root, 'explicit-cat'); + expect(explicitCatNode).toBeDefined(); + expect(explicitCatNode?.skills.map((s) => s.name)).toEqual(['custom-tool']); + + expect(findGroupNode(root, 'ignored-tag1')).toBeUndefined(); + expect(findGroupNode(root, 'folder-cat')).toBeUndefined(); + }); + + it('preserves deterministic alphabetical ordering of groups and skills', () => { + const bSkill = makeSkill('b_skill', { category: 'ops' }); + const aSkill = makeSkill('a_skill', { category: 'ops' }); + const cSkill = makeSkill('c_skill', { category: 'dev' }); + + const root = buildSkillGroupTree([bSkill, aSkill, cSkill]); + + expect(root.childGroups.map((g) => g.label)).toEqual(['dev', 'ops']); + const opsNode = findGroupNode(root, 'ops'); + expect(opsNode?.skills.map((s) => s.name)).toEqual(['a_skill', 'b_skill']); + }); +}); diff --git a/apps/kimi-code/test/tui/components/dialogs/skill-selector.test.ts b/apps/kimi-code/test/tui/components/dialogs/skill-selector.test.ts new file mode 100644 index 0000000000..2aa9ce9520 --- /dev/null +++ b/apps/kimi-code/test/tui/components/dialogs/skill-selector.test.ts @@ -0,0 +1,168 @@ +import { describe, expect, it, vi } from 'vitest'; +import type { SkillSummary } from '@moonshot-ai/kimi-code-sdk'; +import { Key } from '@moonshot-ai/pi-tui'; +import { SkillSelectorComponent } from '../../../../src/tui/components/dialogs/skill-selector'; + +function makeSkill(name: string, overrides: Partial = {}): SkillSummary { + return { + name, + description: `${name} description`, + path: `/test/skills/${name}/SKILL.md`, + source: 'user', + type: 'prompt', + ...overrides, + }; +} + +function text(component: SkillSelectorComponent, width = 120): string { + return component.render(width).join('\n'); +} + +const ENTER = '\r'; +const ESC = '\x1b'; +const TAB = '\t'; + +describe('SkillSelectorComponent', () => { + const sshOps = makeSkill('cv_ssh-ops', { + groups: ['cv', 'cv/ops'], + description: 'SSH operations', + }); + const semaphoreOps = makeSkill('cv_semaphore-ops', { + groups: ['cv', 'cv/ops', 'cv/ops/semaphore'], + description: 'Semaphore operations', + }); + const flatSkill = makeSkill('flat-skill', { + description: 'Flat skill without group', + }); + + const skills = [sshOps, semaphoreOps, flatSkill]; + + it('renders root group level', () => { + const onSelect = vi.fn(); + const onCancel = vi.fn(); + const selector = new SkillSelectorComponent({ + skills, + onSelect, + onCancel, + }); + + const rendered = text(selector); + expect(rendered).toContain('Select skill group'); + expect(rendered).toContain('cv'); + expect(rendered).toContain('Uncategorized'); + }); + + it('drills down into group on Enter and goes back on Escape', () => { + const onSelect = vi.fn(); + const onCancel = vi.fn(); + const selector = new SkillSelectorComponent({ + skills, + onSelect, + onCancel, + }); + + // Enter on 'cv' + selector.handleInput(ENTER); + let rendered = text(selector); + expect(rendered).toContain('Skills › cv'); + expect(rendered).toContain('ops'); + expect(rendered).toContain('cv_ssh-ops'); + expect(rendered).toContain('cv_semaphore-ops'); + + // Enter on 'ops' + selector.handleInput(ENTER); + rendered = text(selector); + expect(rendered).toContain('Skills › cv › ops'); + expect(rendered).toContain('semaphore'); + expect(rendered).toContain('cv_ssh-ops'); + + // Escape back to 'cv' + selector.handleInput(ESC); + rendered = text(selector); + expect(rendered).toContain('Skills › cv'); + + // Escape back to root + selector.handleInput(ESC); + rendered = text(selector); + expect(rendered).toContain('Select skill group'); + + // Escape at root cancels + selector.handleInput(ESC); + expect(onCancel).toHaveBeenCalledTimes(1); + }); + + it('selects a skill on Enter and calls onSelect', () => { + const onSelect = vi.fn(); + const onCancel = vi.fn(); + const selector = new SkillSelectorComponent({ + skills, + onSelect, + onCancel, + }); + + // Drill down: Root -> cv -> ops -> semaphore + selector.handleInput(ENTER); // cv + selector.handleInput(ENTER); // ops + selector.handleInput(ENTER); // semaphore + + const rendered = text(selector); + expect(rendered).toContain('Skills › cv › ops › semaphore'); + expect(rendered).toContain('cv_semaphore-ops'); + expect(rendered).toContain('Semaphore operations'); + + // Press Enter on cv_semaphore-ops + selector.handleInput(ENTER); + expect(onSelect).toHaveBeenCalledWith(semaphoreOps); + }); + + it('filters items with search query', () => { + const onSelect = vi.fn(); + const onCancel = vi.fn(); + const selector = new SkillSelectorComponent({ + skills, + searchable: true, + onSelect, + onCancel, + }); + + // Type search 'uncat' at root + selector.handleInput('u'); + selector.handleInput('n'); + selector.handleInput('c'); + selector.handleInput('a'); + selector.handleInput('t'); + + const rendered = text(selector); + expect(rendered).toContain('Uncategorized'); + expect(rendered).not.toContain(' cv\n'); + }); + + it('cycles through top-level group tabs with Tab key like /model chooser', () => { + const onSelect = vi.fn(); + const onCancel = vi.fn(); + const selector = new SkillSelectorComponent({ + skills, + onSelect, + onCancel, + }); + + // Initial state: "All" tab active + let rendered = text(selector); + expect(rendered).toContain('Select skill group'); + + // Press Tab to cycle to next tab ("cv") + selector.handleInput(TAB); + rendered = text(selector); + expect(rendered).toContain('Skills › cv'); + + // Press Tab to cycle to next tab ("Uncategorized") + selector.handleInput(TAB); + rendered = text(selector); + expect(rendered).toContain('Skills › Uncategorized'); + + // Press Tab again to wrap back to "All" tab + selector.handleInput(TAB); + rendered = text(selector); + expect(rendered).toContain('Select skill group'); + }); +}); diff --git a/packages/agent-core-v2/src/features/skill/catalog/types.ts b/packages/agent-core-v2/src/features/skill/catalog/types.ts index 5bb3a55ef3..c0d01de9c5 100644 --- a/packages/agent-core-v2/src/features/skill/catalog/types.ts +++ b/packages/agent-core-v2/src/features/skill/catalog/types.ts @@ -1,14 +1,20 @@ export type SkillSource = 'project' | 'user' | 'extra' | 'builtin'; export interface SkillMetadata { - readonly name?: string | undefined; - readonly description?: string | undefined; - readonly type?: string | undefined; - readonly whenToUse?: string | undefined; - readonly disableModelInvocation?: boolean | undefined; - readonly isSubSkill?: boolean | undefined; - readonly safe?: boolean | undefined; - readonly arguments?: readonly unknown[] | string | undefined; + readonly name?: string; + readonly description?: string; + readonly type?: string; + readonly whenToUse?: string; + readonly disableModelInvocation?: boolean; + readonly isSubSkill?: boolean; + readonly safe?: boolean; + readonly arguments?: readonly unknown[] | string; + readonly category?: string; + readonly categories?: readonly string[] | string; + readonly issuer?: string; + readonly collection?: string; + readonly groups?: readonly string[]; + readonly tags?: readonly string[]; readonly [key: string]: unknown; } @@ -21,7 +27,7 @@ export interface SkillDefinition { readonly metadata: SkillMetadata; readonly source: SkillSource; readonly plugin?: SkillPluginContext; - readonly mermaid?: string | undefined; + readonly mermaid?: string; readonly d2?: string; readonly productSpecific?: boolean; readonly experimentalFlag?: string; @@ -32,9 +38,15 @@ export interface SkillSummary { readonly description: string; readonly path: string; readonly source: SkillSource; - readonly type?: string | undefined; - readonly disableModelInvocation?: boolean | undefined; - readonly isSubSkill?: boolean | undefined; + readonly type?: string; + readonly disableModelInvocation?: boolean; + readonly isSubSkill?: boolean; + readonly category?: string; + readonly categories?: readonly string[]; + readonly issuer?: string; + readonly collection?: string; + readonly groups?: readonly string[]; + readonly tags?: readonly string[]; } export interface SkillRoot { @@ -95,5 +107,15 @@ export function summarizeSkill(skill: SkillDefinition): SkillSummary { type: skill.metadata.type, disableModelInvocation: skill.metadata.disableModelInvocation, isSubSkill: skill.metadata.isSubSkill, + category: typeof skill.metadata.category === 'string' && skill.metadata.category.trim() !== '' ? skill.metadata.category.trim() : undefined, + categories: Array.isArray(skill.metadata.categories) + ? skill.metadata.categories.filter((c): c is string => typeof c === 'string' && c.trim() !== '') + : typeof skill.metadata.categories === 'string' && skill.metadata.categories.trim() !== '' + ? [skill.metadata.categories.trim()] + : undefined, + issuer: typeof skill.metadata.issuer === 'string' && skill.metadata.issuer.trim() !== '' ? skill.metadata.issuer.trim() : undefined, + collection: typeof skill.metadata.collection === 'string' && skill.metadata.collection.trim() !== '' ? skill.metadata.collection.trim() : undefined, + groups: Array.isArray(skill.metadata.groups) ? skill.metadata.groups.filter((g): g is string => typeof g === 'string' && g.trim() !== '') : undefined, + tags: Array.isArray(skill.metadata.tags) ? skill.metadata.tags.filter((t): t is string => typeof t === 'string' && t.trim() !== '') : undefined, }; } diff --git a/packages/agent-core-v2/test/features/skill/catalog/parser.test.ts b/packages/agent-core-v2/test/features/skill/catalog/parser.test.ts index 10d2bd2490..354bfec563 100644 --- a/packages/agent-core-v2/test/features/skill/catalog/parser.test.ts +++ b/packages/agent-core-v2/test/features/skill/catalog/parser.test.ts @@ -85,4 +85,29 @@ describe('parseSkillText', () => { expect(skill.mermaid).toBe('graph TD'); expect(skill.d2).toBe('x -> y'); }); + + it('parses category, issuer, collection, groups, and tags frontmatter fields', () => { + const skill = parseSkillText({ + skillMdPath: '/skills/cv_ssh-ops/SKILL.md', + skillDirName: 'cv_ssh-ops', + source: 'user', + text: [ + '---', + 'name: cv_ssh-ops', + 'description: SSH ops', + 'category: ops', + 'issuer: creatiVision', + 'collection: cv-infrastructure', + 'groups: [cv, cv/ops]', + 'tags: [cv, ssh]', + '---', + 'body', + ].join('\n'), + }); + expect(skill.metadata.category).toBe('ops'); + expect(skill.metadata.issuer).toBe('creatiVision'); + expect(skill.metadata.collection).toBe('cv-infrastructure'); + expect(skill.metadata.groups).toEqual(['cv', 'cv/ops']); + expect(skill.metadata.tags).toEqual(['cv', 'ssh']); + }); }); diff --git a/packages/agent-core-v2/test/features/skill/catalog/types.test.ts b/packages/agent-core-v2/test/features/skill/catalog/types.test.ts index 1eac4f70bd..4233dc4e31 100644 --- a/packages/agent-core-v2/test/features/skill/catalog/types.test.ts +++ b/packages/agent-core-v2/test/features/skill/catalog/types.test.ts @@ -38,7 +38,7 @@ describe('skill/types', () => { path: '/skills/commit', source: 'user', metadata: { type: 'prompt', disableModelInvocation: false, isSubSkill: false }, - } as SkillDefinition; + } as unknown as SkillDefinition; expect(summarizeSkill(skill)).toEqual({ name: 'commit', description: 'Commit helper', @@ -49,4 +49,33 @@ describe('skill/types', () => { isSubSkill: false, }); }); + + it('summarizeSkill projects optional category, issuer, collection, groups, tags', () => { + const skill: SkillDefinition = { + name: 'cv_ssh-ops', + description: 'SSH ops', + path: '/skills/cv_ssh-ops', + source: 'user', + metadata: { + type: 'prompt', + category: 'ops', + issuer: 'creatiVision', + collection: 'cv-infrastructure', + groups: ['cv', 'cv/ops'], + tags: ['cv', 'ssh'], + }, + } as unknown as SkillDefinition; + expect(summarizeSkill(skill)).toEqual({ + name: 'cv_ssh-ops', + description: 'SSH ops', + path: '/skills/cv_ssh-ops', + source: 'user', + type: 'prompt', + category: 'ops', + issuer: 'creatiVision', + collection: 'cv-infrastructure', + groups: ['cv', 'cv/ops'], + tags: ['cv', 'ssh'], + }); + }); }); diff --git a/packages/agent-core/src/rpc/core-api.ts b/packages/agent-core/src/rpc/core-api.ts index 787eef6b35..ae61eadf0d 100644 --- a/packages/agent-core/src/rpc/core-api.ts +++ b/packages/agent-core/src/rpc/core-api.ts @@ -48,17 +48,17 @@ export type EmptyPayload = {}; export type SessionMetadataPatch = Partial>; export interface ClientTelemetryInfo { - readonly id?: string | undefined; - readonly name?: string | undefined; - readonly version?: string | undefined; - readonly uiMode?: string | undefined; + readonly id?: string; + readonly name?: string; + readonly version?: string; + readonly uiMode?: string; } export interface CreateSessionPayload { - readonly id?: string | undefined; + readonly id?: string; readonly workDir: string; - readonly model?: string | undefined; - readonly thinking?: string | undefined; + readonly model?: string; + readonly thinking?: string; readonly permission?: PermissionMode | undefined; readonly metadata?: JsonObject | undefined; readonly mcpServers?: Readonly>; @@ -123,26 +123,26 @@ export interface ForkSessionPayload { } export interface ShellEnvironment { - readonly term?: string | undefined; - readonly termProgram?: string | undefined; - readonly termProgramVersion?: string | undefined; - readonly multiplexer?: string | undefined; - readonly shell?: string | undefined; + readonly term?: string; + readonly termProgram?: string; + readonly termProgramVersion?: string; + readonly multiplexer?: string; + readonly shell?: string; } export interface ExportSessionPayload { readonly sessionId: string; - readonly outputPath?: string | undefined; + readonly outputPath?: string; /** * When true, the active global diagnostic log (`$KIMI_CODE_HOME/logs/kimi-code.log`) * is copied into the zip at `logs/global/kimi-code.log`. Off by default to * avoid bundling events from concurrent sessions / other projects. */ - readonly includeGlobalLog?: boolean | undefined; + readonly includeGlobalLog?: boolean; /** Host version to record in the export manifest. */ readonly version: string; /** How the CLI was installed (e.g. 'npm-global', 'native'). */ - readonly installSource?: string | undefined; + readonly installSource?: string; readonly shellEnv?: ShellEnvironment | undefined; } @@ -153,16 +153,16 @@ export interface ExportSessionManifest { readonly wireProtocolVersion: string; readonly os: string; readonly nodejsVersion: string; - readonly sessionFirstActivity?: string | undefined; - readonly sessionLastActivity?: string | undefined; - readonly title?: string | undefined; - readonly workspaceDir?: string | undefined; + readonly sessionFirstActivity?: string; + readonly sessionLastActivity?: string; + readonly title?: string; + readonly workspaceDir?: string; /** zip-relative path to the session diagnostic log when present. */ - readonly sessionLogPath?: string | undefined; + readonly sessionLogPath?: string; /** zip-relative path to the bundled global diagnostic log (only when --include-global-log). */ - readonly globalLogPath?: string | undefined; + readonly globalLogPath?: string; /** How the CLI was installed (e.g. 'npm-global', 'native'). */ - readonly installSource?: string | undefined; + readonly installSource?: string; readonly shellEnv?: ShellEnvironment | undefined; } @@ -185,13 +185,13 @@ export interface CoreInfo { export interface SessionSummary { readonly id: string; - readonly title?: string | undefined; + readonly title?: string; readonly lastPrompt?: string; readonly workDir: string; readonly sessionDir: string; readonly createdAt: number; readonly updatedAt: number; - readonly archived?: boolean | undefined; + readonly archived?: boolean; readonly metadata?: JsonObject | undefined; readonly additionalDirs?: readonly string[]; } @@ -247,7 +247,7 @@ export interface SetModelPayload { } export interface SetModelResult { readonly model: string; - readonly providerName?: string | undefined; + readonly providerName?: string; } export interface CancelPlanPayload { readonly id?: string; @@ -306,14 +306,20 @@ export interface SkillSummary { readonly description: string; readonly path: string; readonly source: 'builtin' | 'user' | 'extra' | 'project'; - readonly type?: string | undefined; - readonly disableModelInvocation?: boolean | undefined; - readonly isSubSkill?: boolean | undefined; + readonly type?: string; + readonly disableModelInvocation?: boolean; + readonly isSubSkill?: boolean; + readonly category?: string; + readonly categories?: readonly string[]; + readonly issuer?: string; + readonly collection?: string; + readonly groups?: readonly string[]; + readonly tags?: readonly string[]; } export interface ActivateSkillPayload { readonly name: string; - readonly args?: string | undefined; + readonly args?: string; } export interface ListWorkspaceSkillsPayload { @@ -323,7 +329,7 @@ export interface ListWorkspaceSkillsPayload { export interface ActivatePluginCommandPayload { readonly pluginId: string; readonly commandName: string; - readonly args?: string | undefined; + readonly args?: string; } export interface McpServerInfo { diff --git a/packages/agent-core/src/skill/types.ts b/packages/agent-core/src/skill/types.ts index 98a1928acb..66f4c9f990 100644 --- a/packages/agent-core/src/skill/types.ts +++ b/packages/agent-core/src/skill/types.ts @@ -1,14 +1,20 @@ export type SkillSource = 'project' | 'user' | 'extra' | 'builtin'; export interface SkillMetadata { - readonly name?: string | undefined; - readonly description?: string | undefined; - readonly type?: string | undefined; - readonly whenToUse?: string | undefined; - readonly disableModelInvocation?: boolean | undefined; - readonly isSubSkill?: boolean | undefined; - readonly safe?: boolean | undefined; - readonly arguments?: readonly unknown[] | string | undefined; + readonly name?: string; + readonly description?: string; + readonly type?: string; + readonly whenToUse?: string; + readonly disableModelInvocation?: boolean; + readonly isSubSkill?: boolean; + readonly safe?: boolean; + readonly arguments?: readonly unknown[] | string; + readonly category?: string; + readonly categories?: readonly string[] | string; + readonly issuer?: string; + readonly collection?: string; + readonly groups?: readonly string[]; + readonly tags?: readonly string[]; readonly [key: string]: unknown; } @@ -21,7 +27,7 @@ export interface SkillDefinition { readonly metadata: SkillMetadata; readonly source: SkillSource; readonly plugin?: SkillPluginContext; - readonly mermaid?: string | undefined; + readonly mermaid?: string; readonly d2?: string; } @@ -30,9 +36,15 @@ export interface SkillSummary { readonly description: string; readonly path: string; readonly source: SkillSource; - readonly type?: string | undefined; - readonly disableModelInvocation?: boolean | undefined; - readonly isSubSkill?: boolean | undefined; + readonly type?: string; + readonly disableModelInvocation?: boolean; + readonly isSubSkill?: boolean; + readonly category?: string; + readonly categories?: readonly string[]; + readonly issuer?: string; + readonly collection?: string; + readonly groups?: readonly string[]; + readonly tags?: readonly string[]; } export interface SkillRoot { @@ -90,5 +102,15 @@ export function summarizeSkill(skill: SkillDefinition): SkillSummary { type: skill.metadata.type, disableModelInvocation: skill.metadata.disableModelInvocation, isSubSkill: skill.metadata.isSubSkill, + category: typeof skill.metadata.category === 'string' && skill.metadata.category.trim() !== '' ? skill.metadata.category.trim() : undefined, + categories: Array.isArray(skill.metadata.categories) + ? skill.metadata.categories.filter((c): c is string => typeof c === 'string' && c.trim() !== '') + : typeof skill.metadata.categories === 'string' && skill.metadata.categories.trim() !== '' + ? [skill.metadata.categories.trim()] + : undefined, + issuer: typeof skill.metadata.issuer === 'string' && skill.metadata.issuer.trim() !== '' ? skill.metadata.issuer.trim() : undefined, + collection: typeof skill.metadata.collection === 'string' && skill.metadata.collection.trim() !== '' ? skill.metadata.collection.trim() : undefined, + groups: Array.isArray(skill.metadata.groups) ? skill.metadata.groups.filter((g): g is string => typeof g === 'string' && g.trim() !== '') : undefined, + tags: Array.isArray(skill.metadata.tags) ? skill.metadata.tags.filter((t): t is string => typeof t === 'string' && t.trim() !== '') : undefined, }; }