@seele00/seele 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LEGAL.md +7 -0
- package/README.md +76 -0
- package/bin/seele-codex +58 -0
- package/codex/dist/app-server.js +63 -0
- package/codex/dist/errors.js +16 -0
- package/codex/dist/index.js +4 -0
- package/codex/dist/rpc-client.js +96 -0
- package/codex/dist/transports/stdio.js +81 -0
- package/codex/dist/types.js +1 -0
- package/codex/package.json +12 -0
- package/package.json +24 -0
- package/scripts/deploy/bootstrap.sh +318 -0
- package/scripts/deploy/npm/postinstall.mjs +10 -0
- package/scripts/deploy/prepare-proxy.sh +273 -0
- package/scripts/deploy/seele.env.example +75 -0
- package/scripts/deploy/start.sh +101 -0
- package/server/dist/auth/session.js +71 -0
- package/server/dist/auth/users.js +192 -0
- package/server/dist/codex-runtime/run-streamed-turn.js +587 -0
- package/server/dist/config/config.js +71 -0
- package/server/dist/contracts/artifact-rendering.js +14 -0
- package/server/dist/contracts/global-environment.js +23 -0
- package/server/dist/contracts/index.js +114 -0
- package/server/dist/contracts/managed-assets.js +13 -0
- package/server/dist/contracts/response-style.js +23 -0
- package/server/dist/contracts/task-clarification.js +13 -0
- package/server/dist/contracts/types.js +1 -0
- package/server/dist/contracts/wakeup.js +13 -0
- package/server/dist/contracts/workspace-boundary.js +20 -0
- package/server/dist/contracts/workspace-knowledge.js +48 -0
- package/server/dist/contracts/workspace-memory.js +32 -0
- package/server/dist/contracts/workspace-responsibility.js +23 -0
- package/server/dist/contracts/workspace-transcript.js +26 -0
- package/server/dist/conversations/knowledge.js +380 -0
- package/server/dist/conversations/store.js +2376 -0
- package/server/dist/doctor.js +105 -0
- package/server/dist/realtime/sse.js +12 -0
- package/server/dist/runtime-worker/client.js +405 -0
- package/server/dist/runtime-worker/process.js +216 -0
- package/server/dist/runtime-worker/protocol.js +1 -0
- package/server/dist/server.js +4570 -0
- package/server/dist/storage/sqlite.js +39 -0
- package/web/dist/assets/abnfDiagram-VRR7QNED-DevTexTl.js +1 -0
- package/web/dist/assets/arc-WlXuN6B_.js +1 -0
- package/web/dist/assets/architectureDiagram-ZJ3FMSHR-DJYRAqSp.js +36 -0
- package/web/dist/assets/bash-BELqPA7S.js +1 -0
- package/web/dist/assets/blockDiagram-677ZJIJ3-CsjO1oTv.js +132 -0
- package/web/dist/assets/c4Diagram-LMCZKHZV-DjUCYgVk.js +10 -0
- package/web/dist/assets/channel-DGnywxBx.js +1 -0
- package/web/dist/assets/chunk-2Q5K7J3B-By6S-6eo.js +1 -0
- package/web/dist/assets/chunk-32BRIVSS-Cl-hXbZD.js +1 -0
- package/web/dist/assets/chunk-5VM5RSS4--cWPnxlT.js +15 -0
- package/web/dist/assets/chunk-EX3LRPZG-PakDrWLX.js +231 -0
- package/web/dist/assets/chunk-JWPE2WC7-DMfuuvGl.js +1 -0
- package/web/dist/assets/chunk-MOJQB5TN-BHD_IRop.js +88 -0
- package/web/dist/assets/chunk-RYQCIY6F-T4jqSvsD.js +1 -0
- package/web/dist/assets/chunk-V7JOEXUC-C4paE6t8.js +206 -0
- package/web/dist/assets/chunk-VR4S4FIN-F5foapWH.js +1 -0
- package/web/dist/assets/chunk-XXDRQBXY-Dp4WIFPJ.js +1 -0
- package/web/dist/assets/classDiagram-OUVF2IWQ-DjHXtkKr.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DjHXtkKr.js +1 -0
- package/web/dist/assets/core-CGjsG6g4.js +12 -0
- package/web/dist/assets/cose-bilkent-JH36ORCC-DcMU2oKv.js +1 -0
- package/web/dist/assets/css-CLj8gQPS.js +1 -0
- package/web/dist/assets/cynefin-VYW2F7L2-SiDUbAfJ.js +178 -0
- package/web/dist/assets/cynefinDiagram-TSTJHNR4-DhkNlW7i.js +62 -0
- package/web/dist/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/web/dist/assets/dagre-VKFMJZFB-Co--CY4-.js +4 -0
- package/web/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/web/dist/assets/diagram-FQU43EPY-BZs6G_Wi.js +3 -0
- package/web/dist/assets/diagram-G47NLZAW-C6SAe39v.js +24 -0
- package/web/dist/assets/diagram-NH7WQ7WH-D6EoRzQM.js +24 -0
- package/web/dist/assets/diagram-OA4YK3LP-kHe4KJ_b.js +30 -0
- package/web/dist/assets/diagram-WEI45ONY-BM-NnNEq.js +41 -0
- package/web/dist/assets/diff-D97Zzqfu.js +1 -0
- package/web/dist/assets/dockerfile-BcOcwvcX.js +1 -0
- package/web/dist/assets/ebnfDiagram-CCIWWBDH-BfwqR7DU.js +1 -0
- package/web/dist/assets/engine-javascript-DBd1bXLz.js +141 -0
- package/web/dist/assets/erDiagram-Q63AITRT-BwUkv7nL.js +85 -0
- package/web/dist/assets/flowDiagram-23GEKE2U-Cn0zH9bm.js +156 -0
- package/web/dist/assets/ganttDiagram-NO4QXBWP-BY_VLaEQ.js +292 -0
- package/web/dist/assets/gitGraphDiagram-IHSO6WYX-D0xpVnfm.js +106 -0
- package/web/dist/assets/github-light-DAi9KRSo.js +1 -0
- package/web/dist/assets/graph-C9eacEi8.js +1 -0
- package/web/dist/assets/html-pp8916En.js +1 -0
- package/web/dist/assets/index-Bl4JO4M7.css +1 -0
- package/web/dist/assets/index-D9Ao6WQl.js +111 -0
- package/web/dist/assets/infoDiagram-FWYZ7A6U-DnmnPGAH.js +2 -0
- package/web/dist/assets/init-Gi6I4Gst.js +1 -0
- package/web/dist/assets/ishikawaDiagram-FXEZZL3T-DTWLm3ZQ.js +70 -0
- package/web/dist/assets/java-CylS5w8V.js +1 -0
- package/web/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/web/dist/assets/journeyDiagram-5HDEW3XC-RN13a5iK.js +139 -0
- package/web/dist/assets/json-Cp-IABpG.js +1 -0
- package/web/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/web/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/web/dist/assets/kanban-definition-HUTT4EX6-CvmlJTH9.js +89 -0
- package/web/dist/assets/katex-C5jXJg4s.js +257 -0
- package/web/dist/assets/layout-DEXfKzaS.js +1 -0
- package/web/dist/assets/linear-zHsglUI0.js +1 -0
- package/web/dist/assets/map-Czzmt4hB.js +1 -0
- package/web/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/web/dist/assets/mermaid.core-Bfj9YagN.js +314 -0
- package/web/dist/assets/mindmap-definition-LN4V7U3C-CkcLeMWS.js +96 -0
- package/web/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/web/dist/assets/pegDiagram-2B236MQR-eturQJg0.js +1 -0
- package/web/dist/assets/pieDiagram-ENE6RG2P-DJmmSZSO.js +39 -0
- package/web/dist/assets/python-B6aJPvgy.js +1 -0
- package/web/dist/assets/quadrantDiagram-ABIIQ3AL-Br5y_5ZO.js +7 -0
- package/web/dist/assets/railroadDiagram-RFXS5EU6-DwnwvUqm.js +1 -0
- package/web/dist/assets/requirementDiagram-TGXJPOKE-CMMKGrPQ.js +84 -0
- package/web/dist/assets/sankeyDiagram-HTMAVEWB-BKP-cLrV.js +40 -0
- package/web/dist/assets/sequenceDiagram-DBY2YBRQ-YgkgEj_6.js +162 -0
- package/web/dist/assets/sizeCapture-X5ZJPWSS-nkigHDeZ.js +1 -0
- package/web/dist/assets/sql-CRqJ_cUM.js +1 -0
- package/web/dist/assets/stateDiagram-2N3HPSRC-CEoMK2Kt.js +1 -0
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB--iEtUEGo.js +1 -0
- package/web/dist/assets/swimlanes-5IMT3BWC-Co9CmBP_.js +2 -0
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BzapPKvi.js +8 -0
- package/web/dist/assets/timeline-definition-FHXFAJF6-C5njALNw.js +120 -0
- package/web/dist/assets/toml-vGWfd6FD.js +1 -0
- package/web/dist/assets/tsx-COt5Ahok.js +1 -0
- package/web/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/web/dist/assets/vennDiagram-L72KCM5P-BpvLQRHS.js +34 -0
- package/web/dist/assets/wardleyDiagram-EHGQE667-CWINCOno.js +78 -0
- package/web/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/web/dist/assets/xychartDiagram-FW5EYKEG-xDH3ABG4.js +7 -0
- package/web/dist/assets/yaml-Buea-lGh.js +1 -0
- package/web/dist/index.html +13 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var zt=Object.defineProperty;var Ut=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Ut(n,typeof e!="symbol"?e+"":e,t);import{w as Ge,s as ct,f as Kt,a as Yt,b as Vt,c as Fe,h as Jt}from"./index-D9Ao6WQl.js";const qe={}.hasOwnProperty;function Qt(n,e){const t=e||{};function r(s,...i){let a=r.invalid;const o=r.handlers;if(s&&qe.call(s,n)){const c=String(s[n]);a=qe.call(o,c)?o[c]:r.unknown}if(a)return a.call(this,s,...i)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}var R=class extends Error{constructor(n){super(n),this.name="ShikiError"}};function Xt(n){return Be(n)}function Be(n){return Array.isArray(n)?Zt(n):n instanceof RegExp?n:typeof n=="object"?en(n):n}function Zt(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=Be(n[t]);return e}function en(n){let e={};for(let t in n)e[t]=Be(n[t]);return e}function lt(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function ut(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?ut(n.substring(0,n.length-1)):n.substr(~e+1)}var Se=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ee=class{static hasCaptures(n){return n===null?!1:(Se.lastIndex=0,Se.test(n))}static replaceCaptures(n,e,t){return n.replace(Se,(r,s,i,a)=>{let o=t[parseInt(s||i,10)];if(o){let c=e.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(a){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function ht(n,e){return n<e?-1:n>e?1:0}function ft(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let i=ht(n[s],e[s]);if(i!==0)return i}return 0}return t-r}function He(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function dt(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var gt=class{constructor(n){d(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ie=class{constructor(n,e,t){d(this,"_cachedMatchRoot",new gt(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(rn(n),e)}static createFromParsedTheme(n,e){return an(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>tn(n.parent,s.parentScopes));return r?new mt(r.fontStyle,r.foreground,r.background):null}},Ce=class re{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new re(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new re(t,e[r]);return t}push(e){return new re(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function tn(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!nn(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function nn(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var mt=class{constructor(n,e,t){this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function rn(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,i=e.length;s<i;s++){let a=e[s];if(!a.settings)continue;let o;if(typeof a.scope=="string"){let u=a.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),o=u.split(",")}else Array.isArray(a.scope)?o=a.scope:o=[""];let c=-1;if(typeof a.settings.fontStyle=="string"){c=0;let u=a.settings.fontStyle.split(" ");for(let f=0,g=u.length;f<g;f++)switch(u[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof a.settings.foreground=="string"&&He(a.settings.foreground)&&(l=a.settings.foreground);let h=null;typeof a.settings.background=="string"&&He(a.settings.background)&&(h=a.settings.background);for(let u=0,f=o.length;u<f;u++){let m=o[u].trim().split(" "),S=m[m.length-1],b=null;m.length>1&&(b=m.slice(0,m.length-1),b.reverse()),t[r++]=new sn(S,b,s,c,l,h)}}return t}var sn=class{constructor(n,e,t,r,s,i){this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=i}},T=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(T||{});function an(n,e){n.sort((c,l)=>{let h=ht(c.scope,l.scope);return h!==0||(h=ft(c.parentScopes,l.parentScopes),h!==0)?h:c.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let c=n.shift();c.fontStyle!==-1&&(t=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let i=new on(e),a=new mt(t,i.getId(r),i.getId(s)),o=new ln(new ve(0,null,-1,0,0),[]);for(let c=0,l=n.length;c<l;c++){let h=n[c];o.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new ie(i,a,o)}var on=class{constructor(n){d(this,"_isFrozen");d(this,"_lastColorId");d(this,"_id2color");d(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},cn=Object.freeze([]),ve=class pt{constructor(e,t,r,s,i){d(this,"scopeDepth");d(this,"parentScopes");d(this,"fontStyle");d(this,"foreground");d(this,"background");this.scopeDepth=e,this.parentScopes=t||cn,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new pt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},ln=class Te{constructor(e,t=[],r={}){d(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const i=t.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(Te._cmpBySpecificity),t}insert(e,t,r,s,i,a){if(t===""){this._doInsertHere(e,r,s,i,a);return}let o=t.indexOf("."),c,l;o===-1?(c=t,l=""):(c=t.substring(0,o),l=t.substring(o+1));let h;this._children.hasOwnProperty(c)?h=this._children[c]:(h=new Te(this._mainRule.clone(),ve.cloneArr(this._rulesWithParentScopes)),this._children[c]=h),h.insert(e+1,l,r,s,i,a)}_doInsertHere(e,t,r,s,i){if(t===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let c=this._rulesWithParentScopes[a];if(ft(c.parentScopes,t)===0){c.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ve(e,t,r,s,i))}},F=class E{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=E.getLanguageId(e),r=E.getTokenType(e),s=E.getFontStyle(e),i=E.getForeground(e),a=E.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:i,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,t,r,s,i,a,o){let c=E.getLanguageId(e),l=E.getTokenType(e),h=E.containsBalancedBrackets(e)?1:0,u=E.getFontStyle(e),f=E.getForeground(e),g=E.getBackground(e);return t!==0&&(c=t),r!==8&&(l=r),s!==null&&(h=s?1:0),i!==-1&&(u=i),a!==0&&(f=a),o!==0&&(g=o),(c<<0|l<<8|h<<10|u<<11|f<<15|g<<24)>>>0}};function ae(n,e){const t=[],r=un(n);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=a();if(t.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return t;function i(){if(s==="-"){s=r.next();const c=i();return l=>!!c&&!c(l)}if(s==="("){s=r.next();const c=o();return s===")"&&(s=r.next()),c}if(ze(s)){const c=[];do c.push(s),s=r.next();while(ze(s));return l=>e(c,l)}return null}function a(){const c=[];let l=i();for(;l;)c.push(l),l=i();return h=>c.every(u=>u(h))}function o(){const c=[];let l=a();for(;l&&(c.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=a()}return h=>c.some(u=>u(h))}}function ze(n){return!!n&&!!n.match(/[\w\.:]+/)}function un(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function _t(n){typeof n.dispose=="function"&&n.dispose()}var K=class{constructor(n){this.scopeName=n}toKey(){return this.scopeName}},hn=class{constructor(n,e){this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},fn=class{constructor(){d(this,"_references",[]);d(this,"_seenReferenceKeys",new Set);d(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},dn=class{constructor(n,e){d(this,"seenFullScopeRequests",new Set);d(this,"seenPartialScopeRequests",new Set);d(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new K(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new fn;for(const t of n)gn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof K){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function gn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=t.lookup(e);n instanceof K?se({baseGrammar:i,selfGrammar:s},r):Ae(n.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const a=t.injections(n.scopeName);if(a)for(const o of a)r.add(new K(o))}function Ae(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];oe([r],e,t)}}function se(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&oe(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&oe(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function oe(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?lt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&oe(r.patterns,{...e,repository:s},t);const i=r.include;if(!i)continue;const a=yt(i);switch(a.kind){case 0:se({...e,selfGrammar:e.baseGrammar},t);break;case 1:se(e,t);break;case 2:Ae(a.ruleName,{...e,repository:s},t);break;case 3:case 4:const o=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(o){const c={baseGrammar:e.baseGrammar,selfGrammar:o,repository:s};a.kind===4?Ae(a.ruleName,c,t):se(c,t)}else a.kind===4?t.add(new hn(a.scopeName,a.ruleName)):t.add(new K(a.scopeName));break}}}var mn=class{constructor(){d(this,"kind",0)}},pn=class{constructor(){d(this,"kind",1)}},_n=class{constructor(n){d(this,"kind",2);this.ruleName=n}},yn=class{constructor(n){d(this,"kind",3);this.scopeName=n}},bn=class{constructor(n,e){d(this,"kind",4);this.scopeName=n,this.ruleName=e}};function yt(n){if(n==="$base")return new mn;if(n==="$self")return new pn;const e=n.indexOf("#");if(e===-1)return new yn(n);if(e===0)return new _n(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new bn(t,r)}}var Sn=/\\(\d+)/,Ue=/\\(\d+)/g,Cn=-1,bt=-2;var Z=class{constructor(n,e,t,r){d(this,"$location");d(this,"id");d(this,"_nameIsCapturing");d(this,"_name");d(this,"_contentNameIsCapturing");d(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=ee.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ee.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${ut(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:ee.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ee.replaceCaptures(this._contentName,n,e)}},wn=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},kn=class extends Z{constructor(e,t,r,s,i){super(e,t,r,null);d(this,"_match");d(this,"captures");d(this,"_cachedCompiledPatterns");this._match=new Y(s,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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ke=class extends Z{constructor(e,t,r,s,i){super(e,t,r,s);d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");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 r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new V,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ie=class extends Z{constructor(e,t,r,s,i,a,o,c,l,h){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"_end");d(this,"endHasBackReferences");d(this,"endCaptures");d(this,"applyEndPatternLast");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");this._begin=new Y(i,this.id),this.beginCaptures=a,this._end=new Y(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=l||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;for(const r of this.patterns)e.getRule(r).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}},ce=class extends Z{constructor(e,t,r,s,i,a,o,c,l){super(e,t,r,s);d(this,"_begin");d(this,"beginCaptures");d(this,"whileCaptures");d(this,"_while");d(this,"whileHasBackReferences");d(this,"hasMissingPatterns");d(this,"patterns");d(this,"_cachedCompiledPatterns");d(this,"_cachedCompiledWhilePatterns");this._begin=new Y(i,this.id),this.beginCaptures=a,this.whileCaptures=c,this._while=new Y(o,bt),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,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new V;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,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new V,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},St=class v{static createCaptureRule(e,t,r,s,i){return e.registerRule(a=>new wn(t,a,r,s,i))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new kn(e.$vscodeTextmateLocation,e.id,e.name,e.match,v._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=lt({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Ke(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,v._compilePatterns(i,t,r))}return e.while?new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,v._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,v._compileCaptures(e.whileCaptures||e.captures,t,r),v._compilePatterns(e.patterns,t,r)):new Ie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,v._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,v._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,v._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let i=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const o=parseInt(a,10);o>i&&(i=o)}for(let a=0;a<=i;a++)s[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const o=parseInt(a,10);let c=0;e[a].patterns&&(c=v.getCompiledRuleId(e[a],t,r)),s[o]=v.createCaptureRule(t,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,c)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let i=0,a=e.length;i<a;i++){const o=e[i];let c=-1;if(o.include){const l=yt(o.include);switch(l.kind){case 0:case 1:c=v.getCompiledRuleId(r[o.include],t,r);break;case 2:let h=r[l.ruleName];h&&(c=v.getCompiledRuleId(h,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,g=t.getExternalGrammar(u,r);if(g)if(f){let m=g.repository[f];m&&(c=v.getCompiledRuleId(m,t,g.repository))}else c=v.getCompiledRuleId(g.repository.$self,t,g.repository);break}}else c=v.getCompiledRuleId(o,t,r);if(c!==-1){const l=t.getRule(c);let h=!1;if((l instanceof Ke||l instanceof Ie||l instanceof ce)&&l.hasMissingPatterns&&l.patterns.length===0&&(h=!0),h)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},Y=class Ct{constructor(e,t){d(this,"source");d(this,"ruleId");d(this,"hasAnchor");d(this,"hasBackReferences");d(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,i=[],a=!1;for(let o=0;o<r;o++)if(e.charAt(o)==="\\"&&o+1<r){const l=e.charAt(o+1);l==="z"?(i.push(e.substring(s,o)),i.push("$(?!\\n)(?<!\\n)"),s=o+2):(l==="A"||l==="G")&&(a=!0),o++}this.hasAnchor=a,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=Sn.test(this.source):this.hasBackReferences=!1}clone(){return new Ct(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return Ue.lastIndex=0,this.source.replace(Ue,(s,i)=>dt(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],i,a,o,c;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,r[i]=o,s[i]=o,o==="\\"&&i+1<a&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",t[i+1]="",r[i+1]="A",s[i+1]="A"):c==="G"?(e[i+1]="",t[i+1]="G",r[i+1]="",s[i+1]="G"):(e[i+1]=c,t[i+1]=c,r[i+1]=c,s[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},V=class{constructor(){d(this,"_items");d(this,"_hasAnchors");d(this,"_cached");d(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new Ye(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new Ye(n,r,this._items.map(s=>s.ruleId))}},Ye=class{constructor(n,e,t){d(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
|
|
2
|
+
`)}findNextMatchSync(n,e,t){const r=this.scanner.findNextMatchSync(n,e,t);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},we=class{constructor(n,e){this.languageId=n,this.tokenType=e}},G,Rn=(G=class{constructor(e,t){d(this,"_defaultAttributes");d(this,"_embeddedLanguagesMatcher");d(this,"_getBasicScopeAttributes",new gt(e=>{const t=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new we(t,r)}));this._defaultAttributes=new we(e,8),this._embeddedLanguagesMatcher=new Nn(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?G._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(G.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[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!")}},d(G,"_NULL_SCOPE_METADATA",new we(0,0)),d(G,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),G),Nn=class{constructor(n){d(this,"values");d(this,"scopesRegExp");if(n.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(n);const e=n.map(([t,r])=>dt(t));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(n){if(!this.scopesRegExp)return;const e=n.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Ve=class{constructor(n,e){this.stack=n,this.stoppedEarly=e}};function wt(n,e,t,r,s,i,a,o){const c=e.content.length;let l=!1,h=-1;if(a){const g=vn(n,e,t,r,s,i);s=g.stack,r=g.linePos,t=g.isFirstLine,h=g.anchorPosition}const u=Date.now();for(;!l;){if(o!==0&&Date.now()-u>o)return new Ve(s,!0);f()}return new Ve(s,!1);function f(){const g=Tn(n,e,t,r,s,h);if(!g){i.produce(s,c),l=!0;return}const m=g.captureIndices,S=g.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(S===Cn){const _=s.getRule(n);i.produce(s,m[0].start),s=s.withContentNameScopesList(s.nameScopesList),z(n,e,t,s,i,_.endCaptures,m),i.produce(s,m[0].end);const p=s;if(s=s.parent,h=p.getAnchorPos(),!b&&p.getEnterPos()===r){s=p,i.produce(s,c),l=!0;return}}else{const _=n.getRule(S);i.produce(s,m[0].start);const p=s,y=_.getName(e.content,m),w=s.contentNameScopesList.pushAttributed(y,n);if(s=s.push(S,r,h,m[0].end===c,null,w,w),_ instanceof Ie){const C=_;z(n,e,t,s,i,C.beginCaptures,m),i.produce(s,m[0].end),h=m[0].end;const k=C.getContentName(e.content,m),A=w.pushAttributed(k,n);if(s=s.withContentNameScopesList(A),C.endHasBackReferences&&(s=s.withEndRule(C.getEndWithResolvedBackReferences(e.content,m))),!b&&p.hasSameRuleAs(s)){s=s.pop(),i.produce(s,c),l=!0;return}}else if(_ instanceof ce){const C=_;z(n,e,t,s,i,C.beginCaptures,m),i.produce(s,m[0].end),h=m[0].end;const k=C.getContentName(e.content,m),A=w.pushAttributed(k,n);if(s=s.withContentNameScopesList(A),C.whileHasBackReferences&&(s=s.withEndRule(C.getWhileWithResolvedBackReferences(e.content,m))),!b&&p.hasSameRuleAs(s)){s=s.pop(),i.produce(s,c),l=!0;return}}else if(z(n,e,t,s,i,_.captures,m),i.produce(s,m[0].end),s=s.pop(),!b){s=s.safePop(),i.produce(s,c),l=!0;return}}m[0].end>r&&(r=m[0].end,t=!1)}}function vn(n,e,t,r,s,i){let a=s.beginRuleCapturedEOL?0:-1;const o=[];for(let c=s;c;c=c.pop()){const l=c.getRule(n);l instanceof ce&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:h}=En(c.rule,n,c.stack.endRule,t,r===a),u=l.findNextMatchSync(e,r,h);if(u){if(u.ruleId!==bt){s=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(i.produce(c.stack,u.captureIndices[0].start),z(n,e,t,c.stack,i,c.rule.whileCaptures,u.captureIndices),i.produce(c.stack,u.captureIndices[0].end),a=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,t=!1))}else{s=c.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:a,isFirstLine:t}}function Tn(n,e,t,r,s,i){const a=An(n,e,t,r,s,i),o=n.getInjections();if(o.length===0)return a;const c=In(o,n,e,t,r,s,i);if(!c)return a;if(!a)return c;const l=a.captureIndices[0].start,h=c.captureIndices[0].start;return h<l||c.priorityMatch&&h===l?c:a}function An(n,e,t,r,s,i){const a=s.getRule(n),{ruleScanner:o,findOptions:c}=kt(a,n,s.endRule,t,r===i),l=o.findNextMatchSync(e,r,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function In(n,e,t,r,s,i,a){let o=Number.MAX_VALUE,c=null,l,h=0;const u=i.contentNameScopesList.getScopeNames();for(let f=0,g=n.length;f<g;f++){const m=n[f];if(!m.matcher(u))continue;const S=e.getRule(m.ruleId),{ruleScanner:b,findOptions:_}=kt(S,e,null,r,s===a),p=b.findNextMatchSync(t,s,_);if(!p)continue;const y=p.captureIndices[0].start;if(!(y>=o)&&(o=y,c=p.captureIndices,l=p.ruleId,h=m.priority,o===s))break}return c?{priorityMatch:h===-1,captureIndices:c,matchedRuleId:l}:null}function kt(n,e,t,r,s){return{ruleScanner:n.compileAG(e,t,r,s),findOptions:0}}function En(n,e,t,r,s){return{ruleScanner:n.compileWhileAG(e,t,r,s),findOptions:0}}function z(n,e,t,r,s,i,a){if(i.length===0)return;const o=e.content,c=Math.min(i.length,a.length),l=[],h=a[0].end;for(let u=0;u<c;u++){const f=i[u];if(f===null)continue;const g=a[u];if(g.length===0)continue;if(g.start>h)break;for(;l.length>0&&l[l.length-1].endPos<=g.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,g.start):s.produce(r,g.start),f.retokenizeCapturedWithRuleId){const S=f.getName(o,a),b=r.contentNameScopesList.pushAttributed(S,n),_=f.getContentName(o,a),p=b.pushAttributed(_,n),y=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,b,p),w=n.createOnigString(o.substring(0,g.end));wt(n,w,t&&g.start===0,g.start,y,s,!1,0),_t(w);continue}const m=f.getName(o,a);if(m!==null){const b=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(m,n);l.push(new xn(b,g.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var xn=class{constructor(n,e){d(this,"scopes");d(this,"endPos");this.scopes=n,this.endPos=e}};function Ln(n,e,t,r,s,i,a,o){return new Gn(n,e,t,r,s,i,a,o)}function Je(n,e,t,r,s){const i=ae(e,le),a=St.getCompiledRuleId(t,r,s.repository);for(const o of i)n.push({debugSelector:e,matcher:o.matcher,ruleId:a,grammar:s,priority:o.priority})}function le(n,e){if(e.length<n.length)return!1;let t=0;return n.every(r=>{for(let s=t;s<e.length;s++)if(Pn(e[s],r))return t=s+1,!0;return!1})}function Pn(n,e){if(!n)return!1;if(n===e)return!0;const t=e.length;return n.length>t&&n.substr(0,t)===e&&n[t]==="."}var Gn=class{constructor(n,e,t,r,s,i,a,o){d(this,"_rootId");d(this,"_lastRuleId");d(this,"_ruleId2desc");d(this,"_includedGrammars");d(this,"_grammarRepository");d(this,"_grammar");d(this,"_injections");d(this,"_basicScopeAttributesProvider");d(this,"_tokenTypeMatchers");if(this._rootScopeName=n,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new Rn(t,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=Qe(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const l=ae(c,le);for(const h of l)this._tokenTypeMatchers.push({matcher:h.matcher,type:s[c]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const n of this._ruleId2desc)n&&n.dispose()}createOnigScanner(n){return this._onigLib.createOnigScanner(n)}createOnigString(n){return this._onigLib.createOnigString(n)}getMetadataForScope(n){return this._basicScopeAttributesProvider.getBasicScopeAttributes(n)}_collectInjections(){const n={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],t=this._rootScopeName,r=n.lookup(t);if(r){const s=r.injections;if(s)for(let a in s)Je(e,a,s[a],this,r);const i=this._grammarRepository.injections(t);i&&i.forEach(a=>{const o=this.getExternalGrammar(a);if(o){const c=o.injectionSelector;c&&Je(e,c,o,this,o)}})}return e.sort((s,i)=>s.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(n){const e=++this._lastRuleId,t=n(e);return this._ruleId2desc[e]=t,t}getRule(n){return this._ruleId2desc[n]}getExternalGrammar(n,e){if(this._includedGrammars[n])return this._includedGrammars[n];if(this._grammarRepository){const t=this._grammarRepository.lookup(n);if(t)return this._includedGrammars[n]=Qe(t,e&&e.$base),this._includedGrammars[n]}}tokenizeLine(n,e,t=0){const r=this._tokenize(n,e,!1,t);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(n,e,t=0){const r=this._tokenize(n,e,!0,t);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(n,e,t,r){this._rootId===-1&&(this._rootId=St.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Ee.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),u=F.set(0,l.languageId,l.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),f=this.getRule(this._rootId).getName(null,null);let g;f?g=U.createRootAndLookUpScopeName(f,u,this):g=U.createRoot("unknown",u),e=new Ee(null,this._rootId,-1,-1,!1,null,g,g)}else s=!1,e.reset();n=n+`
|
|
3
|
+
`;const i=this.createOnigString(n),a=i.content.length,o=new On(t,n,this._tokenTypeMatchers,this.balancedBracketSelectors),c=wt(this,i,s,0,e,o,!0,r);return _t(i),{lineLength:a,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Qe(n,e){return n=Xt(n),n.repository=n.repository||{},n.repository.$self={$vscodeTextmateLocation:n.$vscodeTextmateLocation,patterns:n.patterns,name:n.scopeName},n.repository.$base=e||n.repository.$self,n}var U=class L{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(e,t){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const i of t)s=Ce.push(s,i.scopeNames),r=new L(r,s,i.encodedTokenAttributes);return r}static createRoot(e,t){return new L(null,new Ce(null,e),t)}static createRootAndLookUpScopeName(e,t,r){const s=r.getMetadataForScope(e),i=new Ce(null,e),a=r.themeProvider.themeMatch(i),o=L.mergeAttributes(t,s,a);return new L(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return L.equals(this,e)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,r){let s=-1,i=0,a=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,a=r.backgroundId),F.set(e,t.languageId,t.tokenType,null,s,i,a)}pushAttributed(e,t){if(e===null)return this;if(e.indexOf(" ")===-1)return L._pushAttributed(this,e,t);const r=e.split(/ /g);let s=this;for(const i of r)s=L._pushAttributed(s,i,t);return s}static _pushAttributed(e,t,r){const s=r.getMetadataForScope(t),i=e.scopePath.push(t),a=r.themeProvider.themeMatch(i),o=L.mergeAttributes(e.tokenAttributes,s,a);return new L(e,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const t=[];let r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?t.reverse():void 0}},x,Ee=(x=class{constructor(e,t,r,s,i,a,o,c){d(this,"_stackElementBrand");d(this,"_enterPos");d(this,"_anchorPos");d(this,"depth");this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:x._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?U.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){x._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,r,s,i,a,o){return new x(this,e,t,r,s,i,a,o)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){var r,s;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new x(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){var e,t,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const r=U.fromExtension((e==null?void 0:e.nameScopesList)??null,t.nameScopesList);return new x(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,r,U.fromExtension(r,t.contentNameScopesList))}},d(x,"NULL",new x(null,0,0,0,!1,null,null,null)),x),Bn=class{constructor(n,e){d(this,"balancedBracketScopes");d(this,"unbalancedBracketScopes");d(this,"allowAny",!1);this.balancedBracketScopes=n.flatMap(t=>t==="*"?(this.allowAny=!0,[]):ae(t,le).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(t=>ae(t,le).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(n){for(const e of this.unbalancedBracketScopes)if(e(n))return!1;for(const e of this.balancedBracketScopes)if(e(n))return!0;return this.allowAny}},On=class{constructor(n,e,t,r){d(this,"_emitBinaryTokens");d(this,"_lineText");d(this,"_tokens");d(this,"_binaryTokens");d(this,"_lastTokenEndIndex");d(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=n,this._tokenTypeOverrides=t,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(n,e){this.produceFromScopes(n.contentNameScopesList,e)}produceFromScopes(n,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(n==null?void 0:n.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=(n==null?void 0:n.getScopeNames())??[];for(const o of this._tokenTypeOverrides)o.matcher(a)&&(s=F.set(s,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(a))}if(i&&(s=F.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const t=(n==null?void 0:n.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:t}),this._lastTokenEndIndex=e}getResult(n,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(n,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._binaryTokens[this._binaryTokens.length-2]=0);const t=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)t[r]=this._binaryTokens[r];return t}},$n=class{constructor(n,e){d(this,"_grammars",new Map);d(this,"_rawGrammars",new Map);d(this,"_injectionGrammars",new Map);d(this,"_theme");this._onigLib=e,this._theme=n}dispose(){for(const n of this._grammars.values())n.dispose()}setTheme(n){this._theme=n}getColorMap(){return this._theme.getColorMap()}addGrammar(n,e){this._rawGrammars.set(n.scopeName,n),e&&this._injectionGrammars.set(n.scopeName,e)}lookup(n){return this._rawGrammars.get(n)}injections(n){return this._injectionGrammars.get(n)}getDefaults(){return this._theme.getDefaults()}themeMatch(n){return this._theme.match(n)}grammarForScopeName(n,e,t,r,s){if(!this._grammars.has(n)){let i=this._rawGrammars.get(n);if(!i)return null;this._grammars.set(n,Ln(n,i,e,t,r,s,this,this._onigLib))}return this._grammars.get(n)}},Mn=class{constructor(e){d(this,"_options");d(this,"_syncRegistry");d(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new $n(ie.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ie.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new Bn(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,s,i){const a=new dn(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(o=>this._loadSingleGrammar(o.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,r,s,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,s=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,t=0,r=null,s=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,r,s,i)}},xe=Ee.NULL;function ue(n,e){const t=typeof n=="string"?{}:{...n.colorReplacements},r=typeof n=="string"?n:n.name;for(const[s,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?t[s]=i:s===r&&Object.assign(t,i);return t}function O(n,e){return n&&((e==null?void 0:e[n==null?void 0:n.toLowerCase()])||n)}function jn(n){return Array.isArray(n)?n:[n]}async function Rt(n){return Promise.resolve(typeof n=="function"?n():n).then(e=>e.default||e)}function ge(n){return!n||["plaintext","txt","text","plain"].includes(n)}function Nt(n){return n==="ansi"||ge(n)}function me(n){return n==="none"}function vt(n){return me(n)}const Wn=/(\r?\n)/g;function pe(n,e=!1){var i;if(n.length===0)return[["",0]];const t=n.split(Wn);let r=0;const s=[];for(let a=0;a<t.length;a+=2){const o=e?t[a]+(t[a+1]||""):t[a];s.push([o,r]),r+=t[a].length,r+=((i=t[a+1])==null?void 0:i.length)||0}return s}const Xe={light:"#333333",dark:"#bbbbbb"},Ze={light:"#fffffe",dark:"#1e1e1e"},et="__shiki_resolved";function Oe(n){var o,c,l,h,u;if(n!=null&&n[et])return n;const e={...n};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:t,fg:r}=e;if(!t||!r){const f=e.settings?e.settings.find(g=>!g.name&&!g.scope):void 0;(o=f==null?void 0:f.settings)!=null&&o.foreground&&(r=f.settings.foreground),(c=f==null?void 0:f.settings)!=null&&c.background&&(t=f.settings.background),!r&&((l=e==null?void 0:e.colors)!=null&&l["editor.foreground"])&&(r=e.colors["editor.foreground"]),!t&&((h=e==null?void 0:e.colors)!=null&&h["editor.background"])&&(t=e.colors["editor.background"]),r||(r=e.type==="light"?Xe.light:Xe.dark),t||(t=e.type==="light"?Ze.light:Ze.dark),e.fg=r,e.bg=t}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const i=new Map;function a(f){var m;if(i.has(f))return i.get(f);s+=1;const g=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(m=e.colorReplacements)!=null&&m[`#${g}`]?a(f):(i.set(f,g),g)}e.settings=e.settings.map(f=>{var b,_;const g=((b=f.settings)==null?void 0:b.foreground)&&!f.settings.foreground.startsWith("#"),m=((_=f.settings)==null?void 0:_.background)&&!f.settings.background.startsWith("#");if(!g&&!m)return f;const S={...f,settings:{...f.settings}};if(g){const p=a(f.settings.foreground);e.colorReplacements[p]=f.settings.foreground,S.settings.foreground=p}if(m){const p=a(f.settings.background);e.colorReplacements[p]=f.settings.background,S.settings.background=p}return S});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const g=a(e.colors[f]);e.colorReplacements[g]=e.colors[f],e.colors[f]=g}return Object.defineProperty(e,et,{enumerable:!1,writable:!1,value:!0}),e}async function Tt(n){return[...new Set((await Promise.all(n.filter(e=>!Nt(e)).map(async e=>await Rt(e).then(t=>Array.isArray(t)?t:[t])))).flat())]}async function At(n){return(await Promise.all(n.map(async e=>vt(e)?null:Oe(await Rt(e))))).filter(e=>!!e)}function It(n,e){if(!e)return n;if(e[n]){const t=new Set([n]);for(;e[n];){if(n=e[n],t.has(n))throw new R(`Circular alias \`${[...t].join(" -> ")} -> ${n}\``);t.add(n)}}return n}var Dn=class extends Mn{constructor(e,t,r,s={}){super(e);d(this,"_resolver");d(this,"_themes");d(this,"_langs");d(this,"_alias");d(this,"_resolvedThemes",new Map);d(this,"_resolvedGrammars",new Map);d(this,"_langMap",new Map);d(this,"_langGraph",new Map);d(this,"_textmateThemeCache",new WeakMap);d(this,"_loadedThemesCache",null);d(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=t,this._langs=r,this._alias=s,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=Oe(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=ie.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=It(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var i,a,o,c;if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(l=>{var h;return(h=l.embeddedLangsLazy)==null?void 0:h.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(l=>{this._alias[l]=e.name}),this._loadedLanguagesCache=null,t.size)for(const l of t)this._resolvedGrammars.delete(l.name),this._loadedLanguagesCache=null,(a=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||a.delete(l.scopeName),(c=(o=this._syncRegistry)==null?void 0:o._grammars)==null||c.delete(l.scopeName),this.loadLanguage(this._langMap.get(l.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=[...this._langGraph.entries()],r=t.filter(([s,i])=>!i);if(r.length){const s=t.filter(([i,a])=>{var o;return a?(o=a.embeddedLanguages||a.embeddedLangs)==null?void 0:o.some(c=>r.map(([l])=>l).includes(c)):!1}).filter(i=>!r.includes(i));throw new R(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of t)this._resolver.addLanguage(i);for(const[s,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 r of t)this._langGraph.set(r,this._langMap.get(r))}},Fn=class{constructor(n,e){d(this,"_langs",new Map);d(this,"_scopeToLang",new Map);d(this,"_injections",new Map);d(this,"_onigLib");this._onigLib={createOnigScanner:t=>n.createScanner(t),createOnigString:t=>n.createString(t)},e.forEach(t=>this.addLanguage(t))}get onigLib(){return this._onigLib}getLangRegistration(n){return this._langs.get(n)}loadGrammar(n){return this._scopeToLang.get(n)}addLanguage(n){this._langs.set(n.name,n),n.aliases&&n.aliases.forEach(e=>{this._langs.set(e,n)}),this._scopeToLang.set(n.scopeName,n),n.injectTo&&n.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(n.scopeName)})}getInjections(n){const e=n.split(".");let t=[];for(let r=1;r<=e.length;r++){const s=e.slice(0,r).join(".");t=[...t,...this._injections.get(s)||[]]}return t}};let H=0;function $e(n){H+=1,n.warnings!==!1&&H>=10&&H%10===0&&console.warn(`[Shiki] ${H} 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 e=!1;if(!n.engine)throw new R("`engine` option is required for synchronous mode");const t=(n.langs||[]).flat(1),r=(n.themes||[]).flat(1).map(Oe),s=new Dn(new Fn(n.engine,t),r,t,n.langAlias);let i;function a(p){return It(p,n.langAlias)}function o(p){b();const y=s.getGrammar(typeof p=="string"?p:p.name);if(!y)throw new R(`Language \`${p}\` not found, you may need to load it first`);return y}function c(p){if(p==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const y=s.getTheme(p);if(!y)throw new R(`Theme \`${p}\` not found, you may need to load it first`);return y}function l(p){b();const y=c(p);return i!==p&&(s.setTheme(y),i=p),{theme:y,colorMap:s.getColorMap()}}function h(){return b(),s.getLoadedThemes()}function u(){return b(),s.getLoadedLanguages()}function f(...p){b(),s.loadLanguages(p.flat(1))}async function g(...p){return f(await Tt(p))}function m(...p){b();for(const y of p.flat(1))s.loadTheme(y)}async function S(...p){return b(),m(await At(p))}function b(){if(e)throw new R("Shiki instance has been disposed")}function _(){e||(e=!0,s.dispose(),H-=1)}return{setTheme:l,getTheme:c,getLanguage:o,getLoadedThemes:h,getLoadedLanguages:u,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:f,loadTheme:S,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}const Os=$e;async function Et(n){n.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,t,r]=await Promise.all([At(n.themes||[]),Tt(n.langs||[]),n.engine]);return $e({...n,themes:e,langs:t,engine:r})}const $s=Et,xt=new WeakMap;function _e(n,e){xt.set(n,e)}function J(n){return xt.get(n)}var ye=class Lt{constructor(...e){d(this,"_stacks",{});d(this,"lang");if(e.length===2){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,s]=e;this.lang=r,this._stacks={[s]:t}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new Lt(Object.fromEntries(jn(t).map(r=>[r,xe])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return qn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function qn(n){const e=[],t=new Set;function r(s){var a;if(t.has(s))return;t.add(s);const i=(a=s==null?void 0:s.nameScopesList)==null?void 0:a.scopeName;i&&e.push(i),s.parent&&r(s.parent)}return r(n),e}function Hn(n,e){if(!(n instanceof ye))throw new R("Invalid grammar state");return n.getInternalStack(e)}const zn=/,/,Un=/ /;function Pt(n,e,t={}){const{theme:r=n.getLoadedThemes()[0]}=t;if(ge(n.resolveLangAlias(t.lang||"text"))||me(r))return pe(e).map(o=>[{content:o[0],offset:o[1]}]);const{theme:s,colorMap:i}=n.setTheme(r),a=n.getLanguage(t.lang||"text");if(t.grammarState){if(t.grammarState.lang!==a.name)throw new R(`Grammar state language "${t.grammarState.lang}" does not match highlight language "${a.name}"`);if(!t.grammarState.themes.includes(s.name))throw new R(`Grammar state themes "${t.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Kn(e,a,s,i,t)}function Gt(...n){if(n.length===2)return J(n[1]);const[e,t,r={}]=n,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(ge(s)||me(i))throw new R("Plain language does not have grammar state");if(s==="ansi")throw new R("ANSI language does not have grammar state");const{theme:a,colorMap:o}=e.setTheme(i),c=e.getLanguage(s);return new ye(Me(t,c,a,o,r).stateStack,c.name,a.name)}function Kn(n,e,t,r,s){const i=Me(n,e,t,r,s),a=new ye(i.stateStack,e.name,t.name);return _e(i.tokens,a),i.tokens}function Me(n,e,t,r,s){const i=ue(t,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:o=500}=s,c=pe(n);let l=s.grammarState?Hn(s.grammarState,t.name)??xe:s.grammarContextCode!=null?Me(s.grammarContextCode,e,t,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:xe,h=[];const u=[];for(let f=0,g=c.length;f<g;f++){const[m,S]=c[f];if(m===""){h=[],u.push([]);continue}if(a>0&&m.length>=a){h=[],u.push([{content:m,offset:S,color:"",fontStyle:0}]);continue}let b,_,p;s.includeExplanation&&(b=e.tokenizeLine(m,l,o),_=b.tokens,p=0);const y=e.tokenizeLine2(m,l,o),w=y.tokens.length/2;for(let C=0;C<w;C++){const k=y.tokens[2*C],A=C+1<w?y.tokens[2*C+2]:m.length;if(k===A)continue;const q=y.tokens[2*C+1],I=O(r[F.getForeground(q)],i),B=F.getFontStyle(q),M={content:m.substring(k,A),offset:S+k,color:I,fontStyle:B};if(s.includeExplanation){const j=[];if(s.includeExplanation!=="scopeName")for(const P of t.settings){let W;switch(typeof P.scope){case"string":W=P.scope.split(zn).map(be=>be.trim());break;case"object":W=P.scope;break;default:continue}j.push({settings:P,selectors:W.map(be=>be.split(Un))})}M.explanation=[];let De=0;for(;k+De<A;){const P=_[p],W=m.substring(P.startIndex,P.endIndex);De+=W.length,M.explanation.push({content:W,scopes:s.includeExplanation==="scopeName"?Yn(P.scopes):Vn(j,P.scopes)}),p+=1}}h.push(M)}u.push(h),h=[],l=y.ruleStack}return{tokens:u,stateStack:l}}function Yn(n){return n.map(e=>({scopeName:e}))}function Vn(n,e){const t=[];for(let r=0,s=e.length;r<s;r++){const i=e[r];t[r]={scopeName:i,themeMatches:Qn(n,i,e.slice(0,r))}}return t}function tt(n,e){return n===e||e.substring(0,n.length)===n&&e[n.length]==="."}function Jn(n,e,t){if(!tt(n.at(-1),e))return!1;let r=n.length-2,s=t.length-1;for(;r>=0&&s>=0;)tt(n[r],t[s])&&(r-=1),s-=1;return r===-1}function Qn(n,e,t){const r=[];for(const{selectors:s,settings:i}of n)for(const a of s)if(Jn(a,e,t)){r.push(i);break}return r}function je(n,e,t,r=Pt){const s=Object.entries(t.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=s.map(l=>{const h=r(n,e,{...t,theme:l.theme});return{tokens:h,state:J(h),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),a=Xn(...i.map(l=>l.tokens)),o=a[0].map((l,h)=>l.map((u,f)=>{const g={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in t&&t.includeExplanation&&(g.explanation=u.explanation),a.forEach((m,S)=>{const{content:b,explanation:_,offset:p,...y}=m[h][f];g.variants[s[S].color]=y}),g})),c=i[0].state?new ye(Object.fromEntries(i.map(l=>{var h;return[l.theme,(h=l.state)==null?void 0:h.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return c&&_e(o,c),o}function Xn(...n){const e=n.map(()=>[]),t=n.length;for(let r=0;r<n[0].length;r++){const s=n.map(c=>c[r]),i=e.map(()=>[]);e.forEach((c,l)=>c.push(i[l]));const a=s.map(()=>0),o=s.map(c=>c[0]);for(;o.every(c=>c);){const c=Math.min(...o.map(l=>l.content.length));for(let l=0;l<t;l++){const h=o[l];h.content.length===c?(i[l].push(h),a[l]+=1,o[l]=s[l][a[l]]):(i[l].push({...h,content:h.content.slice(0,c)}),o[l]={...h,content:h.content.slice(c),offset:h.offset+c})}}}return e}const Zn=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],er=/["&'<>`]/g,tr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rr=/[|\\{}()[\]^$+*?.]/g,nt=new WeakMap;function sr(n,e){if(n=n.replace(e.subset?ir(e.subset):er,r),e.subset||e.escapeOnly)return n;return n.replace(tr,t).replace(nr,r);function t(s,i,a){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,a.charCodeAt(i+2),e)}function r(s,i,a){return e.format(s.charCodeAt(0),a.charCodeAt(i+1),e)}}function ir(n){let e=nt.get(n);return e||(e=ar(n),nt.set(n,e)),e}function ar(n){const e=[];let t=-1;for(;++t<n.length;)e.push(n[t].replace(rr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const or=/[\dA-Fa-f]/;function cr(n,e,t){const r="&#x"+n.toString(16).toUpperCase();return t&&e&&!or.test(String.fromCharCode(e))?r:r+";"}const lr=/\d/;function ur(n,e,t){const r="&#"+String(n);return t&&e&&!lr.test(String.fromCharCode(e))?r:r+";"}const hr=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ke={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",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:"€"},fr=["cent","copy","divide","gt","lt","not","para","times"],Bt={}.hasOwnProperty,Le={};let te;for(te in ke)Bt.call(ke,te)&&(Le[ke[te]]=te);const dr=/[^\dA-Za-z]/;function gr(n,e,t,r){const s=String.fromCharCode(n);if(Bt.call(Le,s)){const i=Le[s],a="&"+i;return t&&hr.includes(i)&&!fr.includes(i)&&(!r||e&&e!==61&&dr.test(String.fromCharCode(e)))?a:a+";"}return""}function mr(n,e,t){let r=cr(n,e,t.omitOptionalSemicolons),s;if((t.useNamedReferences||t.useShortestReferences)&&(s=gr(n,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!s)&&t.useShortestReferences){const i=ur(n,e,t.omitOptionalSemicolons);i.length<r.length&&(r=i)}return s&&(!t.useShortestReferences||s.length<r.length)?s:r}function D(n,e){return sr(n,Object.assign({format:mr},e))}const pr=/^>|^->|<!--|-->|--!>|<!-$/g,_r=[">"],yr=["<",">"];function br(n,e,t,r){return r.settings.bogusComments?"<?"+D(n.value,Object.assign({},r.settings.characterReferences,{subset:_r}))+">":"<!--"+n.value.replace(pr,s)+"-->";function s(i){return D(i,Object.assign({},r.settings.characterReferences,{subset:yr}))}}function Sr(n,e,t,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const N=$t(1),Ot=$t(-1),Cr=[];function $t(n){return e;function e(t,r,s){const i=t?t.children:Cr;let a=(r||0)+n,o=i[a];if(!s)for(;o&&Ge(o);)a+=n,o=i[a];return o}}const wr={}.hasOwnProperty;function Mt(n){return e;function e(t,r,s){return wr.call(n,t.tagName)&&n[t.tagName](t,r,s)}}const We=Mt({body:Rr,caption:Re,colgroup:Re,dd:Ar,dt:Tr,head:Re,html:kr,li:vr,optgroup:Ir,option:Er,p:Nr,rp:rt,rt,tbody:Lr,td:st,tfoot:Pr,th:st,thead:xr,tr:Gr});function Re(n,e,t){const r=N(t,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ge(r.value.charAt(0)))}function kr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Rr(n,e,t){const r=N(t,e);return!r||r.type!=="comment"}function Nr(n,e,t){const r=N(t,e);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"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function vr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="li"}function Tr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ar(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function rt(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ir(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Er(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function xr(n,e,t){const r=N(t,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Lr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Pr(n,e,t){return!N(t,e)}function Gr(n,e,t){const r=N(t,e);return!r||r.type==="element"&&r.tagName==="tr"}function st(n,e,t){const r=N(t,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Br=Mt({body:Mr,colgroup:jr,head:$r,html:Or,tbody:Wr});function Or(n){const e=N(n,-1);return!e||e.type!=="comment"}function $r(n){const e=new Set;for(const r of n.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const t=n.children[0];return!t||t.type==="element"}function Mr(n){const e=N(n,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ge(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function jr(n,e,t){const r=Ot(t,e),s=N(n,-1,!0);return t&&r&&r.type==="element"&&r.tagName==="colgroup"&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Wr(n,e,t){const r=Ot(t,e),s=N(n,-1);return t&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&We(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const ne={name:[[`
|
|
4
|
+
\f\r &/=>`.split(""),`
|
|
5
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
6
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
7
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
8
|
+
\f\r &>`.split(""),`\0
|
|
9
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
10
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Dr(n,e,t,r){const s=r.schema,i=s.space==="svg"?!1:r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(n.tagName.toLowerCase());const o=[];let c;s.space==="html"&&n.tagName==="svg"&&(r.schema=ct);const l=Fr(r,n.properties),h=r.all(s.space==="html"&&n.tagName==="template"?n.content:n);return r.schema=s,h&&(a=!1),(l||!i||!Br(n,e,t))&&(o.push("<",n.tagName,l?" "+l:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(h),!a&&(!i||!We(n,e,t))&&o.push("</"+n.tagName+">"),o.join("")}function Fr(n,e){const t=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const i=qr(n,s,e[s]);i&&t.push(i)}}for(;++r<t.length;){const i=n.settings.tightAttributes?t[r].charAt(t[r].length-1):void 0;r!==t.length-1&&i!=='"'&&i!=="'"&&(t[r]+=" ")}return t.join("")}function qr(n,e,t){const r=Kt(n.schema,e),s=n.settings.allowParseErrors&&n.schema.space==="html"?0:1,i=n.settings.allowDangerousCharacters?0:1;let a=n.quote,o;if(r.overloadedBoolean&&(t===r.attribute||t==="")?t=!0:(r.boolean||r.overloadedBoolean)&&(typeof t!="string"||t===r.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const c=D(r.attribute,Object.assign({},n.settings.characterReferences,{subset:ne.name[s][i]}));return t===!0||(t=Array.isArray(t)?(r.commaSeparated?Yt:Vt)(t,{padLeft:!n.settings.tightCommaSeparatedLists}):String(t),n.settings.collapseEmptyAttributes&&!t)?c:(n.settings.preferUnquoted&&(o=D(t,Object.assign({},n.settings.characterReferences,{attribute:!0,subset:ne.unquoted[s][i]}))),o!==t&&(n.settings.quoteSmart&&Fe(t,a)>Fe(t,n.alternative)&&(a=n.alternative),o=a+D(t,Object.assign({},n.settings.characterReferences,{subset:(a==="'"?ne.single:ne.double)[s][i],attribute:!0}))+a),c+(o&&"="+o))}const Hr=["<","&"];function jt(n,e,t,r){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?n.value:D(n.value,Object.assign({},r.settings.characterReferences,{subset:Hr}))}function zr(n,e,t,r){return r.settings.allowDangerousHtml?n.value:jt(n,e,t,r)}function Ur(n,e,t,r){return r.all(n)}const Kr=Qt("type",{invalid:Yr,unknown:Vr,handlers:{comment:br,doctype:Sr,element:Dr,raw:zr,root:Ur,text:jt}});function Yr(n){throw new Error("Expected node, not `"+n+"`")}function Vr(n){const e=n;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Jr={},Qr={},Xr=[];function Zr(n,e){const t=e||Jr,r=t.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:es,all:ts,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||Zn,characterReferences:t.characterReferences||Qr,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?ct:Jt,quote:r,alternative:s}.one(Array.isArray(n)?{type:"root",children:n}:n,void 0,void 0)}function es(n,e,t){return Kr(n,e,t,this)}function ts(n){const e=[],t=n&&n.children||Xr;let r=-1;for(;++r<t.length;)e[r]=this.one(t[r],r,n);return e.join("")}const it=/\s+/g;function Wt(n,e){var r;if(!e)return n;n.properties||(n.properties={}),(r=n.properties).class||(r.class=[]),typeof n.properties.class=="string"&&(n.properties.class=n.properties.class.split(it)),Array.isArray(n.properties.class)||(n.properties.class=[]);const t=Array.isArray(e)?e:e.split(it);for(const s of t)s&&!n.properties.class.includes(s)&&n.properties.class.push(s);return n}const ns=/:?lang=["']([^"']+)["']/g,rs=/(?:```|~~~)([\w-]+)/g,ss=/\\begin\{([\w-]+)\}/g,is=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function as(n){const e=pe(n,!0).map(([s])=>s);function t(s){if(s===n.length)return{line:e.length-1,character:e.at(-1).length};let i=s,a=0;for(const o of e){if(i<o.length)break;i-=o.length,a++}return{line:a,character:i}}function r(s,i){let a=0;for(let o=0;o<s;o++)a+=e[o].length;return a+=i,a}return{lines:e,indexToPos:t,posToIndex:r}}function Ms(n,e,t){const r=new Set;for(const i of n.matchAll(ns)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(rs)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(ss)){const a=i[1].toLowerCase().trim();a&&r.add(a)}for(const i of n.matchAll(is)){const a=i[1].toLowerCase().trim(),o=a.includes("/")?a.split("/").pop():a;o&&r.add(o)}if(!t)return[...r];const s=t.getBundledLanguages();return[...r].filter(i=>i&&s[i])}const os=["color","background-color"];function cs(n,e){let t=0;const r=[];for(const s of e)s>t&&r.push({...n,content:n.content.slice(t,s),offset:n.offset+t}),t=s;return t<n.content.length&&r.push({...n,content:n.content.slice(t),offset:n.offset+t}),r}function ls(n,e){const t=[...e instanceof Set?e:new Set(e)].sort((r,s)=>r-s);return t.length?n.map(r=>r.flatMap(s=>{const i=t.filter(a=>s.offset<a&&a<s.offset+s.content.length).map(a=>a-s.offset).sort((a,o)=>a-o);return i.length?cs(s,i):s})):n}function us(n,e,t,r,s="css-vars"){const i={content:n.content,explanation:n.explanation,offset:n.offset},a=e.map(h=>he(n.variants[h])),o=new Set(a.flatMap(h=>Object.keys(h))),c={},l=(h,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return t+e[h]+(u==="color"?"":f)};return a.forEach((h,u)=>{for(const f of o){const g=h[f]||"inherit";if(u===0&&r&&os.includes(f))if(r==="light-dark()"&&a.length>1){const m=e.findIndex(b=>b==="light"),S=e.findIndex(b=>b==="dark");if(m===-1||S===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[f]=`light-dark(${a[m][f]||"inherit"}, ${a[S][f]||"inherit"})`,s==="css-vars"&&(c[l(u,f)]=g)}else c[f]=g;else s==="css-vars"&&(c[l(u,f)]=g)}}),i.htmlStyle=c,i}function he(n){const e={};if(n.color&&(e.color=n.color),n.bgColor&&(e["background-color"]=n.bgColor),n.fontStyle){n.fontStyle&T.Italic&&(e["font-style"]="italic"),n.fontStyle&T.Bold&&(e["font-weight"]="bold");const t=[];n.fontStyle&T.Underline&&t.push("underline"),n.fontStyle&T.Strikethrough&&t.push("line-through"),t.length&&(e["text-decoration"]=t.join(" "))}return e}function Pe(n){return typeof n=="string"?n:Object.entries(n).map(([e,t])=>`${e}:${t}`).join(";")}function hs(){const n=new WeakMap;function e(t){if(!n.has(t.meta)){let s=function(a){if(typeof a=="number"){if(a<0||a>t.source.length)throw new R(`Invalid decoration offset: ${a}. Code length: ${t.source.length}`);return{...r.indexToPos(a),offset:a}}else{const o=r.lines[a.line];if(o===void 0)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${r.lines.length}`);let c=a.character;if(c<0&&(c=o.length+c),c<0||c>o.length)throw new R(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${o.length}`);return{...a,character:c,offset:r.posToIndex(a.line,c)}}};const r=as(t.source),i=(t.options.decorations||[]).map(a=>({...a,start:s(a.start),end:s(a.end)}));fs(i),n.set(t.meta,{decorations:i,converter:r,source:t.source})}return n.get(t.meta)}return{name:"shiki:decorations",tokens(t){var r;if((r=this.options.decorations)!=null&&r.length)return ls(t,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(t){var h;if(!((h=this.options.decorations)!=null&&h.length))return;const r=e(this),s=[...t.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,f,g,m){const S=s[u];let b="",_=-1,p=-1;if(f===0&&(_=0),g===0&&(p=0),g===Number.POSITIVE_INFINITY&&(p=S.children.length),_===-1||p===-1)for(let w=0;w<S.children.length;w++)b+=Dt(S.children[w]),_===-1&&b.length===f&&(_=w+1),p===-1&&b.length===g&&(p=w+1);if(_===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(p===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const y=S.children.slice(_,p);if(!m.alwaysWrap&&y.length===S.children.length)o(S,m,"line");else if(!m.alwaysWrap&&y.length===1&&y[0].type==="element")o(y[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:y};o(w,m,"wrapper"),S.children.splice(_,y.length,w)}}function a(u,f){s[u]=o(s[u],f,"line")}function o(u,f,g){var b;const m=f.properties||{},S=f.transform||(_=>_);return u.tagName=f.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},(b=f.properties)!=null&&b.class&&Wt(u,f.properties.class),u=S(u,g)||u,u}const c=[],l=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(const u of l){const{start:f,end:g}=u;if(f.line===g.line)i(f.line,f.character,g.character,u);else if(f.line<g.line){i(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let m=f.line+1;m<g.line;m++)c.unshift(()=>a(m,u));i(g.line,0,g.character,u)}}c.forEach(u=>u())}}}function fs(n){for(let e=0;e<n.length;e++){const t=n[e];if(t.start.offset>t.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(t.start)} - ${JSON.stringify(t.end)}`);for(let r=e+1;r<n.length;r++){const s=n[r],i=t.start.offset<=s.start.offset&&s.start.offset<t.end.offset,a=t.start.offset<s.end.offset&&s.end.offset<=t.end.offset,o=s.start.offset<=t.start.offset&&t.start.offset<s.end.offset,c=s.start.offset<t.end.offset&&t.end.offset<=s.end.offset;if(i||a||o||c){if(i&&a||o&&c||o&&t.start.offset===t.end.offset||a&&s.start.offset===s.end.offset)continue;throw new R(`Decorations ${JSON.stringify(t.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Dt(n){return n.type==="text"?n.value:n.type==="element"?n.children.map(Dt).join(""):""}const ds=[hs()];function fe(n){const e=gs(n.transformers||[]);return[...e.pre,...e.normal,...e.post,...ds]}function gs(n){const e=[],t=[],r=[];for(const s of n)switch(s.enforce){case"pre":e.push(s);break;case"post":t.push(s);break;default:r.push(s)}return{pre:e,post:t,normal:r}}var $=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ne={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ms(n,e){const t=n.indexOf("\x1B",e);if(t!==-1&&n[t+1]==="["){const r=n.indexOf("m",t);if(r!==-1)return{sequence:n.substring(t+2,r).split(";"),startPosition:t,position:r+1}}return{position:n.length}}function at(n){const e=n.shift();if(e==="2"){const t=n.splice(0,3).map(r=>Number.parseInt(r));return t.length!==3||t.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:t}}else if(e==="5"){const t=n.shift();if(t)return{type:"table",index:Number(t)}}}function ps(n){const e=[];for(;n.length>0;){const t=n.shift();if(!t)continue;const r=Number.parseInt(t);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Ne[r]&&e.push({type:"setDecoration",value:Ne[r]});else if(r<=29){const s=Ne[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:$[r-30]}});else if(r===38){const s=at(n);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:$[r-40]}});else if(r===48){const s=at(n);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:$[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:$[r-100+8]}})}return e}function _s(){let n=null,e=null,t=new Set;return{parse(r){const s=[];let i=0;do{const a=ms(r,i),o=a.sequence?r.substring(i,a.startPosition):r.substring(i);if(o.length>0&&s.push({value:o,foreground:n,background:e,decorations:new Set(t)}),a.sequence){const c=ps(a.sequence);for(const l of c)l.type==="resetAll"?(n=null,e=null,t.clear()):l.type==="resetForegroundColor"?n=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&t.delete(l.value);for(const l of c)l.type==="setForegroundColor"?n=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&t.add(l.value)}i=a.position}while(i<r.length);return s}}}var ys={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function bs(n=ys){function e(o){return n[o]}function t(o){return`#${o.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let l=0;l<$.length;l++)r.push(e($[l]));let o=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let h=0;h<6;h++)for(let u=0;u<6;u++)r.push(t([o[l],o[h],o[u]]));let c=8;for(let l=0;l<24;l++,c+=10)r.push(t([c,c,c]));return r}function i(o){return s()[o]}function a(o){switch(o.type){case"named":return e(o.name);case"rgb":return t(o.rgb);case"table":return i(o.index)}}return{value:a}}const Ss=/#([0-9a-f]{3,8})/i,Cs=/var\((--[\w-]+-ansi-[\w-]+)\)/,ws={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function ks(n,e,t){const r=ue(n,t),s=pe(e),i=bs(Object.fromEntries($.map(o=>{var l;const c=`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`;return[o,((l=n.colors)==null?void 0:l[c])||ws[o]]}))),a=_s();return s.map(o=>a.parse(o[0]).map(c=>{let l,h;c.decorations.has("reverse")?(l=c.background?i.value(c.background):n.bg,h=c.foreground?i.value(c.foreground):n.fg):(l=c.foreground?i.value(c.foreground):n.fg,h=c.background?i.value(c.background):void 0),l=O(l,r),h=O(h,r),c.decorations.has("dim")&&(l=Rs(l));let u=T.None;return c.decorations.has("bold")&&(u|=T.Bold),c.decorations.has("italic")&&(u|=T.Italic),c.decorations.has("underline")&&(u|=T.Underline),c.decorations.has("strikethrough")&&(u|=T.Strikethrough),{content:c.value,offset:o[1],color:l,bgColor:h,fontStyle:u}}))}function Rs(n){const e=n.match(Ss);if(e){const r=e[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],i=r[1],a=r[2],o=r[3];return`#${s}${s}${i}${i}${a}${a}${Math.round(Number.parseInt(`${o}${o}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],i=r[1],a=r[2];return`#${s}${s}${i}${i}${a}${a}80`}}}const t=n.match(Cs);return t?`var(${t[1]}-dim)`:n}function de(n,e,t={}){const r=n.resolveLangAlias(t.lang||"text"),{theme:s=n.getLoadedThemes()[0]}=t;if(!ge(r)&&!me(s)&&r==="ansi"){const{theme:i}=n.setTheme(s);return ks(i,e,t)}return Pt(n,e,t)}function Q(n,e,t){let r,s,i,a,o,c;if("themes"in t){const{defaultColor:l="light",cssVariablePrefix:h="--shiki-",colorsRendering:u="css-vars"}=t,f=Object.entries(t.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,p)=>_.color===l?-1:p.color===l?1:0);if(f.length===0)throw new R("`themes` option must not be empty");const g=je(n,e,t,de);if(c=J(g),l&&l!=="light-dark()"&&!f.some(_=>_.color===l))throw new R(`\`themes\` option must contain the defaultColor key \`${l}\``);const m=f.map(_=>n.getTheme(_.theme)),S=f.map(_=>_.color);i=g.map(_=>_.map(p=>us(p,S,h,l,u))),c&&_e(i,c);const b=f.map(_=>ue(_.theme,t));s=ot(f,m,b,h,l,"fg",u),r=ot(f,m,b,h,l,"bg",u),a=`shiki-themes ${m.map(_=>_.name).join(" ")}`,o=l?void 0:[s,r].join(";")}else if("theme"in t){const l=ue(t.theme,t);i=de(n,e,t);const h=n.getTheme(t.theme);r=O(h.bg,l),s=O(h.fg,l),a=h.name,c=J(i)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:a,rootStyle:o,grammarState:c}}function ot(n,e,t,r,s,i,a){return n.map((o,c)=>{const l=O(e[c][i],t[c])||"inherit",h=`${r+o.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&s){if(s==="light-dark()"&&n.length>1){const u=n.findIndex(g=>g.color==="light"),f=n.findIndex(g=>g.color==="dark");if(u===-1||f===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${O(e[u][i],t[u])||"inherit"}, ${O(e[f][i],t[f])||"inherit"});${h}`}return l}return a==="css-vars"?h:null}).filter(o=>!!o).join(";")}const Ft=/^\s+$/,Ns=/^(\s*)(.*?)(\s*)$/;function X(n,e,t,r={meta:{},options:t,codeToHast:(s,i)=>X(n,s,i),codeToTokens:(s,i)=>Q(n,s,i)}){var m,S;let s=e;for(const b of fe(t))s=((m=b.preprocess)==null?void 0:m.call(r,s,t))||s;let{tokens:i,fg:a,bg:o,themeName:c,rootStyle:l,grammarState:h}=Q(n,s,t);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=t;u===!0?i=Ts(i):u==="never"&&(i=As(i)),f&&(i=Is(i));const g={...r,get source(){return s}};for(const b of fe(t))i=((S=b.tokens)==null?void 0:S.call(g,i))||i;return vs(i,{...t,fg:a,bg:o,themeName:c,rootStyle:t.rootStyle===!1?!1:t.rootStyle??l},g,h)}function vs(n,e,t,r=J(n)){var S,b,_,p;const s=fe(e),i=[],a={type:"root",children:[]},{structure:o="classic",tabindex:c="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),c!==!1&&c!=null&&(l.tabindex=c.toString());for(const[y,w]of Object.entries(e.meta||{}))y.startsWith("_")||(l[y]=w);let h={type:"element",tagName:"pre",properties:l,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:i};const f=[],g={...t,structure:o,addClassToHast:Wt,get source(){return t.source},get tokens(){return n},get options(){return e},get root(){return a},get pre(){return h},get code(){return u},get lines(){return f}};if(n.forEach((y,w)=>{var A,q;w&&(o==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&i.push({type:"text",value:`
|
|
12
|
+
`}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const I of y){let B={type:"element",tagName:"span",properties:{...I.htmlAttrs},children:[{type:"text",value:I.content}]};const M=Pe(I.htmlStyle||he(I));M&&(B.properties.style=M);for(const j of s)B=((A=j==null?void 0:j.span)==null?void 0:A.call(g,B,w+1,k,C,I))||B;o==="inline"?a.children.push(B):o==="classic"&&C.children.push(B),k+=I.content.length}if(o==="classic"){for(const I of s)C=((q=I==null?void 0:I.line)==null?void 0:q.call(g,C,w+1))||C;f.push(C),i.push(C)}else o==="inline"&&f.push(C)}),o==="classic"){for(const y of s)u=((S=y==null?void 0:y.code)==null?void 0:S.call(g,u))||u;h.children.push(u);for(const y of s)h=((b=y==null?void 0:y.pre)==null?void 0:b.call(g,h))||h;a.children.push(h)}else if(o==="inline"){const y=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of a.children)k.type==="element"&&k.tagName==="br"?(y.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&w.children.push(k);y.push(w);let C={type:"element",tagName:"code",properties:{},children:y};for(const k of s)C=((_=k==null?void 0:k.code)==null?void 0:_.call(g,C))||C;a.children=[];for(let k=0;k<C.children.length;k++){k>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});const A=C.children[k];A.type==="element"&&a.children.push(...A.children)}}let m=a;for(const y of s)m=((p=y==null?void 0:y.root)==null?void 0:p.call(g,m))||m;return r&&_e(m,r),m}function Ts(n){return n.map(e=>{const t=[];let r="",s;return e.forEach((i,a)=>{const o=!(i.fontStyle&&(i.fontStyle&T.Underline||i.fontStyle&T.Strikethrough));o&&Ft.test(i.content)&&e[a+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(o?t.push({...i,offset:s,content:r+i.content}):t.push({content:r,offset:s},i),s=void 0,r=""):t.push(i)}),t})}function As(n){return n.map(e=>e.flatMap(t=>{if(Ft.test(t.content))return t;const r=t.content.match(Ns);if(!r)return t;const[,s,i,a]=r;if(!s&&!a)return t;const o=[{...t,offset:t.offset+s.length,content:i}];return s&&o.unshift({content:s,offset:t.offset}),a&&o.push({content:a,offset:t.offset+s.length+i.length}),o}))}function Is(n){return n.map(e=>{const t=[];for(const r of e){if(t.length===0){t.push({...r});continue}const s=t.at(-1),i=Pe(s.htmlStyle||he(s)),a=Pe(r.htmlStyle||he(r)),o=s.fontStyle&&(s.fontStyle&T.Underline||s.fontStyle&T.Strikethrough),c=r.fontStyle&&(r.fontStyle&T.Underline||r.fontStyle&T.Strikethrough);!o&&!c&&i===a?s.content+=r.content:t.push({...r})}return t})}const Es=Zr;function qt(n,e,t){var i;const r={meta:{},options:t,codeToHast:(a,o)=>X(n,a,o),codeToTokens:(a,o)=>Q(n,a,o)};let s=Es(X(n,e,t,r));for(const a of fe(t))s=((i=a.postprocess)==null?void 0:i.call(r,s,t))||s;return s}async function Ht(n){const e=await Et(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>Q(e,t,r),codeToHast:(t,r)=>X(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function js(n){const e=$e(n);return{getLastGrammarState:(...t)=>Gt(e,...t),codeToTokensBase:(t,r)=>de(e,t,r),codeToTokensWithThemes:(t,r)=>je(e,t,r),codeToTokens:(t,r)=>Q(e,t,r),codeToHast:(t,r)=>X(e,t,r),codeToHtml:(t,r)=>qt(e,t,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function xs(n){let e;async function t(r){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else return e=n({...r,themes:r.themes||[],langs:r.langs||[]}),e}return t}const Ws=xs(Ht);function Ds(n){const e=n.langs,t=n.themes,r=n.engine;async function s(i){function a(u){var f;if(typeof u=="string"){if(u=((f=i.langAlias)==null?void 0:f[u])||u,Nt(u))return[];const g=e[u];if(!g)throw new R(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return g}return u}function o(u){if(vt(u))return"none";if(typeof u=="string"){const f=t[u];if(!f)throw new R(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return f}return u}const c=(i.themes??[]).map(u=>o(u)),l=(i.langs??[]).map(u=>a(u)),h=await Ht({engine:i.engine??r(),...i,themes:c,langs:l});return{...h,loadLanguage(...u){return h.loadLanguage(...u.map(a))},loadTheme(...u){return h.loadTheme(...u.map(o))},getBundledLanguages(){return e},getBundledThemes(){return t}}}return s}function Ls(n){let e;async function t(r={}){if(e){const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}else{e=n({...r,themes:[],langs:[]});const s=await e;return await Promise.all([s.loadTheme(...r.themes||[]),s.loadLanguage(...r.langs||[])]),s}}return t}function Fs(n,e){const t=Ls(n);async function r(s,i){var c;const a=await t({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),o=await((c=e==null?void 0:e.guessEmbeddedLanguages)==null?void 0:c.call(e,s,i.lang,a));return o&&await a.loadLanguage(...o),a}return{getSingletonHighlighter(s){return t(s)},async codeToHtml(s,i){return(await r(s,i)).codeToHtml(s,i)},async codeToHast(s,i){return(await r(s,i)).codeToHast(s,i)},async codeToTokens(s,i){return(await r(s,i)).codeToTokens(s,i)},async codeToTokensBase(s,i){return(await r(s,i)).codeToTokensBase(s,i)},async codeToTokensWithThemes(s,i){return(await r(s,i)).codeToTokensWithThemes(s,i)},async getLastGrammarState(s,i){return(await t({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(s,i)}}}function qs(n={}){var a;const{name:e="css-variables",variablePrefix:t="--shiki-",fontStyle:r=!0}=n,s=o=>{var c;return(c=n.variableDefaults)!=null&&c[o]?`var(${t}${o}, ${n.variableDefaults[o]})`:`var(${t}${o})`},i={name:e,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return r||(i.tokenColors=(a=i.tokenColors)==null?void 0:a.map(o=>{var c;return(c=o.settings)!=null&&c.fontStyle&&delete o.settings.fontStyle,o})),i}export{R as ShikiError,Wt as addClassToHast,O as applyColorReplacements,X as codeToHast,qt as codeToHtml,Q as codeToTokens,de as codeToTokensBase,je as codeToTokensWithThemes,Ds as createBundledHighlighter,qs as createCssVariablesTheme,Ht as createHighlighterCore,js as createHighlighterCoreSync,as as createPositionConverter,$s as createShikiInternal,Os as createShikiInternalSync,$e as createShikiPrimitive,Et as createShikiPrimitiveAsync,Fs as createSingletonShorthands,us as flatTokenVariants,Gt as getLastGrammarState,Ws as getSingletonHighlighterCore,he as getTokenStyleObject,Ms as guessEmbeddedLanguages,Es as hastToHtml,me as isNoneTheme,ge as isPlainLang,Nt as isSpecialLang,vt as isSpecialTheme,Ls as makeSingletonHighlighter,xs as makeSingletonHighlighterCore,Rt as normalizeGetter,Oe as normalizeTheme,ue as resolveColorReplacements,pe as splitLines,cs as splitToken,ls as splitTokens,Pe as stringifyTokenStyle,jn as toArray,ks as tokenizeAnsiWithTheme,Kn as tokenizeWithTheme,vs as tokensToHast,hs as transformerDecorations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as V,l as k,d as lt}from"./mermaid.core-Bfj9YagN.js";import{c as tt}from"./cytoscape.esm-DTSO7Bv0.js";import{g as gt}from"./index-D9Ao6WQl.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,T){G.exports=T()})(ut,function(){return(function(N){var I={};function T(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,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)})([(function(N,I,T){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,T){var o=T(2),e=T(8),t=T(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,T){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(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;v<p.length;v++)h=p[v],a=h.withChildren(),a.forEach(function(D){r.add(D)});return r},n.prototype.getNoOfChildren=function(){var r=0,h;if(this.child==null)r=1;else for(var a=this.child.getNodes(),p=0;p<a.length;p++)h=a[p],r+=h.getNoOfChildren();return r==0&&(r=1),r},n.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},n.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},n.prototype.scatter=function(){var r,h,a=-i.INITIAL_WORLD_BOUNDARY,p=i.INITIAL_WORLD_BOUNDARY;r=i.WORLD_CENTER_X+l.nextDouble()*(p-a)+a;var v=-i.INITIAL_WORLD_BOUNDARY,D=i.INITIAL_WORLD_BOUNDARY;h=i.WORLD_CENTER_Y+l.nextDouble()*(D-v)+v,this.rect.x=r,this.rect.y=h},n.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var r=this.getChild();if(r.updateBounds(!0),this.rect.x=r.getLeft(),this.rect.y=r.getTop(),this.setWidth(r.getRight()-r.getLeft()),this.setHeight(r.getBottom()-r.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var h=r.getRight()-r.getLeft(),a=r.getBottom()-r.getTop();this.labelWidth>h&&(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,T){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,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(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 E=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:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},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,E=D.length,y=0;y<E;y++)u=D[y],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var O=this.nodes.indexOf(v);if(O==-1)throw"Node not in owner node list!";this.nodes.splice(O,1)}else if(p instanceof g){var u=p;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var s=u.source.edges.indexOf(u),f=u.target.edges.indexOf(u);if(!(s>-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,E,y=this.getNodes(),O=y.length,s=0;s<O;s++){var f=y[s];D=f.getTop(),u=f.getLeft(),p>D&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,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,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;m<A;m++){var C=L[m];p&&C.child!=null&&C.updateBounds(),y=C.getLeft(),O=C.getRight(),s=C.getTop(),f=C.getBottom(),v>y&&(v=y),D<O&&(D=O),u>s&&(u=s),E<f&&(E=f)}var R=new n(v,u,D-v,E-u);v==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),L[0].getParent().paddingLeft!=null?c=L[0].getParent().paddingLeft:c=this.margin,this.left=R.x-c,this.right=R.x+R.width+c,this.top=R.y-c,this.bottom=R.y+R.height+c},h.calculateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c=p.length,L=0;L<c;L++){var A=p[L];y=A.getLeft(),O=A.getRight(),s=A.getTop(),f=A.getBottom(),v>y&&(v=y),D<O&&(D=O),u>s&&(u=s),E<f&&(E=f)}var m=new n(v,u,D-v,E-u);return m},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var p=0,v=this.nodes,D=v.length,u=0;u<D;u++){var E=v[u];p+=E.calcEstimatedSize()}return p==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=p/Math.sqrt(this.nodes.length),this.estimatedSize},h.prototype.updateConnected=function(){var p=this;if(this.nodes.length==0){this.isConnected=!0;return}var v=new r,D=new Set,u=this.nodes[0],E,y,O=u.withChildren();for(O.forEach(function(m){v.push(m),D.add(m)});v.length!==0;){u=v.shift(),E=u.getEdges();for(var s=E.length,f=0;f<s;f++){var c=E[f];if(y=c.getOtherEndInGraph(u,this),y!=null&&!D.has(y)){var L=y.withChildren();L.forEach(function(m){v.push(m),D.add(m)})}}}if(this.isConnected=!1,D.size>=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,T){var o,e=T(1);function t(i){o=T(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<d;r++)n=g[r],l.remove(n);var h=[];h=h.concat(l.getNodes());var a;d=h.length;for(var r=0;r<d;r++)a=h[r],l.remove(a);l==this.rootGraph&&this.setRootGraph(null);var p=this.graphs.indexOf(l);this.graphs.splice(p,1),l.parent=null}else if(i instanceof e){if(n=i,n==null)throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(!(n.source!=null&&n.target!=null))throw"Source and/or target is null!";if(!(n.source.edges.indexOf(n)!=-1&&n.target.edges.indexOf(n)!=-1))throw"Source and/or target doesn't know this edge!";var p=n.source.edges.indexOf(n);if(n.source.edges.splice(p,1),p=n.target.edges.indexOf(n),n.target.edges.splice(p,1),!(n.source.owner!=null&&n.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(n.source.owner.getGraphManager().edges.indexOf(n)==-1)throw"Not in owner graph manager's edge list!";var p=n.source.owner.getGraphManager().edges.indexOf(n);n.source.owner.getGraphManager().edges.splice(p,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],l=this.getGraphs(),g=l.length,n=0;n<g;n++)i=i.concat(l[n].getNodes());this.allNodes=i}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],l=this.getGraphs();l.length;for(var g=0;g<l.length;g++)i=i.concat(l[g].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(i,l){if(!(i!=null&&l!=null))throw"assert failed";if(i==l)return!0;var g=i.getOwner(),n;do{if(n=g.getParent(),n==null)break;if(n==l)return!0;if(g=n.getOwner(),g==null)break}while(!0);g=l.getOwner();do{if(n=g.getParent(),n==null)break;if(n==i)return!0;if(g=n.getOwner(),g==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var i,l,g,n,d,r=this.getAllEdges(),h=r.length,a=0;a<h;a++){if(i=r[a],l=i.source,g=i.target,i.lca=null,i.sourceInLca=l,i.targetInLca=g,l==g){i.lca=l.getOwner();continue}for(n=l.getOwner();i.lca==null;){for(i.targetInLca=g,d=g.getOwner();i.lca==null;){if(d==n){i.lca=d;break}if(d==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=d.getParent(),d=i.targetInLca.getOwner()}if(n==this.rootGraph)break;i.lca==null&&(i.sourceInLca=n.getParent(),n=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(i,l){if(i==l)return i.getOwner();var g=i.getOwner();do{if(g==null)break;var n=l.getOwner();do{if(n==null)break;if(n==g)return n;n=n.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},t.prototype.calcInclusionTreeDepths=function(i,l){i==null&&l==null&&(i=this.rootGraph,l=1);for(var g,n=i.getNodes(),d=n.length,r=0;r<d;r++)g=n[r],g.inclusionTreeDepth=l,g.child!=null&&this.calcInclusionTreeDepths(g.child,l+1)},t.prototype.includesInvalidEdge=function(){for(var i,l=this.edges.length,g=0;g<l;g++)if(i=this.edges[g],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},N.exports=t}),(function(N,I,T){var o=T(0);function e(){}for(var t in o)e[t]=o[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,N.exports=e}),(function(N,I,T){var o=T(12);function e(){}e.calcSeparationAmount=function(t,i,l,g){if(!t.intersects(i))throw"assert failed";var n=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,n),l[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),l[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=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]<h?h=l[0]:r=l[1],l[0]=-1*n[0]*(h/2+g),l[1]=-1*n[1]*(r/2+g)},e.decideDirectionsForOverlappingNodes=function(t,i,l){t.getCenterX()<i.getCenterX()?l[0]=-1:l[0]=1,t.getCenterY()<i.getCenterY()?l[1]=-1:l[1]=1},e.getIntersection2=function(t,i,l){var g=t.getCenterX(),n=t.getCenterY(),d=i.getCenterX(),r=i.getCenterY();if(t.intersects(i))return l[0]=g,l[1]=n,l[2]=d,l[3]=r,!0;var h=t.getX(),a=t.getY(),p=t.getRight(),v=t.getX(),D=t.getBottom(),u=t.getRight(),E=t.getWidthHalf(),y=t.getHeightHalf(),O=i.getX(),s=i.getY(),f=i.getRight(),c=i.getX(),L=i.getBottom(),A=i.getRight(),m=i.getWidthHalf(),C=i.getHeightHalf(),R=!1,M=!1;if(g===d){if(n>r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(n<r)return l[0]=g,l[1]=D,l[2]=d,l[3]=s,!1}else if(n===r){if(g>d)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(g<d)return l[0]=p,l[1]=n,l[2]=O,l[3]=r,!1}else{var S=t.height/t.width,Y=i.height/i.width,w=(r-n)/(d-g),x=void 0,F=void 0,U=void 0,P=void 0,_=void 0,X=void 0;if(-S===w?g>d?(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]=L,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]=L,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+E*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+-E*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=L,_=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,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l<t?n+=Math.PI:g<i&&(n+=this.TWO_PI)):g<i?n=this.ONE_AND_HALF_PI:n=this.HALF_PI,n},e.doIntersect=function(t,i,l,g){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=(r-n)*(D-p)-(v-a)*(h-d);if(u===0)return!1;var E=((D-p)*(v-n)+(a-v)*(D-d))/u,y=((d-h)*(v-n)+(r-n)*(D-d))/u;return 0<E&&E<1&&0<y&&y<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,N.exports=e}),(function(N,I,T){function o(){}o.sign=function(e){return e>0?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,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,T){var o=(function(){function n(d,r){for(var h=0;h<r.length;h++){var a=r[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,r,h){return r&&n(d.prototype,r),h&&n(d,h),d}})();function e(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}var t=function(d){return{value:d,next:null,prev:null}},i=function(d,r,h,a){return d!==null?d.next=r:a.head=r,h!==null?h.prev=r:a.tail=r,r.prev=d,r.next=h,a.length++,r},l=function(d,r){var h=d.prev,a=d.next;return h!==null?h.next=a:r.head=a,a!==null?a.prev=h:r.tail=h,d.prev=d.next=null,r.length--,d},g=(function(){function n(d){var r=this;e(this,n),this.length=0,this.head=null,this.tail=null,d!=null&&d.forEach(function(h){return r.push(h)})}return o(n,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(r,h){return i(h.prev,t(r),h,this)}},{key:"insertAfter",value:function(r,h){return i(h,t(r),h.next,this)}},{key:"insertNodeBefore",value:function(r,h){return i(h.prev,r,h,this)}},{key:"insertNodeAfter",value:function(r,h){return i(h,r,h.next,this)}},{key:"push",value:function(r){return i(this.tail,t(r),null,this)}},{key:"unshift",value:function(r){return i(null,t(r),this.head,this)}},{key:"remove",value:function(r){return l(r,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(r){if(r<=this.length()){for(var h=1,a=this.head;h<r;)a=a.next,h++;return a.value}}},{key:"set_object_at",value:function(r,h){if(r<=this.length()){for(var a=1,p=this.head;a<r;)p=p.next,a++;p.value=h}}}]),n})();N.exports=g}),(function(N,I,T){function o(e,t,i){this.x=null,this.y=null,e==null&&t==null&&i==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&i==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&i==null&&(i=e,this.x=i.x,this.y=i.y)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.getLocation=function(){return new o(this.x,this.y)},o.prototype.setLocation=function(e,t,i){e.constructor.name=="Point"&&t==null&&i==null?(i=e,this.setLocation(i.x,i.y)):typeof e=="number"&&typeof t=="number"&&i==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},o.prototype.move=function(e,t){this.x=e,this.y=t},o.prototype.translate=function(e,t){this.x+=e,this.y+=t},o.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},o.prototype.toString=function(){return new o().constructor.name+"[x="+this.x+",y="+this.y+"]"},N.exports=o}),(function(N,I,T){function o(e,t,i,l){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&i!=null&&l!=null&&(this.x=e,this.y=t,this.width=i,this.height=l)}o.prototype.getX=function(){return this.x},o.prototype.setX=function(e){this.x=e},o.prototype.getY=function(){return this.y},o.prototype.setY=function(e){this.y=e},o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(e){this.width=e},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(e){this.height=e},o.prototype.getRight=function(){return this.x+this.width},o.prototype.getBottom=function(){return this.y+this.height},o.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},o.prototype.getCenterX=function(){return this.x+this.width/2},o.prototype.getMinX=function(){return this.getX()},o.prototype.getMaxX=function(){return this.getX()+this.width},o.prototype.getCenterY=function(){return this.y+this.height/2},o.prototype.getMinY=function(){return this.getY()},o.prototype.getMaxY=function(){return this.getY()+this.height},o.prototype.getWidthHalf=function(){return this.width/2},o.prototype.getHeightHalf=function(){return this.height/2},N.exports=o}),(function(N,I,T){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var i=typeof t>"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p<a.length;p++)v[p]=a[p];return v}else return Array.from(a)}var e=T(0),t=T(6),i=T(3),l=T(1),g=T(5),n=T(4),d=T(17),r=T(27);function h(a){r.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,a!=null&&(this.isRemoteUse=a)}h.RANDOM_SEED=1,h.prototype=Object.create(r.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var a=new t(this);return this.graphManager=a,a},h.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},h.prototype.newNode=function(a){return new i(this.graphManager,a)},h.prototype.newEdge=function(a){return new l(null,null,a)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var a;return this.checkLayoutSuccess()?a=!1:a=this.layout(),e.ANIMATE==="during"?!1:(a&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,a)},h.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var a=this.graphManager.getAllEdges(),p=0;p<a.length;p++)a[p];for(var v=this.graphManager.getRoot().getNodes(),p=0;p<v.length;p++)v[p];this.update(this.graphManager.getRoot())}},h.prototype.update=function(a){if(a==null)this.update2();else if(a instanceof i){var p=a;if(p.getChild()!=null)for(var v=p.getChild().getNodes(),D=0;D<v.length;D++)update(v[D]);if(p.vGraphObject!=null){var u=p.vGraphObject;u.update(p)}}else if(a instanceof l){var E=a;if(E.vGraphObject!=null){var y=E.vGraphObject;y.update(E)}}else if(a instanceof g){var O=a;if(O.vGraphObject!=null){var s=O.vGraphObject;s.update(O)}}},h.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},h.prototype.transform=function(a){if(a==null)this.transform(new n(0,0));else{var p=new d,v=this.graphManager.getRoot().updateLeftTop();if(v!=null){p.setWorldOrgX(a.x),p.setWorldOrgY(a.y),p.setDeviceOrgX(v.x),p.setDeviceOrgY(v.y);for(var D=this.getAllNodes(),u,E=0;E<D.length;E++)u=D[E],u.transform(p)}}},h.prototype.positionNodesRandomly=function(a){if(a==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var p,v,D=a.getNodes(),u=0;u<D.length;u++)p=D[u],v=p.getChild(),v==null||v.getNodes().length==0?p.scatter():(this.positionNodesRandomly(v),p.updateBounds())},h.prototype.getFlatForest=function(){for(var a=[],p=!0,v=this.graphManager.getRoot().getNodes(),D=!0,u=0;u<v.length;u++)v[u].getChild()!=null&&(D=!1);if(!D)return a;var E=new Set,y=[],O=new Map,s=[];for(s=s.concat(v);s.length>0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u<c.length;u++){var L=c[u].getOtherEnd(f);if(O.get(f)!=L)if(!E.has(L))y.push(L),O.set(L,f);else{p=!1;break}}}if(!p)a=[];else{var A=[].concat(o(E));a.push(A);for(var u=0;u<A.length;u++){var m=A[u],C=s.indexOf(m);C>-1&&s.splice(C,1)}E=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;u<a.bendpoints.length;u++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),D.add(E);var y=this.newEdge(null);this.graphManager.add(y,v,E),p.add(E),v=E}var y=this.newEdge(null);return this.graphManager.add(y,v,a.target),this.edgeToDummyNodes.set(a,p),a.isInterGraph()?this.graphManager.remove(a):D.remove(a),p},h.prototype.createBendpointsFromDummyNodes=function(){var a=[];a=a.concat(this.graphManager.getAllEdges()),a=[].concat(o(this.edgeToDummyNodes.keys())).concat(a);for(var p=0;p<a.length;p++){var v=a[p];if(v.bendpoints.length>0){for(var D=this.edgeToDummyNodes.get(v),u=0;u<D.length;u++){var E=D[u],y=new n(E.getCenterX(),E.getCenterY()),O=v.bendpoints.get(u);O.x=y.x,O.y=y.y,E.getOwner().remove(E)}this.graphManager.add(v,v.source,v.target)}}},h.transform=function(a,p,v,D){if(v!=null&&D!=null){var u=p;if(a<=50){var E=p/v;u-=(p-E)/50*(50-a)}else{var y=p*D;u+=(y-p)/50*(a-50)}return u}else{var O,s;return a<=50?(O=9*p/500,s=p/10):(O=9*p/50,s=-8*p),O*a+s}},h.findCenterOfTree=function(a){var p=[];p=p.concat(a);var v=[],D=new Map,u=!1,E=null;(p.length==1||p.length==2)&&(u=!0,E=p[0]);for(var y=0;y<p.length;y++){var O=p[y],s=O.getNeighborsList().size;D.set(O,O.getNeighborsList().size),s==1&&v.push(O)}var f=[];for(f=f.concat(v);!u;){var c=[];c=c.concat(f),f=[];for(var y=0;y<p.length;y++){var O=p[y],L=p.indexOf(O);L>=0&&p.splice(L,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,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,T){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,T){var o=T(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,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);h<r.length;h++)a[h]=r[h];return a}else return Array.from(r)}var e=T(15),t=T(7),i=T(0),l=T(8),g=T(9);function n(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}n.prototype=Object.create(e.prototype);for(var d in e)n[d]=e[d];n.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},n.prototype.calcIdealEdgeLengths=function(){for(var r,h,a,p,v,D,u=this.getGraphManager().getAllEdges(),E=0;E<u.length;E++)r=u[E],r.idealLength=this.idealEdgeLength,r.isInterGraph&&(a=r.getSource(),p=r.getTarget(),v=r.getSourceInLca().getEstimatedSize(),D=r.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(r.idealLength+=v+D-2*i.SIMPLE_NODE_SIZE),h=r.getLca().getInclusionTreeDepth(),r.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(a.getInclusionTreeDepth()+p.getInclusionTreeDepth()-2*h))},n.prototype.initSpringEmbedder=function(){var r=this.getAllNodes().length;this.incremental?(r>t.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;a<r.length;a++)h=r[a],this.calcSpringForce(h,h.idealLength)},n.prototype.calcRepulsionForces=function(){var r=arguments.length>0&&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(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;a<u.length;a++)v=u[a],this.calculateRepulsionForceOfANode(v,E,r,h),E.add(v);else for(a=0;a<u.length;a++)for(v=u[a],p=a+1;p<u.length;p++)D=u[p],v.getOwner()==D.getOwner()&&this.calcRepulsionForce(v,D)},n.prototype.calcGravitationalForces=function(){for(var r,h=this.getAllNodesToApplyGravitation(),a=0;a<h.length;a++)r=h[a],this.calcGravitationalForce(r)},n.prototype.moveNodes=function(){for(var r=this.getAllNodes(),h,a=0;a<r.length;a++)h=r[a],h.move()},n.prototype.calcSpringForce=function(r,h){var a=r.getSource(),p=r.getTarget(),v,D,u,E;if(this.uniformLeafNodeSizes&&a.getChild()==null&&p.getChild()==null)r.updateLengthSimple();else if(r.updateLength(),r.isOverlapingSourceAndTarget)return;v=r.getLength(),v!=0&&(D=this.springConstant*(v-h),u=D*(r.lengthX/v),E=D*(r.lengthY/v),a.springForceX+=u,a.springForceY+=E,p.springForceX-=u,p.springForceY-=E)},n.prototype.calcRepulsionForce=function(r,h){var a=r.getRect(),p=h.getRect(),v=new Array(2),D=new Array(4),u,E,y,O,s,f,c;if(a.intersects(p)){l.calcSeparationAmount(a,p,v,t.DEFAULT_EDGE_LENGTH/2),f=2*v[0],c=2*v[1];var L=r.noOfChildren*h.noOfChildren/(r.noOfChildren+h.noOfChildren);r.repulsionForceX-=L*f,r.repulsionForceY-=L*c,h.repulsionForceX+=L*f,h.repulsionForceY+=L*c}else this.uniformLeafNodeSizes&&r.getChild()==null&&h.getChild()==null?(u=p.getCenterX()-a.getCenterX(),E=p.getCenterY()-a.getCenterY()):(l.getIntersection(a,p,D),u=D[2]-D[0],E=D[3]-D[1]),Math.abs(u)<t.MIN_REPULSION_DIST&&(u=g.sign(u)*t.MIN_REPULSION_DIST),Math.abs(E)<t.MIN_REPULSION_DIST&&(E=g.sign(E)*t.MIN_REPULSION_DIST),y=u*u+E*E,O=Math.sqrt(y),s=this.repulsionConstant*r.noOfChildren*h.noOfChildren/y,f=s*u/O,c=s*E/O,r.repulsionForceX-=f,r.repulsionForceY-=c,h.repulsionForceX+=f,h.repulsionForceY+=c},n.prototype.calcGravitationalForce=function(r){var h,a,p,v,D,u,E,y;h=r.getOwner(),a=(h.getRight()+h.getLeft())/2,p=(h.getTop()+h.getBottom())/2,v=r.getCenterX()-a,D=r.getCenterY()-p,u=Math.abs(v)+r.getWidth()/2,E=Math.abs(D)+r.getHeight()/2,r.getOwner()==this.graphManager.getRoot()?(y=h.getEstimatedSize()*this.gravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>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<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,r||h},n.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},n.prototype.calcNoOfChildrenForAllNodes=function(){for(var r,h=this.graphManager.getAllNodes(),a=0;a<h.length;a++)r=h[a],r.noOfChildren=r.getNoOfChildren()},n.prototype.calcGrid=function(r){var h=0,a=0;h=parseInt(Math.ceil((r.getRight()-r.getLeft())/this.repulsionRange)),a=parseInt(Math.ceil((r.getBottom()-r.getTop())/this.repulsionRange));for(var p=new Array(h),v=0;v<h;v++)p[v]=new Array(a);for(var v=0;v<h;v++)for(var D=0;D<a;D++)p[v][D]=new Array;return p},n.prototype.addNodeToGrid=function(r,h,a){var p=0,v=0,D=0,u=0;p=parseInt(Math.floor((r.getRect().x-h)/this.repulsionRange)),v=parseInt(Math.floor((r.getRect().width+r.getRect().x-h)/this.repulsionRange)),D=parseInt(Math.floor((r.getRect().y-a)/this.repulsionRange)),u=parseInt(Math.floor((r.getRect().height+r.getRect().y-a)/this.repulsionRange));for(var E=p;E<=v;E++)for(var y=D;y<=u;y++)this.grid[E][y].push(r),r.setGridCoordinates(p,v,D,u)},n.prototype.updateGrid=function(){var r,h,a=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),r=0;r<a.length;r++)h=a[r],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},n.prototype.calculateRepulsionForceOfANode=function(r,h,a,p){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&a||p){var v=new Set;r.surrounding=new Array;for(var D,u=this.grid,E=r.startX-1;E<r.finishX+2;E++)for(var y=r.startY-1;y<r.finishY+2;y++)if(!(E<0||y<0||E>=u.length||y>=u[0].length)){for(var O=0;O<u[E][y].length;O++)if(D=u[E][y][O],!(r.getOwner()!=D.getOwner()||r==D)&&!h.has(D)&&!v.has(D)){var s=Math.abs(r.getCenterX()-D.getCenterX())-(r.getWidth()/2+D.getWidth()/2),f=Math.abs(r.getCenterY()-D.getCenterY())-(r.getHeight()/2+D.getHeight()/2);s<=this.repulsionRange&&f<=this.repulsionRange&&v.add(D)}}r.surrounding=[].concat(o(v))}for(E=0;E<r.surrounding.length;E++)this.calcRepulsionForce(r,r.surrounding[E])},n.prototype.calcRepulsionRange=function(){return 0},N.exports=n}),(function(N,I,T){var o=T(1),e=T(7);function t(l,g,n){o.call(this,l,g,n),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(o.prototype);for(var i in o)t[i]=o[i];N.exports=t}),(function(N,I,T){var o=T(3);function e(i,l,g,n){o.call(this,i,l,g,n),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}e.prototype=Object.create(o.prototype);for(var t in o)e[t]=o[t];e.prototype.setGridCoordinates=function(i,l,g,n){this.startX=i,this.finishX=l,this.startY=g,this.finishY=n},N.exports=e}),(function(N,I,T){function o(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(e){this.width=e},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(e){this.height=e},N.exports=o}),(function(N,I,T){var o=T(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,i){var l=o.createID(t);this.contains(l)||(this.map[l]=i,this.keys.push(t))},e.prototype.contains=function(t){return o.createID(t),this.map[t]!=null},e.prototype.get=function(t){var i=o.createID(t);return this.map[i]},e.prototype.keySet=function(){return this.keys},N.exports=e}),(function(N,I,T){var o=T(14);function e(){this.set={}}e.prototype.add=function(t){var i=o.createID(t);this.contains(i)||(this.set[i]=t)},e.prototype.remove=function(t){delete this.set[o.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[o.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),l=i.length,g=0;g<l;g++)t.push(this.set[i[g]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var i=t.length,l=0;l<i;l++){var g=t[l];this.add(g)}},N.exports=e}),(function(N,I,T){var o=(function(){function l(g,n){for(var d=0;d<n.length;d++){var r=n[d];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(g,r.key,r)}}return function(g,n,d){return n&&l(g.prototype,n),d&&l(g,d),g}})();function e(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}var t=T(11),i=(function(){function l(g,n){e(this,l),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;g instanceof t?d=g.size():d=g.length,this._quicksort(g,0,d-1)}return o(l,[{key:"_quicksort",value:function(n,d,r){if(d<r){var h=this._partition(n,d,r);this._quicksort(n,d,h),this._quicksort(n,h+1,r)}}},{key:"_partition",value:function(n,d,r){for(var h=this._get(n,d),a=d,p=r;;){for(;this.compareFunction(h,this._get(n,p));)p--;for(;this.compareFunction(this._get(n,a),h);)a++;if(a<p)this._swap(n,a,p),a++,p--;else return p}}},{key:"_get",value:function(n,d){return n instanceof t?n.get_object_at(d):n[d]}},{key:"_set",value:function(n,d,r){n instanceof t?n.set_object_at(d,r):n[d]=r}},{key:"_swap",value:function(n,d,r){var h=this._get(n,d);this._set(n,d,this._get(n,r)),this._set(n,r,h)}},{key:"_defaultCompareFunction",value:function(n,d){return d>n}}]),l})();N.exports=i}),(function(N,I,T){var o=(function(){function i(l,g){for(var n=0;n<g.length;n++){var d=g[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,g,n){return g&&i(l.prototype,g),n&&i(l,n),l}})();function e(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}var t=(function(){function i(l,g){var n=arguments.length>2&&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<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[h][a]=0}this.tracebackGrid=new Array(this.iMax);for(var p=0;p<this.iMax;p++){this.tracebackGrid[p]=new Array(this.jMax);for(var v=0;v<this.jMax;v++)this.tracebackGrid[p][v]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return o(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var n=1;n<this.iMax;n++)this.grid[n][0]=this.grid[n-1][0]+this.gap_penalty,this.tracebackGrid[n][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var r=1;r<this.jMax;r++){var h=void 0;this.sequence1[d-1]===this.sequence2[r-1]?h=this.grid[d-1][r-1]+this.match_score:h=this.grid[d-1][r-1]+this.mismatch_penalty;var a=this.grid[d-1][r]+this.gap_penalty,p=this.grid[d][r-1]+this.gap_penalty,v=[h,a,p],D=this.arrayAllMaxIndexes(v);this.grid[d][r]=v[D[0]],this.tracebackGrid[d][r]=[D.includes(0),D.includes(1),D.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];for(g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});g[0];){var n=g[0],d=this.tracebackGrid[n.pos[0]][n.pos[1]];d[0]&&g.push({pos:[n.pos[0]-1,n.pos[1]-1],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),d[1]&&g.push({pos:[n.pos[0]-1,n.pos[1]],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:"-"+n.seq2}),d[2]&&g.push({pos:[n.pos[0],n.pos[1]-1],seq1:"-"+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),n.pos[0]===0&&n.pos[1]===0&&this.alignments.push({sequence1:n.seq1,sequence2:n.seq2}),g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,n){for(var d=[],r=-1;(r=g.indexOf(n,r+1))!==-1;)d.push(r);return d}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),i})();N.exports=t}),(function(N,I,T){var o=function(){};o.FDLayout=T(18),o.FDLayoutConstants=T(7),o.FDLayoutEdge=T(19),o.FDLayoutNode=T(20),o.DimensionD=T(21),o.HashMap=T(22),o.HashSet=T(23),o.IGeometry=T(8),o.IMath=T(9),o.Integer=T(10),o.Point=T(12),o.PointD=T(4),o.RandomSeed=T(16),o.RectangleD=T(13),o.Transform=T(17),o.UniqueIDGeneretor=T(14),o.Quicksort=T(24),o.LinkedList=T(11),o.LGraphObject=T(2),o.LGraph=T(5),o.LEdge=T(1),o.LGraphManager=T(6),o.LNode=T(3),o.Layout=T(15),o.LayoutConstants=T(0),o.NeedlemanWunsch=T(25),N.exports=o}),(function(N,I,T){function o(){this.listeners=[]}var e=o.prototype;e.addListener=function(t,i){this.listeners.push({event:t,callback:i})},e.removeListener=function(t,i){for(var l=this.listeners.length;l>=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;l<this.listeners.length;l++){var g=this.listeners[l];t===g.event&&g.callback(i)}},N.exports=o})])})})(Q)),Q.exports}var ct=$.exports,z;function pt(){return z||(z=1,(function(G,b){(function(I,T){G.exports=T(ft())})(ct,function(N){return(function(I){var T={};function o(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=I,o.c=T,o.i=function(e){return e},o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=7)})([(function(I,T){I.exports=N}),(function(I,T,o){var e=o(0).FDLayoutConstants;function t(){}for(var i in e)t[i]=e[i];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,I.exports=t}),(function(I,T,o){var e=o(0).FDLayoutEdge;function t(l,g,n){e.call(this,l,g,n)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t}),(function(I,T,o){var e=o(0).LGraph;function t(l,g,n){e.call(this,l,g,n)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t}),(function(I,T,o){var e=o(0).LGraphManager;function t(l){e.call(this,l)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t}),(function(I,T,o){var e=o(0).FDLayoutNode,t=o(0).IMath;function i(g,n,d,r){e.call(this,g,n,d,r)}i.prototype=Object.create(e.prototype);for(var l in e)i[l]=e[l];i.prototype.move=function(){var g=this.graphManager.getLayout();this.displacementX=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>g.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;h<d.length;h++)r=d[h],r.getChild()==null?(r.moveBy(g,n),r.displacementX+=g,r.displacementY+=n):r.propogateDisplacementToChildren(g,n)},i.prototype.setPred1=function(g){this.pred1=g},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(g){this.next=g},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(g){this.processed=g},i.prototype.isProcessed=function(){return processed},I.exports=i}),(function(I,T,o){var e=o(0).FDLayout,t=o(4),i=o(3),l=o(5),g=o(2),n=o(1),d=o(0).FDLayoutConstants,r=o(0).LayoutConstants,h=o(0).Point,a=o(0).PointD,p=o(0).Layout,v=o(0).Integer,D=o(0).IGeometry,u=o(0).LGraph,E=o(0).Transform;function y(){e.call(this),this.toBeTiled={}}y.prototype=Object.create(e.prototype);for(var O in e)y[O]=e[O];y.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},y.prototype.newGraph=function(s){return new i(null,this.graphManager,s)},y.prototype.newNode=function(s){return new l(this.graphManager,s)},y.prototype.newEdge=function(s){return new g(null,null,s)},y.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(n.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=n.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=d.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=d.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=d.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},y.prototype.layout=function(){var s=r.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.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(n.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(m){return f.has(m)});this.graphManager.setAllNodesToApplyGravitation(c)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});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,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c<s.length;c++){var L=s[c].rect,A=s[c].id;f[A]={id:A,x:L.getCenterX(),y:L.getCenterY(),w:L.width,h:L.height}}return f},y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},y.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],f,c=this.graphManager.getGraphs(),L=c.length,A;for(A=0;A<L;A++)f=c[A],f.updateConnected(),f.isConnected||(s=s.concat(f.getNodes()));return s},y.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var f=new Set,c;for(c=0;c<s.length;c++){var L=s[c];if(!f.has(L)){var A=L.getSource(),m=L.getTarget();if(A==m)L.getBendpoints().push(new a),L.getBendpoints().push(new a),this.createDummyNodesForBendpoints(L),f.add(L);else{var C=[];if(C=C.concat(A.getEdgeListToNode(m)),C=C.concat(m.getEdgeListToNode(A)),!f.has(C[0])){if(C.length>1){var R;for(R=0;R<C.length;R++){var M=C[R];M.getBendpoints().push(new a),this.createDummyNodesForBendpoints(M)}}C.forEach(function(S){f.add(S)})}}}if(f.size==s.length)break}},y.prototype.positionNodesRadially=function(s){for(var f=new h(0,0),c=Math.ceil(Math.sqrt(s.length)),L=0,A=0,m=0,C=new a(0,0),R=0;R<s.length;R++){R%c==0&&(m=0,A=L,R!=0&&(A+=n.DEFAULT_COMPONENT_SEPERATION),L=0);var M=s[R],S=p.findCenterOfTree(M);f.x=m,f.y=A,C=y.radialLayout(M,S,f),C.y>L&&(L=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 L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C<s.length;C++){var R=s[C];R.transform(m)}var M=new a(A.getMaxX(),A.getMaxY());return m.inverseTransformPoint(M)},y.branchRadialLayout=function(s,f,c,L,A,m){var C=(L-c+1)/2;C<0&&(C+=180);var R=(C+c)%360,M=R*D.TWO_PI/360,S=A*Math.cos(M),Y=A*Math.sin(M);s.setCenter(S,Y);var w=[];w=w.concat(s.getEdges());var x=w.length;f!=null&&x--;for(var F=0,U=w.length,P,_=s.getEdgesBetween(f);_.length>1;){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(L-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;c<s.length;c++){var L=s[c],A=L.getDiagonal();A>f&&(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=[],L=this.graphManager.getAllNodes(),A=0;A<L.length;A++){var m=L[A],C=m.getParent();this.getNodeDegreeWithChildren(m)===0&&(C.id==null||!this.getToBeTiled(C))&&c.push(m)}for(var A=0;A<c.length;A++){var m=c[A],R=m.getParent().id;typeof f[R]>"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<f[M].length;U++){var P=f[M][U];F.remove(P),x.add(P)}}})},y.prototype.clearCompounds=function(){var s={},f={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)f[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,f)},y.prototype.clearZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var L=s.idToDummyNode[c];f[c]=s.tileNodes(s.memberGroups[c],L.paddingLeft+L.paddingRight),L.rect.width=f[c].width,L.rect.height=f[c].height})},y.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.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 L=c.getNodes(),A=0;A<L.length;A++){var m=L[A];if(this.getNodeDegree(m)>0)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,L=0;L<f.length;L++){var A=f[L];A.getSource().id!==A.getTarget().id&&(c=c+1)}return c},y.prototype.getNodeDegreeWithChildren=function(s){var f=this.getNodeDegree(s);if(s.getChild()==null)return f;for(var c=s.getChild().getNodes(),L=0;L<c.length;L++){var A=c[L];f+=this.getNodeDegreeWithChildren(A)}return f},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.prototype.fillCompexOrderByDFS=function(s){for(var f=0;f<s.length;f++){var c=s[f];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},y.prototype.adjustLocations=function(s,f,c,L,A){f+=L,c+=A;for(var m=f,C=0;C<s.rows.length;C++){var R=s.rows[C];f=m;for(var M=0,S=0;S<R.length;S++){var Y=R[S];Y.rect.x=f,Y.rect.y=c,f+=Y.rect.width+s.horizontalPadding,Y.rect.height>M&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height<M.rect.width*M.rect.height?1:0});for(var m=0;m<s.length;m++){var C=s[m];A.rows.length==0?this.insertNodeToRow(A,C,0,f):this.canAddHorizontal(A,C.rect.width,C.rect.height)?this.insertNodeToRow(A,C,this.getShortestRowIndex(A),f):this.insertNodeToRow(A,C,A.rows.length,f),this.shiftToLastRow(A)}return A},y.prototype.insertNodeToRow=function(s,f,c,L){var A=L;if(c==s.rows.length){var m=[];s.rows.push(m),s.rowWidth.push(A),s.rowHeight.push(0)}var C=s.rowWidth[c]+f.rect.width;s.rows[c].length>0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width<C&&(s.width=C);var R=f.rect.height;c>0&&(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,L=0;L<s.rows.length;L++)s.rowWidth[L]<c&&(f=L,c=s.rowWidth[L]);return f},y.prototype.getLongestRowIndex=function(s){for(var f=-1,c=Number.MIN_VALUE,L=0;L<s.rows.length;L++)s.rowWidth[L]>c&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]<c&&L>0&&(m=c+s.verticalPadding-s.rowHeight[L]);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.width<f?R=(s.height+m)/f:R=(s.height+m)/s.width,R<1&&(R=1/R),C<1&&(C=1/C),C<R},y.prototype.shiftToLastRow=function(s){var f=this.getLongestRowIndex(s),c=s.rowWidth.length-1,L=s.rows[f],A=L[L.length-1],m=A.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>m&&f!=c){L.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;R<L.length;R++)L[R].height>C&&(C=L[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]<A.height+s.verticalPadding&&(s.rowHeight[c]=A.height+s.verticalPadding);var S=s.rowHeight[f]+s.rowHeight[c];s.height+=S-M,this.shiftToLastRow(s)}},y.prototype.tilingPreLayout=function(){n.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){n.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.prototype.reduceTrees=function(){for(var s=[],f=!0,c;f;){var L=this.graphManager.getAllNodes(),A=[];f=!1;for(var m=0;m<L.length;m++)c=L[m],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(A.push([c,c.getEdges()[0],c.getOwner()]),f=!0);if(f==!0){for(var C=[],R=0;R<A.length;R++)A[R][0].getEdges().length==1&&(C.push(A[R]),A[R][0].getOwner().remove(A[R][0]));s.push(C),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},y.prototype.growTree=function(s){for(var f=s.length,c=s[f-1],L,A=0;A<c.length;A++)L=c[A],this.findPlaceforPrunedNode(L),L[2].add(L[0]),L[2].add(L[1],L[1].source,L[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},y.prototype.findPlaceforPrunedNode=function(s){var f,c,L=s[0];L==s[1].source?c=s[1].target:c=s[1].source;var A=c.startX,m=c.finishX,C=c.startY,R=c.finishY,M=0,S=0,Y=0,w=0,x=[M,Y,S,w];if(C>0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m<this.grid.length-1)for(var F=C;F<=R;F++)x[1]+=this.grid[m+1][F].length+this.grid[m][F].length-1;if(R<this.grid[0].length-1)for(var F=A;F<=m;F++)x[2]+=this.grid[F][R+1].length+this.grid[F][R].length-1;if(A>0)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;X<x.length;X++)x[X]<U?(U=x[X],P=1,_=X):x[X]==U&&P++;if(P==3&&U==0)x[0]==0&&x[1]==0&&x[2]==0?f=1:x[0]==0&&x[1]==0&&x[3]==0?f=0:x[0]==0&&x[2]==0&&x[3]==0?f=3:x[1]==0&&x[2]==0&&x[3]==0&&(f=2);else if(P==2&&U==0){var H=Math.floor(Math.random()*2);x[0]==0&&x[1]==0?H==0?f=0:f=1:x[0]==0&&x[2]==0?H==0?f=0:f=2:x[0]==0&&x[3]==0?H==0?f=0:f=3:x[1]==0&&x[2]==0?H==0?f=1:f=2:x[1]==0&&x[3]==0?H==0?f=1:f=3:H==0?f=2:f=3}else if(P==4&&U==0){var H=Math.floor(Math.random()*4);f=H}else f=_;f==0?L.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-d.DEFAULT_EDGE_LENGTH-L.getHeight()/2):f==1?L.setCenter(c.getCenterX()+c.getWidth()/2+d.DEFAULT_EDGE_LENGTH+L.getWidth()/2,c.getCenterY()):f==2?L.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+d.DEFAULT_EDGE_LENGTH+L.getHeight()/2):L.setCenter(c.getCenterX()-c.getWidth()/2-d.DEFAULT_EDGE_LENGTH-L.getWidth()/2,c.getCenterY())},I.exports=y}),(function(I,T,o){var e={};e.layoutBase=o(0),e.CoSEConstants=o(1),e.CoSEEdge=o(2),e.CoSEGraph=o(3),e.CoSEGraphManager=o(4),e.CoSELayout=o(6),e.CoSENode=o(5),I.exports=e})])})})($)),$.exports}var dt=Z.exports,J;function vt(){return J||(J=1,(function(G,b){(function(I,T){G.exports=T(pt())})(dt,function(N){return(function(I){var T={};function o(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=I,o.c=T,o.i=function(e){return e},o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)})([(function(I,T){I.exports=N}),(function(I,T,o){var e=o(0).layoutBase.LayoutConstants,t=o(0).layoutBase.FDLayoutConstants,i=o(0).CoSEConstants,l=o(0).CoSELayout,g=o(0).CoSENode,n=o(0).layoutBase.PointD,d=o(0).layoutBase.DimensionD,r={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function h(D,u){var E={};for(var y in D)E[y]=D[y];for(var y in u)E[y]=u[y];return E}function a(D){this.options=h(r,D),p(this.options)}var p=function(u){u.nodeRepulsion!=null&&(i.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=u.nodeRepulsion),u.idealEdgeLength!=null&&(i.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=u.idealEdgeLength),u.edgeElasticity!=null&&(i.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=u.edgeElasticity),u.nestingFactor!=null&&(i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.nestingFactor),u.gravity!=null&&(i.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=u.gravity),u.numIter!=null&&(i.MAX_ITERATIONS=t.MAX_ITERATIONS=u.numIter),u.gravityRange!=null&&(i.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=u.gravityRange),u.gravityCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.gravityCompound),u.gravityRangeCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.gravityRangeCompound),u.initialEnergyOnIncremental!=null&&(i.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.initialEnergyOnIncremental),u.quality=="draft"?e.QUALITY=0:u.quality=="proof"?e.QUALITY=2:e.QUALITY=1,i.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=u.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!u.randomize,i.ANIMATE=t.ANIMATE=e.ANIMATE=u.animate,i.TILE=u.tile,i.TILING_PADDING_VERTICAL=typeof u.tilingPaddingVertical=="function"?u.tilingPaddingVertical.call():u.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof u.tilingPaddingHorizontal=="function"?u.tilingPaddingHorizontal.call():u.tilingPaddingHorizontal};a.prototype.run=function(){var D,u,E=this.options;this.idToLNode={};var y=this.layout=new l,O=this;O.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=y.newGraphManager();this.gm=s;var f=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(f),y);for(var L=0;L<c.length;L++){var A=c[L],m=this.idToLNode[A.data("source")],C=this.idToLNode[A.data("target")];if(m!==C&&m.getEdgesBetween(C).length==0){var R=s.add(y.newEdge(),m,C);R.id=A.id()}}var M=function(w,x){typeof w=="number"&&(w=x);var F=w.data("id"),U=O.idToLNode[F];return{x:U.getRect().getCenterX(),y:U.getRect().getCenterY()}},S=function Y(){for(var w=function(){E.fit&&E.cy.fit(E.eles,E.padding),D||(D=!0,O.cy.one("layoutready",E.ready),O.cy.trigger({type:"layoutready",layout:O}))},x=O.options.refresh,F,U=0;U<x&&!F;U++)F=O.stopped||O.layout.tick();if(F){y.checkLayoutSuccess()&&!y.isSubLayout&&y.doPostLayout(),y.tilingPostLayout&&y.tilingPostLayout(),y.isLayoutFinished=!0,O.options.eles.nodes().positions(M),w(),O.cy.one("layoutstop",O.options.stop),O.cy.trigger({type:"layoutstop",layout:O}),u&&cancelAnimationFrame(u),D=!1;return}var P=O.layout.getPositionsData();E.eles.nodes().positions(function(_,X){if(typeof _=="number"&&(_=X),!_.isParent()){for(var H=_.id(),W=P[H],B=_;W==null&&(W=P[B.data("parent")]||P["DummyCompound_"+B.data("parent")],P[H]=W,B=B.parent()[0],B!=null););return W!=null?{x:W.x,y:W.y}:{x:_.position("x"),y:_.position("y")}}}),w(),u=requestAnimationFrame(Y)};return y.addListener("layoutstarted",function(){O.options.animate==="during"&&(u=requestAnimationFrame(S))}),y.runLayout(),this.options.animate!=="during"&&(O.options.eles.nodes().not(":parent").layoutPositions(O,O.options,M),D=!1),this},a.prototype.getTopMostNodes=function(D){for(var u={},E=0;E<D.length;E++)u[D[E].id()]=!0;var y=D.filter(function(O,s){typeof O=="number"&&(O=s);for(var f=O.parent()[0];f!=null;){if(u[f.id()])return!1;f=f.parent()[0]}return!0});return y},a.prototype.processChildrenList=function(D,u,E){for(var y=u.length,O=0;O<y;O++){var s=u[O],f=s.children(),c,L=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=D.add(new g(E.graphManager,new n(s.position("x")-L.w/2,s.position("y")-L.h/2),new d(parseFloat(L.w),parseFloat(L.h)))):c=D.add(new g(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var A=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,m=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,C=s.css("text-halign");c.labelWidth=A,c.labelHeight=m,c.labelPos=C}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),f!=null&&f.length>0){var R;R=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(R,f,E)}}},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})])})})(Z)),Z.exports}var yt=vt();const Et=gt(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(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),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(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("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 T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={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)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.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:T,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 E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.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 E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.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 T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&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,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Nt=Lt;export{Nt as render};
|